A production-ready, cloud-native e-commerce platform built with microservices architecture, deployed on AWS EKS with automated CI/CD. This project showcases modern DevOps practices and cloud-native design patterns, featuring Infrastructure as Code with Terraform, containerized microservices orchestrated by Kubernetes, secure secrets management with AWS Secrets Manager.
- Overview
- Architecture
- Technology Stack
- Prerequisites
- Getting Started
- CI/CD Pipeline
- API Endpoints
- Monitoring & Operations
- Local Development
This project demonstrates a complete cloud-native application with:
- Microservices Architecture: 5 independently deployable services
- Container Orchestration: Kubernetes (AWS EKS)
- Infrastructure as Code: Terraform for AWS resources
- CI/CD Pipeline: GitHub Actions with automated builds and deployments
- Package Management: Helm charts for Kubernetes deployments
- Cloud-Native Storage: MongoDB Atlas
- Secrets Management: AWS Secrets Manager + External Secrets Operator
-
Frontend Service (React + Vite + Nginx) - Port 80
- User interface for the e-commerce platform
- Service Type: LoadBalancer (public-facing)
-
API Gateway (Node.js + Express) - Port 3000
- Single entry point for all backend requests
- Routes to appropriate microservices
- Service Type: LoadBalancer (public-facing)
-
User Service (Node.js + Express) - Port 3002
- User authentication and profile management
- Service Type: ClusterIP (internal only)
-
Product Service (Node.js + Express) - Port 3001
- Product catalog and inventory management
- Service Type: ClusterIP (internal only)
-
Order Service (Node.js + Express) - Port 3003
- Order processing and tracking
- Service Type: ClusterIP (internal only)
| Component | Technology |
|---|---|
| Frontend | React, Vite, Nginx |
| Backend | Node.js, Express.js, Mongoose |
| Database | MongoDB Atlas |
| Container Orchestration | Kubernetes (AWS EKS v1.33) |
| Container Registry | AWS ECR |
| Infrastructure | Terraform |
| Deployment | Helm |
| CI/CD | GitHub Actions |
| Secrets | AWS Secrets Manager, External Secrets Operator |
| Networking | AWS VPC, NAT Gateway, Application Load Balancer |
- AWS Account with appropriate permissions
- AWS CLI configured
- Terraform
- MongoDB Atlas account
- kubectl
- Helm
- Node.js (v16 or higher)
- Docker & Docker Compose
- Git
git clone <repository-url>
cd Cloud-native-E-commerceCreate terraform/terraform.tfvars:
aws_region = "ap-south-1"
project_name = "ecommerce"
environment = "dev"
mongodb_uri = "your-mongodb-atlas-connection-string"cd terraform
terraform init
terraform plan
terraform applyThis provisions:
- VPC with public/private subnets across 3 AZs
- EKS cluster (v1.33)
- ECR repositories (5 repos for services)
- AWS Secrets Manager
- IAM roles and policies
aws eks update-kubeconfig --region ap-south-1 --name ecommerce-dev-clusterhelm repo add external-secrets https://charts.external-secrets.io
helm install external-secrets external-secrets/external-secrets -n external-secrets-system --create-namespaceApply the cluster secret store and external secret:
kubectl apply -f helm/cluster-secret-store.yaml
kubectl apply -f helm/external-secret.yamlAdd these secrets to your GitHub repository:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
Push to the main branch to trigger the CI/CD pipeline, or deploy manually:
# Build and push images to ECR
docker build -t <ECR_REGISTRY>/ecommerce-dev-frontend-test:latest ./microservices/frontend-test
docker push <ECR_REGISTRY>/ecommerce-dev-frontend-test:latest
# Deploy with Helm
helm upgrade --install frontend-test ./helm/charts/frontend-test
helm upgrade --install api-gateway ./helm/charts/api-gateway
helm upgrade --install user-service ./helm/charts/user-service
helm upgrade --install product-service ./helm/charts/product-service
helm upgrade --install order-service ./helm/charts/order-serviceGet the LoadBalancer URLs:
kubectl get services- Frontend:
http://<frontend-service-EXTERNAL-IP> - API Gateway:
http://<api-gateway-EXTERNAL-IP>:3000
The GitHub Actions pipeline automatically:
- β Checks out code
- β Authenticates with AWS
- β Builds Docker images for all 5 services
- β Tags images with commit SHA + latest
- β Pushes images to AWS ECR
- β Deploys to EKS using Helm
Trigger: Push to main branch
All API requests go through the API Gateway.
POST /users/register- Register a new userPOST /users/login- Login a userGET /users- Get all usersGET /users/:id- Get user by IDPUT /users/:id- Update userDELETE /users/:id- Delete user
POST /products- Create a new productGET /products- Get all productsGET /products/:id- Get product by IDPUT /products/:id- Update productDELETE /products/:id- Delete product
POST /orders- Create a new orderGET /orders- Get all ordersGET /orders/user/:userId- Get orders by user IDGET /orders/:id- Get order by IDPATCH /orders/:id/status- Update order statusPATCH /orders/:id/payment- Update payment statusPATCH /orders/:id/cancel- Cancel an order
# View all pods
kubectl get pods -n default
# View all services
kubectl get services -n default
# Check pod logs
kubectl logs <pod-name> -n default
# Describe a pod
kubectl describe pod <pod-name> -n defaulthelm upgrade user-service ./helm/charts/<service-name> --set replicaCount=3For local testing with Docker Compose:
# Start all services locally
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down