This repository contains a fully containerized microservices TODO application with complete infrastructure automation, CI/CD pipelines, and security features.
The application consists of 5 microservices with Traefik reverse proxy and SSL termination:
- Frontend - Vue.js UI application
- Auth API - Go-based authentication service (JWT tokens)
- TODOs API - Node.js CRUD API with Redis logging
- Users API - Java Spring Boot user profiles service
- Log Message Processor - Python Redis queue processor
- Redis Queue - Message broker for logging
- Traefik - Reverse proxy with automatic HTTPS
- AWS CLI configured
- Terraform >= 1.5.0
- Docker & Docker Compose
- Domain name (get free subdomain from freedns.afraid.org)
-
Configure your domain and credentials:
cd infra/terraform cp terraform.tfvars.example terraform.tfvars # Edit with your AWS credentials, domain, and SSH key
-
Deploy everything:
./deploy.sh
This single script will:
- ✅ Build Java application
- ✅ Provision AWS infrastructure
- ✅ Configure security groups
- ✅ Install Docker and dependencies
- ✅ Deploy application with SSL
- ✅ Configure Traefik reverse proxy
# Build and start all services locally
./build.sh
# Or manually:
docker-compose up -d --buildOnce deployed, access your application at:
- Frontend:
https://your-domain.com - Auth API:
https://your-domain.com/api/auth(returns "Not Found") - Todos API:
https://your-domain.com/api/todos(returns "Invalid Token") - Users API:
https://your-domain.com/api/users(returns "Missing Authorization header")
| Username | Password |
|---|---|
| admin | Admin123 |
| hng | HngTech |
| user | Password |
- ✅ AWS EC2 provisioning
- ✅ Security group configuration
- ✅ Remote state management
- ✅ Dynamic Ansible inventory generation
- ✅ Automatic Ansible execution
- ✅ Docker installation
- ✅ Application deployment
- ✅ SSL certificate management
- ✅ Idempotent operations
- ✅ Drift Detection with email alerts
- ✅ Manual Approval for infrastructure changes
- ✅ Automatic Deployment when no drift
- ✅ Separate workflows for infra and app changes
- ✅ Automatic HTTPS via Let's Encrypt
- ✅ HTTP → HTTPS redirection
- ✅ Traefik reverse proxy
- ✅ Security groups with minimal required ports
.
├── frontend/ # Vue.js application
├── auth-api/ # Go authentication service
├── todos-api/ # Node.js CRUD API
├── users-api/ # Java Spring Boot service
├── log-message-processor/ # Python queue processor
├── infra/ # Infrastructure automation
│ ├── terraform/ # AWS infrastructure
│ ├── ansible/ # Server configuration
│ └── README.md # Detailed infra docs
├── .github/workflows/ # CI/CD pipelines
├── docker-compose.yml # Multi-service container setup
├── deploy.sh # Single-command deployment
└── build.sh # Local development script
Triggers on changes to infra/terraform/** or infra/ansible/**:
- Terraform Plan - Detect infrastructure drift
- Email Alert - Notify on drift detection
- Manual Approval - Required for infrastructure changes
- Terraform Apply - Deploy approved changes
Triggers on changes to service code or docker-compose.yml:
- Build Services - Containerize applications
- Deploy - Update running services
- Health Check - Verify deployment success
# Start services locally
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downcd infra/terraform
terraform plan # Preview changes
terraform apply # Apply changesThe system automatically:
- Detects infrastructure drift on every change
- Emails notifications when drift is found
- Pauses for manual approval
- Proceeds automatically if no drift exists
- Domain not accessible: Check DNS points to server IP
- SSL certificate issues: Verify domain ownership and email
- Services not starting: Check
docker-compose logs - Terraform errors: Run
terraform refreshand retry
# Check service status
docker-compose ps
# View application logs
docker-compose logs frontend
docker-compose logs auth-api
# Test connectivity
curl -k https://your-domain.com- ✅ Repository forked and infra/ directory created
- ✅ All services containerized with Dockerfiles
- ✅ Docker Compose with Traefik and SSL
- ✅ Terraform infrastructure automation
- ✅ Ansible configuration management
- ✅ CI/CD pipelines with drift detection
- ✅ Single command deployment:
terraform apply -auto-approve - ✅ HTTPS domain with automatic certificates
- ✅ Email notifications for infrastructure drift
MIT
