A production-ready FastAPI application for AI-powered audio content processing, built with modern Python development practices and containerized deployment.
This platform provides a robust REST API for uploading, processing, and managing audio content through a human-in-the-loop workflow. The system demonstrates enterprise-level software architecture with comprehensive testing, security measures, and scalable design patterns.
Backend Framework: FastAPI with Pydantic for data validation and automatic API documentation
Database: PostgreSQL with SQLAlchemy ORM and Alembic migrations for schema management
Task Processing: Celery with Redis message broker for asynchronous background jobs
File Storage: AWS S3 integration with presigned URLs for secure direct uploads
Authentication: JWT-based authentication with Argon2 password hashing
Containerization: Docker Compose for development and production deployment
Testing: Comprehensive test suite with pytest, including unit and integration tests
The application follows a layered architecture with clear separation of concerns:
- API Layer: FastAPI routers with dependency injection for authentication and database sessions
- Business Logic: CRUD operations and service classes for core functionality
- Data Layer: SQLAlchemy models with proper relationships and constraints
- Background Processing: Celery workers for handling time-intensive audio processing tasks
- External Services: S3 client abstraction for file storage operations
Secure File Upload: Multi-part upload support with content validation and size limits
User Management: Complete authentication flow with password security best practices
Project Lifecycle: Track audio processing projects from upload through completion
Background Processing: Asynchronous task execution with status monitoring and error handling
Input Validation: Comprehensive request validation preventing common security vulnerabilities
Structured Logging: JSON logging with request tracing for production monitoring
Database Migrations: Version-controlled schema changes using Alembic
- Docker and Docker Compose
- Git
git clone https://github.com/michaelscutari/hitl-audio-platform.git
cd hitl-audio-platform
cp .env-example .env
chmod +x dev.sh./dev.sh build
./dev.sh upThe API will be available at http://localhost:8000 with interactive documentation at http://localhost:8000/docs.
./dev.sh testThe project includes a comprehensive development environment with automated tooling:
Code Quality: Pre-commit hooks with Ruff for linting and formatting, MyPy for type checking, and Bandit for security analysis
Database Management: Automated migrations and easy database reset for development
Testing Strategy: Unit tests for business logic, integration tests for API endpoints, and mocked external services
Container Management: Development script for common Docker operations including building, testing, and debugging
The application provides OpenAPI documentation with example requests and responses. Key endpoints include:
- Authentication: User registration and JWT token generation
- Project Management: Create, update, and retrieve audio processing projects
- File Upload: Generate presigned URLs and complete multipart uploads
- Task Monitoring: Check status of background processing jobs
Access the interactive API documentation at /docs when running the application.
The platform implements multiple security layers including input validation, SQL injection prevention, secure file upload restrictions, and proper authentication token management. All user inputs are validated using Pydantic schemas with custom validators for file types and content restrictions.
The application includes production-oriented features such as comprehensive error handling with standardized responses, health check endpoints for container orchestration, configurable logging levels with structured output, and database connection pooling for performance optimization.
This project demonstrates practical experience with modern Python web development, containerization, database design, and production deployment considerations.