This project focuses on creating a streamlined solution for generating QR codes from user-provided URLs. It features a user-friendly Next.js front end for URL input, a robust FastAPI backend for QR code generation, and a secure storage system for saving the generated codes.
Front-End Container:User-facing website for URL input.API Container:Backend service for QR code generation.Storage Container:Secure storage for generated QR codes.
-
Docker: Used for containerizing the front-end (Next.js) and API (FastAPI) to ensure consistent deployment across environments. -
GitHub Actions: Implements CI/CD pipelines to automate the deployment of containers when source code changes occur. -
Terraform: Manages and provisions cloud infrastructure, specifically creating a Kubernetes cluster using Infrastructure as Code (IaC). -
Kubernetes: Orchestrates the deployment and management of containerized applications, ensuring scalability and high availability.KIND(Kubernetes in Docker)Deploying application to test the functionality localy using Kind Cluster.AWS EKS: Deploying the application on prodcution using AWS EKS cluster.
-
AWS S3: Provides secure storage for generated QR codes, allowing for persistent data storage and easy accessibility. -
Prometheus: Monitors container and system metrics, offering real-time insights for performance and operational monitoring. -
Grafana: Visualizes metrics collected from Prometheus and other sources, enhancing observability and aiding in performance monitoring and troubleshooting.
This is the fastest way to get the application running on your local machine.
- Docker Desktop / Docker Daemon installed on your machine
- Git (to clone the repository)
-
Clone the repository
git clone <repository-url> cd DevOps-URL2QR
-
First-time setup
docker compose up --build
This command will:
- Build all container images
- Create necessary networks
- Start all services
- The frontend will be available at http://localhost:3000
- The backend API will be available at http://localhost:8000
-
Subsequent runs
docker compose up
Use this command when you haven't made any changes to the Dockerfile or dependencies.
-
Stop the application
docker compose down
This will stop and remove all containers, but preserve your images.
-
To view logs of a specific service:
docker compose logs frontend # For frontend logs docker compose logs backend # For backend logs
-
To rebuild a specific service:
docker compose up --build frontend # Rebuild frontend only docker compose up --build backend # Rebuild backend only
-
To remove all containers and images (clean slate):
docker compose down --rmi all
-
If you see connection errors, ensure all services are up:
docker compose ps
-
If the frontend can't connect to the backend, check the logs:
docker compose logs backend
The Backend code exists in the api directory. You can run the API server locally:
- Clone this repo
git clone <repository-url>- Make sure you are in the
apidirectory
cd api- Create a virtualenv by typing in the following command:
python -m venv .venv- Install the required packages:
pip install -r requirements.txt- Create a
.envfile, and add your AWS Access and Secret key, check.env.examplejust run the below command
cp .env.example .env- Also, change the BUCKET_NAME to your S3 bucket name in
main.py - Run the API server:
uvicorn main:app --reload- Your API Server should be running on port
http://localhost:8000
The front-end code exits in the front-end-nextjs directory. You can run the front-end server locally:
- Make sure you are in the
front-end-nextjsdirectory
cd front-end-nextjs- Install the dependencies:
npm install- Run the NextJS Server:
npm run dev- Your Front-end Server should be running on
http://localhost:3000
If you like this project so far don't forget to star 🤩 the project for future reference.


