Introduction

This project is a fullstack application that allows users to download youtube videos by providing the video's URL.

The main purpose of this development was three fold:

  • Dockerizing a fullstack application and orchestrate it with docker-compose
  • Deploying a fullstack application on AWS
  • Setting up CI/CD pipelines for both Docker Hub (image push) and AWS (application version update)

Try the application

To try the application head over to yt-dl.marvin-libam.com on any browser.

The application is simple to use. Just paste the URL of the youtube video you want to download and click on the desired resolution to start the download.

Application architecture

The application is composed of three services. The frontend is a NextJs web application, providing the user interface and quering the backend. The backend is a python flask application, providing the API to the frontend to retrieve the video information and content. The reverse proxy is a Nginx server, routing the requests to the appropriate service. All services are dockerized and orchestrated using docker-compose.

AWS architecture

The application is deployed on AWS using ECS (Elastic Container Service). The ECS, is configured for two availbilility zones, containing one EC2 (Elastic Compute Cloud) instance each (to reduce costs). A load balancer is used to route the requests to the appropriate instance, as well as to provide SSL encryption when going from the AWS VPC to the internet.

AWS CI/CD

1. The developer pushes code to the repository's main branch.
2. The CI/CD pipeline is triggered, an archive of the docker-compose and .env files is created and uploaded to S3 (Simple Storage Service).
3. CodeDeploy is triggered and deploys the new version of the application to the EC2 instances using the new archive stored in S3.

Docker Hub CI/CD

1. The developer pushes code to the repository.
2. The CI/CD pipeline is triggered, images for the frontend, backend and reverse-proxy are built (if their respective code changed) and tagged with their respective .env file's 'TAG' variable.
3. The images are pushed to Docker Hub.