Project for AZUBI-Generation Ghana SAA cohort3
# Serverless Text-to-Speech Platform
A secure, scalable serverless TTS platform built on AWS that transforms text into high-quality audio using Amazon Polly.
## ποΈ Architecture
The platform uses a fully serverless architecture with these core components:
- **Frontend**: React SPA hosted on AWS Amplify
- **API**: HTTP API Gateway with Lambda backend
- **Processing**: Python Lambda function integrating with Amazon Polly
- **Storage**: Private S3 bucket with time-limited pre-signed URLs
- **Security**: IAM roles with least privilege access
### Data Flow
1. **User Input** β React UI captures text and voice preferences
2. **API Request** β HTTP API validates and routes to Lambda
3. **Speech Synthesis** β Lambda calls Polly for audio generation
4. **Secure Storage** β Audio saved to private S3 with organized prefixes
5. **Temporary Access** β Pre-signed URL generated with configurable TTL
6. **User Download** β Direct S3 access via time-limited secure link
## π Quick Start
### Prerequisites
- AWS CLI configured
- Terraform >= 1.5.0
- Node.js >= 18
- Git repository access
### Deployment
1. **Deploy Infrastructure**
```bash
cd infra
terraform init
terraform apply
```
2. **Deploy Frontend**
```bash
cd TTS-web
npm install
npm run build
# Connect to Amplify via console or CLI
```
3. **Test API**
```bash
# Get available voices
curl
your-api-id.execute-api.regβ¦
# Synthesize speech
curl -X POST
your-api-id.execute-api.reg⦠\
-H "Content-Type: application/json" \
-d '{"text":"Hello world","voice":"Joanna","engine":"neural"}'
```
## π Project Structure
```
Project-Azubi/
βββ documents/ # Documentation and images
β βββ images/
β βββ architecture-diagrams.svg
βββ backend/ # Lambda function code
β βββ lambda_function.py
β βββ requirements.txt
β βββ tests/
βββ infra/ # Terraform infrastructure
β βββ lambda/ # Copy of lambda β¦