Skip to content

JoanVasquez/video_streaming_fastapi_aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Microservices-Based Video Processing Platform

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.


πŸ“Œ Architecture Overview

Architecture Diagram


🧩 Microservices

1. πŸ” Authentication and User Management (FastAPI)

  • 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_token and refresh_token.

2. πŸ“¦ Consumer Service

  • 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.

3. πŸŽ₯ Transcoder Service

  • 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.

πŸ›  Technologies

  • Backend: FastAPI, SQLAlchemy, PostgreSQL
  • Cloud Services: AWS Cognito, S3, SQS, ECS Fargate
  • Processing: FFmpeg
  • Containerization: Docker
  • Config Management: pydantic-settings, .env files
  • DevOps: Docker Compose (for local DB & FastAPI)

πŸ“ Project Structure

. β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ main.py β”‚ β”œβ”€β”€ routes/ β”‚ β”œβ”€β”€ services/ β”‚ β”œβ”€β”€ db/ β”‚ β”œβ”€β”€ Dockerfile β”‚ └── ... β”œβ”€β”€ consumer/ β”‚ β”œβ”€β”€ main.py β”‚ └── Dockerfile β”œβ”€β”€ transcoder/ β”‚ β”œβ”€β”€ main.py β”‚ β”œβ”€β”€ transcode_video.py β”‚ └── Dockerfile β”œβ”€β”€ architecture_diagram.png └── README.md


πŸš€ Running Locally

1. 🐳 Docker Compose for Backend & DB

docker-compose up --build

# Example for consumer
cd consumer
python3 main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published