A distributed, cloud-native microservices project that allows users to upload videos and receive their converted MP3s. Built using Docker, Kubernetes, Flask, RabbitMQ, GridFS, and MySQL, the system ensures asynchronous processing, secure authentication, and efficient delivery of audio files.
All services run in a Kubernetes cluster and communicate via RabbitMQ and REST APIs.
| Layer | Stack/Tool |
|---|---|
| API Framework | Flask |
| Authentication | JWT + MySQL |
| File Storage | MongoDB + GridFS |
| Queue | RabbitMQ (video & mp3 queues) |
| Notification | SMTP (e.g., Gmail/Mailtrap) |
| Containerization | Docker |
| Orchestration | Kubernetes via Minikube |
| Gateway | NGINX |
| DevOps | K9s (for pod monitoring) |
- The client uploads a video via the API Gateway.
- The API Gateway forwards the request to the Auth Service, which:
- Verifies the JWT token.
- Checks credentials in the MySQL database.
- Approves/rejects the request based on authentication result.
- If authenticated, the API Gateway pushes the request to the
videoqueue in RabbitMQ. - The Converter Service (consumer of the
videoqueue):- Converts the video to MP3 using
ffmpeg. - Uploads the MP3 to MongoDB using GridFS.
- Extracts the MP3's ObjectID and pushes it to the
mp3queue.
- Converts the video to MP3 using
- The Notification Service (consumer of the
mp3queue):- Sends an email to the user containing the GridFS ObjectID.
- The User takes this ObjectID and sends a GET request to the API Gateway.
- The request is routed via NGINX.
- The Gateway fetches the MP3 using the ObjectID from GridFS and returns it to the client.
- Entry point for all user requests.
- Routes traffic to internal services using NGINX.
- Delegates authentication to the
auth-service. - Pushes jobs to RabbitMQ queues.
- Handles video upload and MP3 download logic.
- Responsible for authentication and authorization.
- Verifies user tokens and credentials.
- Interacts with the MySQL database.
- Used by the API Gateway to validate users.
- Consumes jobs from the
videoqueue. - Converts video to MP3 using
ffmpeg. - Uploads MP3 to MongoDB (GridFS).
- Publishes a message to the
mp3queue with the MP3's ObjectID.
- Consumes jobs from the
mp3queue. - Sends an email containing the MP3's ObjectID.
- Email does not contain a direct download link, but an ID the user can use to fetch the MP3 later.
- Docker
- Minikube
- kubectl
- Python 3.9+
ffmpeginstalled locally- SMTP credentials (Gmail or Mailtrap recommended)
git clone https://github.com/Abzaek/video_to_mp3.git
cd video_to_mp3
# Start Minikube
minikube start
# Deploy all services
cd <service-name>
kubectl apply -f manifests/
# Monitor pods
k9s