Skip to content

fastians/E-Commerce_Platform_Infrastructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

E-Commerce Platform Infrastructure Project

🎯 Project Overview

A complete, production-ready e-commerce platform infrastructure deployed on AWS EKS, demonstrating enterprise-level DevOps practices, cloud architecture, and platform engineering skills.

Live Demo: Deployment Guide
Architecture: System Design
Monitoring: Observability Stack

πŸ“Š Key Achievements

Infrastructure

  • βœ… AWS EKS Cluster with multi-AZ deployment
  • βœ… Terraform IaC for complete infrastructure automation
  • βœ… Auto-scaling with HPA and Cluster Autoscaler
  • βœ… Cost Optimization via spot instances and nightly cleanup (~93% savings)

Monitoring & Observability

  • βœ… Prometheus for metrics collection (15-day retention)
  • βœ… Grafana with 3 custom dashboards
  • βœ… 15+ Alert Rules for proactive monitoring
  • βœ… Custom Metrics for application performance

CI/CD Pipeline

  • βœ… GitHub Actions with 5 automated workflows
  • βœ… Multi-environment support (dev/staging/production)
  • βœ… Automated Rollback on deployment failures
  • βœ… Security Scanning with Trivy on every PR
  • βœ… Nightly Cleanup for cost optimization

Performance & Testing

  • βœ… Load Testing with k6 (4 test scenarios)
  • βœ… Performance Thresholds (P95 < 500ms, P99 < 1s)
  • βœ… Capacity Planning (validated up to 500 concurrent users)
  • βœ… Stability Testing (70-minute soak tests)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      AWS Cloud                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  VPC (Multi-AZ)                                  β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Public Subnets (3 AZs)                      β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Private Subnets (3 AZs)                     β”‚  β”‚
β”‚  β”‚  └── NAT Gateways (HA)                           β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  EKS Cluster                                     β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Control Plane (Managed)                     β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Worker Nodes (On-demand + Spot)            β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Cluster Autoscaler                          β”‚  β”‚
β”‚  β”‚  └── AWS Load Balancer Controller               β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Application Layer                               β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Frontend (React + Nginx)                    β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Backend (Node.js + Express)                 β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Database (PostgreSQL)                       β”‚  β”‚
β”‚  β”‚  └── Ingress (ALB)                               β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Monitoring Stack                                β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Prometheus (Metrics)                        β”‚  β”‚
β”‚  β”‚  β”œβ”€β”€ Grafana (Dashboards)                        β”‚  β”‚
β”‚  β”‚  └── AlertManager (Notifications)                β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

  • AWS Account with credentials configured
  • Terraform >= 1.6.0
  • kubectl >= 1.28
  • Docker
  • Helm >= 3.0

Deploy Infrastructure

# 1. Configure AWS credentials
aws configure

# 2. Deploy infrastructure
cd infrastructure/terraform/aws
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your settings
terraform init
terraform apply

# 3. Configure kubectl
aws eks update-kubeconfig --name demo-eks-cluster --region us-east-1

# 4. Deploy application
kubectl apply -k infrastructure/kubernetes/base/

# 5. Install monitoring
cd monitoring
./install-monitoring.sh

# 6. Get application URL
kubectl get ingress

One-Command Deployment

make deploy

πŸ“ˆ Performance Metrics

Load Test Results

  • Max Concurrent Users: 500
  • P95 Latency: < 500ms
  • P99 Latency: < 1000ms
  • Error Rate: < 5%
  • Requests/Second: 200+

Resource Utilization

  • CPU Usage: 40-60% under normal load
  • Memory Usage: 50-70% under normal load
  • Auto-scaling: 2-20 pods based on demand
  • Database Connections: < 80% pool utilization

Cost Metrics

  • Full Deployment: ~$150/month
  • With Optimization: ~$10/month
  • Savings: 93% via spot instances + nightly cleanup

πŸ› οΈ Technology Stack

Infrastructure

  • Cloud: AWS (EKS, VPC, RDS, ALB)
  • IaC: Terraform
  • Orchestration: Kubernetes
  • Package Manager: Helm

Application

  • Frontend: React, Vite, Nginx
  • Backend: Node.js, Express
  • Database: PostgreSQL
  • Containerization: Docker

Monitoring

  • Metrics: Prometheus
  • Visualization: Grafana
  • Alerting: AlertManager
  • Logging: CloudWatch

