A production-grade random quote generator demonstrating end-to-end DevOps practices including automated CI/CD pipelines, container orchestration, infrastructure as code, and comprehensive monitoring.
Live Demo: Docker Hub Repository
- Overview
- Architecture
- Features
- Tech Stack
- Quick Start
- Documentation
- Deployment
- Monitoring
- CI/CD Pipeline
- API Documentation
- Project Structure
- Development
- Testing
- Infrastructure as Code
- Roadmap
- Contributing
- License
- Author
This project demonstrates a complete DevOps workflow from development to production, showcasing modern cloud-native practices and tools. Built as a learning project, it covers all aspects of the DevOps lifecycle.
- Full DevOps Lifecycle: From code to production
- Infrastructure as Code: Terraform for reproducible infrastructure
- Automated CI/CD: GitHub Actions with multi-stage pipeline
- Container Orchestration: Kubernetes with autoscaling
- Comprehensive Monitoring: Prometheus + Grafana metrics
- Security Scanning: Automated vulnerability detection
- Production-Ready: Health checks, logging, resource limits
Homepage - Random Quote Display
Clean, responsive UI with random quote generation
┌─────────────────────────────────────────────────────────────────┐
│ GitHub Repository │
│ (Source Code + CI/CD) │
└────────────────────────────┬────────────────────────────────────┘
│
┌────────▼─────────┐
│ GitHub Actions │
│ CI/CD Pipeline │
└────────┬─────────┘
│
┌──────────────┼──────────────┐
│ │ │
┌─────▼─────┐ ┌────▼────┐ ┌─────▼──────┐
│ Test │ │ Build │ │ Security │
│ (Jest) │ │ (Docker)│ │ (Trivy) │
└───────────┘ └────┬────┘ └────────────┘
│
┌───────▼────────┐
│ Docker Hub │
│ Image Registry│
└───────┬────────┘
│
┌─────────────┼─────────────┐
│ │ │
┌─────▼─────┐ ┌────▼──────┐ ┌───▼────────┐
│ Local │ │ Kubernetes│ │ Terraform │
│ Docker │ │ Cluster │ │ IaC │
└───────────┘ └────┬──────┘ └────────────┘
│
┌────────────┼────────────┐
│ │ │
┌─────▼─────┐ ┌───▼────┐ ┌────▼─────┐
│ Pods │ │ Service│ │ HPA │
│ (2-10) │ │ (LB) │ │(Autoscale)│
└─────┬─────┘ └────────┘ └──────────┘
│
┌─────▼──────┐
│ Prometheus │
│ Grafana │
└────────────┘
User → Service (NodePort/Ingress) → Pods (Quote App) → Metrics
│
▼
Prometheus
│
▼
Grafana
- Random quote generation with 10+ categories
- RESTful API with 7 endpoints
- Category-based filtering
- Statistics tracking
- Share functionality
- Keyboard shortcuts
- Fully responsive design
- Automated CI/CD pipeline
- Multi-stage Docker builds
- Kubernetes orchestration
- Horizontal pod autoscaling (2-10 replicas)
- Infrastructure as code (Terraform)
- Real-time monitoring (Prometheus + Grafana)
- Security scanning (Trivy)
- Automated testing (Jest)
- Health checks and probes
- Resource limits and requests
- Rolling updates with zero downtime
- Multi-platform Docker builds (amd64, arm64)
- Runtime: Node.js 18.x
- Framework: Express.js 4.18
- Frontend: HTML5, CSS3, Vanilla JavaScript
- Testing: Jest, Supertest
- Containerization: Docker, Docker Compose
- Orchestration: Kubernetes (Minikube)
- IaC: Terraform
- CI/CD: GitHub Actions
- Registry: Docker Hub
- Metrics: Prometheus
- Visualization: Grafana
- Logging: Built-in Node.js logging
- Health Checks: Liveness and readiness probes
- Scanning: Trivy
- Container Security: Non-root user, read-only filesystem
- Secrets Management: Kubernetes secrets, GitHub secrets
- Node.js 18.x or higher
- Docker 24.x or higher
- kubectl (for Kubernetes)
- Minikube (for local Kubernetes)
- Terraform 1.0+ (optional)
# Clone repository
git clone https://github.com/AdityaJareda/quote-app-devops.git
cd quote-app-devops
# Install dependencies
npm install
# Start development server
npm run dev
# Access at http://localhost:3000# Pull from Docker Hub
docker pull adityajareda/quote-app:latest
# Run container
docker run -p 3000:3000 adityajareda/quote-app:latest
# Or use Docker Compose
docker compose up -d# Start Minikube
minikube start
# Apply manifests
kubectl apply -f k8s/
# Access application
minikube service quote-app-service -n quote-app --urlComprehensive guides available:
- DEPLOYMENT.md - Complete deployment guide
- KUBERNETES.md - Kubernetes quick reference
- k8s/README.md - Kubernetes manifests documentation
- terraform/README.md - Terraform usage guide
- monitoring/README.md - Monitoring setup
- TROUBLESHOOTING.md - Common issues and solutions
# Development
docker compose -f docker-compose.dev.yml up
# Production
docker compose up -d# Deploy to Kubernetes
kubectl apply -f k8s/
# Scale manually
kubectl scale deployment quote-app-deployment -n quote-app --replicas=5
# Check autoscaler
kubectl get hpa -n quote-app
# View logs
kubectl logs -n quote-app -l app=quote-app# Docker deployment
cd terraform/environments/dev
terraform init
terraform apply
# Kubernetes deployment
cd terraform/environments/prod
terraform init
terraform applySee terraform/README.md for details.
Prometheus:
kubectl port-forward -n monitoring svc/prometheus-server 9090:80
# Access: http://localhost:9090Grafana:
kubectl port-forward -n monitoring svc/grafana 3001:80
# Access: http://localhost:3001
# Login: admin / admin123The application exposes metrics at /metrics:
http_requests_total- Total HTTP requests by method, route, statushttp_request_duration_seconds- Request latency histogramquotes_served_total- Total quotes served by endpointprocess_*- Node.js process metricsnodejs_*- Node.js runtime metrics
# Request rate
rate(http_requests_total[5m])
# 95th percentile latency
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
# Total quotes served
sum(quotes_served_total)
# Pod CPU usage
rate(container_cpu_usage_seconds_total{namespace="quote-app"}[5m])
Code Push → GitHub Actions
│
├─→ Stage 1: Test (Jest, Coverage)
│ └─→ Upload coverage to Codecov
│
├─→ Stage 2: Build & Push (Docker, Multi-arch)
│ └─→ Push to Docker Hub
│
├─→ Stage 3: Security Scan (Trivy)
│ └─→ Upload to GitHub Security
│
└─→ Stage 4: Notify (Deployment summary)
- Automated testing on every push
- Multi-platform Docker builds (amd64, arm64)
- Security vulnerability scanning
- Automated image publishing
- Branch protection rules
- Status badges
# Push to main triggers full pipeline
git push origin main
# Create PR for review
git checkout -b feature/new-feature
git push origin feature/new-feature
# Create PR on GitHubView pipeline status: GitHub Actions
http://localhost:3000
| Method | Endpoint | Description | Example |
|---|---|---|---|
| GET | /health |
Health check | Returns server status |
| GET | /metrics |
Prometheus metrics | Returns application metrics |
| GET | /api/quotes |
Get all quotes | Supports ?page=1&limit=10 |
| GET | /api/quotes/random |
Get random quote | Returns one random quote |
| GET | /api/quotes/:id |
Get quote by ID | /api/quotes/1 |
| GET | /api/quotes/category/:cat |
Filter by category | /api/quotes/category/motivation |
| GET | /api/categories |
Get all categories | Returns available categories |
| POST | /api/quotes |
Add new quote | Body: {text, author, category} |
curl http://localhost:3000/api/quotes/random{
"id": 1,
"text": "The only way to do great work is to love what you do.",
"author": "Steve Jobs",
"category": "motivation"
}quote-app-devops/
├── .github/
│ └── workflows/
│ ├── ci-cd.yml # GitHub Actions pipeline
│ └── health-check.yml # Health Check pipeline
├── k8s/ # Kubernetes manifests
│ ├── namespace.yaml
│ ├── configmap.yaml
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── hpa.yaml
│ └── README.md
├── terraform/ # Infrastructure as Code
│ ├── modules/
│ │ ├── docker/
│ │ └── kubernetes/
│ ├── environments/
│ │ ├── dev/
│ │ └── prod/
│ └── README.md
├── monitoring/ # Monitoring configuration
│ ├── prometheus-values.yaml
│ ├── grafana-values.yaml
│ ├── quote-app-dashboard.json
│ └── README.md
├── src/ # Application source
│ ├── app.js
│ ├── routes/
│ ├── controllers/
│ └── data/
│ └── quotes.json
├── public/ # Frontend files
│ ├── index.html
│ ├── style.css
│ └── script.js
├── tests/ # Test files
│ └── app.test.js
├── docs/ # Documentation
│ └── DOCKER.md
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yml # Compose configuration
├── package.json # Node.js dependencies
├── jest.config.js # Test configuration
├── DEPLOYMENT.md # Deployment guide
├── TROUBLESHOOTING.md # Troubleshooting docker
└── README.md # This file
# Install dependencies
npm install
# Start dev server (with auto-reload)
npm run dev
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Check code coverage
npm test -- --coverageCreate .env file:
PORT=3000
NODE_ENV=development
APP_NAME=Quote App
APP_VERSION=1.0.0
LOG_LEVEL=debug# Run linter (if configured)
npm run lint
# Format code (if configured)
npm run format- 14 passing tests
- 85%+ code coverage
- Unit tests for all API endpoints
- Integration tests for request/response cycle
- Error handling tests
- Validation tests
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm test -- --coverage
# View HTML coverage report
open coverage/index.html- Docker Module: Container deployments
- Kubernetes Module: Orchestrated deployments
- Development: Docker-based local environment
- Production: Kubernetes cluster deployment
# Development environment
cd terraform/environments/dev
terraform init
terraform plan
terraform apply
# Production environment
cd terraform/environments/prod
terraform init
terraform plan
terraform applySee terraform/README.md for detailed documentation.
- Full-stack application
- RESTful API with 7 endpoints
- Comprehensive testing (14 tests, 85%+ coverage)
- Docker containerization
- Docker Compose setup
- Published to Docker Hub
- GitHub Actions CI/CD
- Security scanning
- Multi-platform builds
- Kubernetes deployment
- Horizontal Pod Autoscaler
- Health checks and probes
- Terraform IaC
- Prometheus monitoring
- Grafana dashboards
This is a learning project, but contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test updatesci:CI/CD changesrefactor:Code refactoringchore:Maintenance tasks
This project is licensed under the MIT License - see the LICENSE file for details.
Aditya Singh
- GitHub: @AdityaJareda
- LinkedIn: Aditya Singh
- Built as part of my DevOps learning journey
- Inspired by modern DevOps best practices
- Quote data from public domain
- Lines of Code: 2,500+
- Docker Image Size: ~150MB
- Test Coverage: 85%+
- Kubernetes Resources: 6 manifests
- Terraform Modules: 2 (Docker, Kubernetes)
- CI/CD Stages: 4
- API Endpoints: 7
- Monitoring Metrics: 10+
- Documentation Pages: 7
- Docker Documentation
- Kubernetes Documentation
- Terraform Documentation
- GitHub Actions Documentation
- Prometheus Documentation
- Grafana Documentation
A small step toward mastering DevOps.