A production-grade backend system built with Spring Boot, containerised using Docker, and deployed on a VPS with zero-downtime blue-green deployment, NGINX reverse proxy, and full monitoring using Prometheus & Grafana.
- 🔁 Blue-Green Deployment (Zero Downtime)
- 🐳 Dockerized Application
- 🌐 NGINX Reverse Proxy Routing
- 📊 Monitoring with Prometheus & Grafana
- 🛢️ PostgreSQL Database Integration
- ⚙️ CI/CD via GitHub + GHCR
- 🔐 Environment-based Configuration (.env)
- 📈 Production Observability Setup
| Layer | Technology |
|---|---|
| Backend | Spring Boot |
| Database | PostgreSQL |
| Container | Docker |
| Proxy | NGINX |
| Monitoring | Prometheus, Grafana |
| CI/CD | GitHub Actions, GHCR |
| Deployment | VPS (Linux) |
This project implements a blue-green deployment strategy to ensure zero downtime.
-
New version is deployed to inactive environment (Green)
-
Health checks are verified
-
NGINX switches traffic:
Blue → Green -
Old version remains as a fallback
- ✅ Zero downtime
- ✅ Instant rollback capability
- ✅ Safe production deployments
-
Prometheus scrapes metrics from:
/actuator/prometheus -
Grafana visualizes:
- CPU usage
- Memory usage
- Request metrics
- Container health
docker-compose up -d- contact-api (blue/green)
- postgres
- prometheus
- grafana
- nginx
| Method | Endpoint | Description |
|---|---|---|
| GET | /contacts | Get all contacts |
| POST | /contacts | Create contact |
| GET | /contacts/{id} | Get contact by ID |
| PUT | /contacts/{id} | Update contact |
| DELETE | /contacts/{id} | Delete contact |
git clone https://github.com/vimal-java-dev/vimaltech-contact-api
cd vimaltech-contact-api
docker-compose up --build- Push Docker image to GHCR
- Pull the image on the VPS
- Run
deploy.sh - Switch NGINX between blue/green
- Environment variables via
.env - NGINX as reverse proxy (no direct exposure)
- Container isolation
- Controlled port exposure
Add:
- Grafana dashboard
- Prometheus targets
- Docker containers
- Blue-Green switch logs
- Real-world backend system design
- DevOps integration with backend development
- Zero-downtime deployment strategy
- Monitoring & observability setup
- Production-ready architecture thinking
Vimal Patel
Backend Developer | Spring Boot | DevOps Enthusiast

