How ccmarin14/tts-service works
Project type and purpose
• This is a backend-only, full-stack Microservice/API (no UI) built on FastAPI.
• Purpose: Expose REST endpoints to convert text→speech via multiple online TTS providers, cache results, store metadata in MySQL, store audio files in AWS S3, and support zip-upload of sample audio files.
File structure
Top-level:
• app/: main application code
• controllers/: FastAPI endpoint handlers
• validators/: request validation logic
• services/:
• tts/: core TTS orchestration
• database/: MySQL operations
• storage/: local file & S3 operations
• zip_service: zip-upload processing
• container_service: service-locator bootstrap
• providers/: concrete TTS providers (PlayHT, Polly, Voicemaker) behind a base interface
• models/: Pydantic models for payloads & DB metadata
• utils/: YAML config loader
• static_files.py & resources/: for mounting temporary folders
• main.py: instantiates FastAPI, includes routers, middleware, static mounts
• config.yaml: deployment config
• .env.example: secret definitions
• Dockerfile + docker-compose.yml: container setup
• requirements.txt: Python deps
README insights
• Highlights a two-level cache of audio_hash→URL.
• Emphasizes Docker, AWS S3, MySQL, YAML config.
Detailed checklist
• API Layer: FastAPI (main.py + controllers)
• Validation: tts_validator
• Service Layer: container_service, tts_service, zip_service, db_service, file_service, s3_service
• Provider Layer: base_provider + playht_provider, polly_provider, voicemaker_provider
• Data stores: MySQL, in-memory cache
• External: AWS S3, TTS APIs
• Config: YAML loader, .env
• Deployment: Docker container, ports, environment variables