Three-Tier Application using Docker Compose

Docker Docker Compose Node.js React MySQL JavaScript

Three-Tier Application Deployment using Docker Compose

Three-Tier Application using Docker Compose

Overview

This project demonstrates a real-world three-tier architecture deployed using Docker Compose.
The application is fully containerized and includes a React frontend, Node.js backend, and a MySQL database with persistent storage.

It highlights how multi-service applications can be orchestrated locally using Docker while maintaining clean separation of concerns.


Architecture

  • React.js frontend container
  • Node.js REST API backend container
  • MySQL database container
  • Docker Compose for orchestration
  • Docker Volumes for data persistence

Key Highlights

✅ Three-tier architecture implementation
✅ Multi-container setup using Docker Compose
✅ Persistent MySQL storage with Docker volumes
✅ One-command deployment workflow
✅ Clean separation of frontend, backend, and database


Deployment Flow

  1. Clone the repository
  2. Build Docker images for frontend and backend
  3. Start all services using Docker Compose
  4. Backend connects to MySQL via internal Docker network
  5. Frontend communicates with backend API
  6. Application accessible via browser

Application Components

🗄️ Database Layer

  • MySQL for structured data storage
  • Docker Volumes for persistence

⚙️ Backend Layer

  • Node.js REST API
  • Handles business logic and database communication

🎨 Frontend Layer

  • React.js UI
  • Communicates with backend via HTTP APIs

Tech Stack

Frontend

  • React.js
  • HTML, CSS, JavaScript

Backend

  • Node.js
  • Express.js (API layer)

Database

  • MySQL

DevOps & Containerization

  • Docker
  • Docker Compose

Project Structure

.
├── backend/              # Node.js backend (API)
   ├── Dockerfile
   └── ...
├── frontend/             # React.js frontend
   ├── Dockerfile
   └── ...
├── docker-compose.yml    # Docker Compose configuration
├── student-teacher-app/  # Application source code
└── README.md

Data Persistence

  • MySQL uses Docker Volumes
  • Data survives container restarts and rebuilds
  • Ensures reliability during development and testing

Why This Project Matters

  • Demonstrates core DevOps fundamentals
  • Shows practical understanding of container orchestration
  • Mirrors real-world application architecture
  • Serves as a foundation for Kubernetes-based deployments

Use Cases

  • DevOps portfolio project
  • Docker Compose reference
  • Three-tier architecture learning
  • Local development environment setup

Future Enhancements

  • Migrate deployment to Kubernetes
  • Add Nginx reverse proxy
  • Implement environment-based configuration
  • Integrate monitoring (Prometheus & Grafana)
  • Add CI/CD pipeline

License

MIT License © 2025