CI/CD

  • Pipeline: GitHub Actions
  • Registry: Docker Hub
  • Testing: k6, Jest
  • Security: Trivy

πŸ“ Project Structure

.
β”œβ”€β”€ infrastructure/
β”‚   β”œβ”€β”€ terraform/aws/          # AWS infrastructure
β”‚   └── kubernetes/             # K8s manifests
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ frontend/               # React application
β”‚   β”œβ”€β”€ backend/                # Node.js API
β”‚   └── docker/                 # Docker Compose
β”œβ”€β”€ monitoring/
β”‚   β”œβ”€β”€ prometheus/             # Prometheus config
β”‚   └── grafana/                # Grafana dashboards
β”œβ”€β”€ ci-cd/
β”‚   └── .github/workflows/      # GitHub Actions
β”œβ”€β”€ load-tests/
β”‚   └── scenarios/              # k6 test scripts
β”œβ”€β”€ docs/                       # Documentation
└── screenshots/                # Portfolio screenshots

🎯 Key Features

High Availability

  • Multi-AZ deployment across 3 availability zones
  • Auto-scaling based on CPU and memory metrics
  • Health checks and automatic pod recovery
  • Load balancing with AWS ALB

Security

  • Private subnets for application workloads
  • Security groups with least privilege
  • Secrets management via Kubernetes secrets
  • IMDSv2 for EC2 metadata
  • Vulnerability scanning in CI/CD

Observability

  • Real-time metrics with Prometheus
  • Custom Grafana dashboards
  • Proactive alerting for critical issues
  • Application performance monitoring
  • Resource utilization tracking

Cost Optimization

  • Spot instances for 70% cost savings
  • Nightly infrastructure cleanup
  • Auto-scaling to match demand
  • Resource limits and requests
  • Optional RDS vs in-cluster PostgreSQL

πŸ“Š Monitoring Dashboards

System Overview

  • Cluster CPU and memory usage
  • Pod count by namespace
  • Node status and health
  • Network I/O metrics

API Metrics

  • Request rate by endpoint
  • Latency percentiles (P50, P95, P99)
  • Error rates and status codes
  • Active connections

Database Metrics

  • Connection pool utilization
  • Query performance
  • Cache hit ratio
  • Transaction rates

πŸ”„ CI/CD Pipeline

Automated Workflows

  1. Build and Deploy - Triggered on push to main
  2. PR Checks - Linting, validation, security scanning
  3. Deploy Infrastructure - Manual Terraform deployment
  4. Nightly Cleanup - Automated cost optimization
  5. Destroy - Safe infrastructure teardown

Deployment Flow

Code Push β†’ Build β†’ Test β†’ Security Scan β†’ Deploy β†’ Health Check β†’ Rollback (if needed)

πŸ’° Cost Analysis

Monthly Costs

Full Deployment:

  • EKS Control Plane: $73
  • EC2 Instances: $60
  • RDS (optional): $30
  • Load Balancer: $20
  • Monitoring: $20
  • Total: ~$150/month

Optimized:

  • Spot Instances: -70% on EC2
  • In-cluster PostgreSQL: -$30
  • Nightly Cleanup: -90% uptime
  • Total: ~$10/month

πŸŽ“ Skills Demonstrated

Cloud & Infrastructure

  • AWS services (EKS, VPC, RDS, ALB, IAM)
  • Infrastructure as Code (Terraform)
  • Kubernetes orchestration
  • Multi-AZ high availability
  • Cost optimization strategies

DevOps & SRE

  • CI/CD pipeline design
  • Automated deployment
  • Monitoring and alerting
  • Incident response
  • Capacity planning

Platform Engineering

  • Container orchestration
  • Service mesh concepts
  • Auto-scaling strategies
  • Resource management
  • Performance optimization

Security

  • Network security (VPC, security groups)
  • Secrets management
  • Vulnerability scanning
  • Least privilege access
  • Security best practices

πŸ“š Documentation

πŸ”— Quick Links

  • Makefile Commands: make help
  • Terraform Docs: infrastructure/terraform/aws/README.md
  • Kubernetes Docs: infrastructure/kubernetes/README.md
  • Monitoring Docs: monitoring/README.md

πŸ“ License

This is a portfolio project for demonstration purposes.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published