This is a simple MP4 to MP3 converter using Python, Flask, MySQL, K8s, and Docker. The application is a simple web application that allows users to upload an MP4 file and convert it to an MP3 file. The application will be based on a Microservices Architecture and will be deployed on Kubernetes.
- Python
- Flask
- MySQL
- K8s
- Docker
- Ubuntu 22.04
- Python 3.10.12
- Flask 3.0.2
- MySQL 8.0.36
- K8s 1.22.2
The application will be based on a Microservices Architecture. The application will consist of the following services:
- Frontend Service: This service will be responsible for handling the user interface. It will be a simple web application that allows users to upload an MP4 file and convert it to an MP3 file.
- API Gateway: This is the entry point for the system. It will be responsible for routing requests to the appropriate services.
- Auth service: This service will be responsible for handling user authentication and authorization.
- Auth DB: This service will be responsible for storing user information.
- Queue Service: This service will use RabbitMQ to store messages that need to be processed by the system. so when a user uploads an MP4 file, a message will be sent to the queue, and the video to mp3 service will process the message (which contains the video id in MongoDB) and convert the MP4 file to an MP3 file.
- Storage DB: This service (Mongo GridFS) will be responsible for storing the MP4 and MP3 files.
- Video to mp3 service: This service will be responsible for converting the MP4 file to an MP3 audio file.
- Notification service: This service will be responsible for sending notifications to users.
- K8s: All the above services will be deployed on a Kubernetes cluster.
The application will be deployed on Kubernetes. The application will be deployed as a set of Docker containers, with each service running in its own container. The application will be deployed on a Kubernetes cluster, with each service running as a Kubernetes deployment.
The first step is to install the required dependencies. The application requires the following dependencies:
- Flask:
pip install flask
- Flask-MySQL:
pip install flask-mysql
- Flask-Uploads:
pip install flask-uploads
- MySQL:
sudo apt-get install mysql-server
- Tutorial:
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04
- Run the following commands to create the database, user, and the users table:
mysql -uroot < init.sql
- RabbitMQ:
sudo apt-get install rabbitmq-server
- Minikube:
https://minikube.sigs.k8s.io/docs/start/
- K9s:
https://github.com/derailed/k9s
- Docker:
https://docs.docker.com/engine/install/ubuntu/
The next step is to clone the repository and build the Docker images for the services. The repository contains a Dockerfile
for each service, which can be used to build the Docker images. The Dockerfile
for each service is located in the root directory of the repository.
This is a simple MP4 to MP3 converter using Python, Flask, MySQL, K8s, and Docker. The application is a simple web application that allows users to upload an MP4 file and convert it to an MP3 file. The application is based on a Microservices Architecture and is deployed on Kubernetes.