This project is a scalable, microservices-oriented platform for user authentication and secure video processing, built using FastAPI, AWS services (Cognito, S3, SQS, ECS), and FFmpeg.
- Uses AWS Cognito for secure user signup, login, OTP confirmation, and token refreshing.
- Stores user metadata (name, email, Cognito sub) in a PostgreSQL database via SQLAlchemy.
- Provides a secure cookie-based session mechanism using
access_tokenandrefresh_token.
- Polls messages from an SQS queue triggered by S3 file uploads.
- Launches ECS Fargate tasks to transcode uploaded videos.
- Reads environment configuration using
pydantic-settings.
- Runs inside ECS Fargate and uses FFmpeg to convert video files to adaptive streaming (DASH) formats.
- Downloads video from S3, transcodes to 360p, 720p, and 1080p, and uploads processed videos to another S3 bucket.
- Notifies the backend to update video processing status.
- Backend: FastAPI, SQLAlchemy, PostgreSQL
- Cloud Services: AWS Cognito, S3, SQS, ECS Fargate
- Processing: FFmpeg
- Containerization: Docker
- Config Management:
pydantic-settings,.envfiles - DevOps: Docker Compose (for local DB & FastAPI)
. βββ backend/ β βββ main.py β βββ routes/ β βββ services/ β βββ db/ β βββ Dockerfile β βββ ... βββ consumer/ β βββ main.py β βββ Dockerfile βββ transcoder/ β βββ main.py β βββ transcode_video.py β βββ Dockerfile βββ architecture_diagram.png βββ README.md
docker-compose up --build
# Example for consumer
cd consumer
python3 main.py