sloweyyy
cloud-native-ecommerce-platform
TypeScript

Cloud-native e-commerce on .NET 10 LTS microservices with React + Nx Module Federation microfrontends, deployed to AWS EKS via Terraform with Istio service mesh. MongoDB / Redis / PostgreSQL / SQL Server, RabbitMQ, Ocelot gateway. Legacy Angular UI in /client.

Last updated Jun 29, 2026
22
Stars
9
Forks
2
Issues
0
Stars/day
Attention Score
41
Language breakdown
No language data available.
โ–ธ Files click to expand
README

Cloud-Native E-Commerce Platform

.NET 10 React 18 Nx TypeScript AWS Kubernetes Docker MIT License

Enterprise-grade cloud-native e-commerce platform built with modern microfrontend architecture, microservices, and cloud-native DevOps. Production-ready with full observability, security scanning, and multi-environment deployment.

โœจ Key Features

  • ๐Ÿ—๏ธ Microfrontend Architecture - Webpack Module Federation with runtime composition, independent deployment, and shared authentication
  • โ˜๏ธ Enterprise Cloud Infrastructure - AWS EKS with auto-scaling, multi-AZ, CloudFormation IaC, and IRSA for secure AWS access
  • ๐ŸŽฏ Microservices Backend - Clean Architecture with CQRS pattern, event-driven design, and gRPC communication
  • ๐Ÿ“Š Full Observability - Elastic Stack, Prometheus, Grafana, Jaeger distributed tracing, and Istio service mesh
  • ๐Ÿ”’ Security & Compliance - IRSA, Istio mTLS, Trivy/CodeQL scanning, secrets management (app-layer JWT auth planned)
  • ๐ŸŽจ Advanced Admin Dashboard - Real-time analytics, activity tracking, product management, and audit logs
  • โšก Developer Experience - Nx monorepo with caching, hot reload, type-safe APIs, and E2E testing (Playwright)

๐Ÿ›๏ธ Architecture Overview

System Architecture

graph TB
    subgraph "Client Layer"
        Web["๐Ÿ–ฅ๏ธ Web Application<br/>React Microfrontends"]
    end

subgraph "Microfrontend Shell (Host)" Host["Host Shell<br/>Port 4200<br/>Router & Auth"] end

subgraph "Microfrontends (Runtime Federation)" Store["Store MFE<br/>Port 4201<br/>Product Browsing"] Checkout["Checkout MFE<br/>Port 4202<br/>Cart & Checkout"] Account["Account MFE<br/>Port 4203<br/>User Profile"] Admin["Admin MFE<br/>Port 4204<br/>Management"] end

subgraph "Shared Packages" Auth["@ecommerce-platform/<br/>auth-provider"] Layout["@ecommerce-platform/<br/>shared-layout"] Injector["@ecommerce-platform/<br/>app-injector"] end

subgraph "API Gateway" Gateway["Ocelot Gateway<br/>Port 8010<br/>CORS, Auth, Routing"] end

subgraph "Microservices" Catalog["Catalog Service<br/>Port 8000<br/>Product Management"] Basket["Basket Service<br/>Port 8001<br/>Shopping Cart"] Discount["Discount Service<br/>Port 8002<br/>Coupon System"] Ordering["Ordering Service<br/>Port 8003<br/>Order Processing"] end

subgraph "Data Layer" CatalogDB["MongoDB<br/>Catalog DB"] BasketDB["Redis<br/>Session Store"] DiscountDB["PostgreSQL<br/>Discount DB"] OrderDB["SQL Server<br/>Order DB"] S3["AWS S3<br/>Product Images"] end

subgraph "Event Bus & Communication" MessageBus["RabbitMQ<br/>Event Bus<br/>MassTransit"] end

subgraph "Infrastructure & Monitoring" ServiceMesh["Istio Service Mesh<br/>Envoy Sidecars<br/>mTLS, Traffic Mgmt"] Logs["Elasticsearch<br/>Log Aggregation"] Metrics["Prometheus<br/>Metrics Collection"] Dashboard["Grafana<br/>Dashboards"] Tracing["Jaeger<br/>Distributed Tracing"] end

Web --> Host Host --> Auth Host --> Layout Host --> Injector Host --> Store Host --> Checkout Host --> Account Host --> Admin

Store --> Gateway Checkout --> Gateway Account --> Gateway Admin --> Gateway

Gateway --> Catalog Gateway --> Basket Gateway --> Discount Gateway --> Ordering

Catalog --> CatalogDB Catalog --> S3 Basket --> BasketDB Discount --> DiscountDB Ordering --> OrderDB

Basket --> MessageBus Ordering --> MessageBus Catalog --> MessageBus

Basket -.->|gRPC| Discount

Catalog --> ServiceMesh Basket --> ServiceMesh Discount --> ServiceMesh Ordering --> ServiceMesh

ServiceMesh --> Logs ServiceMesh --> Metrics Logs --> Dashboard Metrics --> Dashboard ServiceMesh --> Tracing

Microfrontend Architecture

graph LR
    subgraph "Development Mode"
        D_Host["Host<br/>localhost:4200"]
        D_Store["Store Remote<br/>localhost:4201"]
        D_Checkout["Checkout Remote<br/>localhost:4202"]
        D_Account["Account Remote<br/>localhost:4203"]
        D_Admin["Admin Remote<br/>localhost:4204"]
        D_Shared["Shared Packages<br/>auth-provider, app-injector,<br/>shared-layout"]
    end

subgraph "Production Mode" P_Host["Host App<br/>/"] P_Store["Store<br/>/remotes/store"] P_Checkout["Checkout<br/>/remotes/checkout"] P_Account["Account<br/>/remotes/account"] P_Admin["Admin<br/>/remotes/admin"] P_MFE["Module Federation<br/>Runtime Loading"] end

DHost -.->|Dynamic Load| DStore DHost -.->|Dynamic Load| DCheckout DHost -.->|Dynamic Load| DAccount DHost -.->|Dynamic Load| DAdmin DStore -.-> DShared DCheckout -.-> DShared DAccount -.-> DShared DAdmin -.-> DShared

PHost -->|Runtime Load| PMFE PMFE -->|Load| PStore PMFE -->|Load| PCheckout PMFE -->|Load| PAccount PMFE -->|Load| PAdmin

Cloud Infrastructure (AWS)

graph TB
    subgraph "AWS Region: ap-southeast-1"
        subgraph "VPC: 10.0.0.0/16"
            subgraph "Public Subnets"
                NAT["NAT Gateway<br/>10.0.1.0/24"]
                IGW["Internet Gateway"]
            end

subgraph "Private Subnets" EKS["EKS Cluster<br/>Kubernetes Control Plane"] NodeGroup["Node Group (1-3 EC2)<br/>m7i-flex.large<br/>80GB EBS"] end end

ECR["ECR Repositories<br/>catalogapi, basketapi,<br/>discountapi, orderingapi,<br/>ocelotapigateway"]

subgraph "Load Balancing" NLB["Network Load Balancer<br/>HTTPS/TLS Termination<br/>ACM Certificate"] ALB["Application Load Balancer<br/>Path-based Routing"] end

S3["S3 Bucket<br/>Product Images"] end

subgraph "Kubernetes Deployments" Databases["Databases (Helm)<br/>MongoDB, Redis,<br/>PostgreSQL, SQL Server"] Apps["Microservices (Helm)<br/>Catalog, Basket, Discount,<br/>Ordering, API Gateway"] Monitoring["Monitoring Stack (Helm)<br/>Prometheus, Grafana,<br/>Elasticsearch, Kibana, Jaeger"] end

EKS --> NodeGroup NodeGroup --> Databases NodeGroup --> Apps NodeGroup --> Monitoring

NLB --> EKS ALB --> EKS

ECR -->|Pull Images| NodeGroup Apps -->|Read/Write| S3

IAM["IRSA<br/>IAM Roles for<br/>Service Accounts"] IAM -.->|Pod Identity| Apps

Clean Architecture (Per Microservice)

graph TD
    API["API Layer<br/>Controllers, Endpoints"]
    App["Application Layer<br/>Commands, Queries, Handlers<br/>CQRS"]
    Domain["Domain Layer<br/>Entities, Value Objects<br/>Business Rules"]
    Infra["Infrastructure Layer<br/>Repositories, External Services<br/>Database, S3, gRPC"]

API --> App App --> Domain App --> Infra Infra --> Domain

classDef api fill:#e3f2fd,stroke:#1976d2,color:#000 classDef app fill:#f3e5f5,stroke:#7b1fa2,color:#000 classDef domain fill:#e8f5e9,stroke:#388e3c,color:#000 classDef infra fill:#fff3e0,stroke:#f57c00,color:#000

class API api class App app class Domain domain class Infra infra

๐Ÿš€ Quick Start

Choose your deployment path:

๐Ÿ“ Option 1: Local Development (Minikube)

Best for: Development, testing, and learning

# Clone repository
git clone https://github.com/sloweyyy/cloud-native-ecommerce-platform.git
cd cloud-native-ecommerce-platform

Deploy locally (all services + monitoring)

./scripts/deploy/deploy.sh

Time: ~15-20 minutes Includes: Minikube cluster, all services, LocalStack (S3), monitoring stack (Prometheus, Grafana, Jaeger, Kibana)

โ˜๏ธ Option 2: AWS Minimal (Cost-Optimized)

Best for: Budget-conscious deployments, small teams

# Deploy to AWS with minimal services
./scripts/deploy/deploy-aws-minimal.sh

Time: ~20-25 minutes Includes: EKS cluster (single AZ), core services, AWS S3, no monitoring stack Cost: ~$20-50/month

๐Ÿข Option 3: AWS Production (Full Stack)

Best for: Production workloads, enterprise deployments

# Full production deployment with monitoring
./scripts/deploy/deploy-aws.sh

Time: ~30-40 minutes Includes: Multi-AZ EKS, all services, full monitoring (Prometheus, Grafana, Jaeger, Elasticsearch, Kibana), HTTPS, auto-scaling Cost: ~$150-300/month

For detailed deployment instructions, see DEPLOYMENT-GUIDE.md

๐Ÿ“ Access Services

Frontend Applications

| Service | Local | Description | | --- | --- | --- | | Host Shell | localhost:4200 | Main application (router) | | Store | localhost:4201 | Public product browsing | | Checkout | localhost:4202 | Shopping cart & checkout | | Account | localhost:4203 | User profile & orders | | Admin Dashboard | localhost:4204 | Admin management |

Backend Services

| Service | Local | Swagger UI | | --- | --- | --- | | API Gateway | localhost:8010 | Swagger | | Catalog API | localhost:8000 | Swagger | | Basket API | localhost:8001 | Swagger | | Discount API | localhost:8002 | Swagger | | Ordering API | localhost:8003 | Swagger |

Monitoring & Observability

| Tool | Local | Purpose | | --- | --- | --- | | Prometheus | localhost:9090 | Metrics collection | | Grafana | localhost:3000 | Dashboards & visualization | | Kibana | localhost:5601 | Log analytics | | Jaeger | localhost:16686 | Distributed tracing | | Kiali | localhost:20001 | Service mesh visualization | | RabbitMQ | localhost:15672 | Message broker UI |

๐Ÿ› ๏ธ Tech Stack

Frontend Architecture

| Component | Technology | Version | Purpose | | --- | --- | --- | --- | | Microfrontend Framework | Webpack Module Federation | 5 | Runtime app composition | | Monorepo | Nx | 21.6 | Build orchestration & caching | | Runtime | React | 18.3 | UI framework | | Language | TypeScript | 5.9 | Type-safe development | | Routing | React Router (Host) / TanStack Router (Remotes) | 6 / 1 | URL management | | State Management | TanStack Query + Zustand | 5 / 5 | Server + client state | | UI Components | Ant Design | 5.22 | Component library | | Authentication | Azure MSAL | 3.27 | OAuth/OIDC support | | Form Validation | Zod | 3.24 | Type-safe validation | | Testing | Playwright + Jest | 1.56 / 30 | E2E and unit tests |

Backend Services

| Component | Technology | Version | Purpose | | --- | --- | --- | --- | | Runtime | .NET | 10.0 | Framework | | Framework | ASP.NET Core | 10.0 | Web API | | Architecture | Clean Architecture | - | SOLID principles | | Pattern | CQRS + in-house Mediator | - | Command/Query separation (Infrastructure/Common.Mediator) | | ORM | Entity Framework Core | 10.0 | Database abstraction | | Mapping | Riok.Mapperly | 4.1 | Source-generated DTO mapping (no reflection) | | Validation | FluentValidation | 11.12 | Input validation | | Communication | gRPC + REST | - | Service communication | | API Documentation | Swagger/OpenAPI | 3.0 | Interactive docs |

Data & Storage

| Database | Type | Purpose | Port | | --- | --- | --- | --- | | MongoDB | Document DB | Product catalog | 27017 | | Redis | Cache/Session | Shopping baskets | 6379 | | PostgreSQL | Relational | Discount coupons | 5432 | | SQL Server | Relational | Orders & activity | 1433 | | AWS S3 | Object Storage | Product images | - |

Message Bus & Communication

| Technology | Purpose | | --- | --- | | RabbitMQ | Event bus for asynchronous communication | | MassTransit | .NET messaging framework | | gRPC | High-performance RPC (Basket โ†’ Discount) | | REST/JSON | Client-facing APIs |

Cloud & DevOps

| Component | Technology | Purpose | | --- | --- | --- | | Container Platform | Docker | Application containerization | | Orchestration | Kubernetes (EKS) | Container management | | IaC | CloudFormation + Helm | Infrastructure automation | | Service Mesh | Istio (1.20) | Traffic management, security | | CI/CD | GitHub Actions | Automated build & deploy | | Container Registry | ECR (AWS) / GHCR (GitHub) | Image storage | | Local Development | Minikube + LocalStack | Local simulation |

Monitoring & Observability

| Stack | Components | Purpose | | --- | --- | --- | | Logs | Serilog โ†’ Elasticsearch โ†’ Kibana | Centralized logging | | Metrics | Prometheus | Metrics collection (15s scrape) | | Dashboards | Grafana | Metrics visualization | | Traces | Jaeger Collector | Distributed tracing | | Service Mesh | Istio + Envoy sidecars | Service observability | | Topology | Kiali | Service mesh visualization | | Health Checks | Custom endpoints | Service health monitoring |

๐Ÿ“ฆ Project Structure

cloud-native-ecommerce-platform/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ micro-frontends/          # Microfrontend monorepo (Nx)
โ”‚   โ”œโ”€โ”€ host/                             # Shell app (Host) - Router, Auth
โ”‚   โ”œโ”€โ”€ store/                            # Store MFE - Product browsing
โ”‚   โ”œโ”€โ”€ checkout/                         # Checkout MFE - Cart & checkout
โ”‚   โ”œโ”€โ”€ account/                          # Account MFE - User profile
โ”‚   โ”œโ”€โ”€ admin/                            # Admin MFE - Management dashboard
โ”‚   โ”œโ”€โ”€ packages/
โ”‚   โ”‚   โ”œโ”€โ”€ app-injector/                 # MFE injection utilities
โ”‚   โ”‚   โ”œโ”€โ”€ auth-provider/                # Shared authentication provider
โ”‚   โ”‚   โ””โ”€โ”€ shared-layout/                # Shared UI components (Navbar, Footer)
โ”‚   โ”œโ”€โ”€ e2e/                              # E2E tests (Playwright)
โ”‚   โ”œโ”€โ”€ nx.json                           # Nx configuration
โ”‚   โ”œโ”€โ”€ tsconfig.base.json                # TypeScript base config
โ”‚   โ””โ”€โ”€ package.json                      # Dependencies
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Services/                          # Backend microservices (.NET 10)
โ”‚   โ”œโ”€โ”€ Catalog/
โ”‚   โ”‚   โ”œโ”€โ”€ Catalog.API/                  # REST endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ Catalog.Core/                 # Domain entities
โ”‚   โ”‚   โ””โ”€โ”€ Catalog.Infrastructure/       # MongoDB, S3
โ”‚   โ”œโ”€โ”€ Basket/
โ”‚   โ”‚   โ”œโ”€โ”€ Basket.API/                   # REST endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ Basket.Core/                  # Domain entities
โ”‚   โ”‚   โ””โ”€โ”€ Basket.Infrastructure/        # Redis, gRPC client
โ”‚   โ”œโ”€โ”€ Discount/
โ”‚   โ”‚   โ”œโ”€โ”€ Discount.API/                 # gRPC & REST endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ Discount.Core/                # Domain entities
โ”‚   โ”‚   โ””โ”€โ”€ Discount.Infrastructure/      # PostgreSQL
โ”‚   โ””โ”€โ”€ Ordering/
โ”‚       โ”œโ”€โ”€ Ordering.API/                 # REST endpoints
โ”‚       โ”œโ”€โ”€ Ordering.Core/                # Domain entities, Activity tracking
โ”‚       โ””โ”€โ”€ Ordering.Infrastructure/      # SQL Server, RabbitMQ consumer
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ ApiGateways/
โ”‚   โ””โ”€โ”€ Ocelot.ApiGateway/                # API Gateway configuration
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Infrastructure/                    # Shared libraries & IaC
โ”‚   โ”œโ”€โ”€ aws/
โ”‚   โ”‚   โ””โ”€โ”€ cloudformation/               # AWS infrastructure templates
โ”‚   โ”‚       โ”œโ”€โ”€ vpc.yaml                  # VPC, subnets, NAT
โ”‚   โ”‚       โ”œโ”€โ”€ eks-cluster.yaml          # EKS cluster & node groups
โ”‚   โ”‚       โ”œโ”€โ”€ minimal-stack.yaml        # Combined VPC + EKS
โ”‚   โ”‚       โ””โ”€โ”€ alb-ingress.yaml          # Load balancer
โ”‚   โ””โ”€โ”€ EventBus/                         # RabbitMQ, MassTransit setup
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Deployments/
โ”‚   โ”œโ”€โ”€ helm/                             # Helm charts (19 total)
โ”‚   โ”‚   โ”œโ”€โ”€ catalogdb/                    # MongoDB chart
โ”‚   โ”‚   โ”œโ”€โ”€ basketdb/                     # Redis chart
โ”‚   โ”‚   โ”œโ”€โ”€ discountdb/                   # PostgreSQL chart
โ”‚   โ”‚   โ”œโ”€โ”€ orderdb/                      # SQL Server chart
โ”‚   โ”‚   โ”œโ”€โ”€ rabbitmq/                     # RabbitMQ chart
โ”‚   โ”‚   โ”œโ”€โ”€ catalog/                      # Catalog service chart
โ”‚   โ”‚   โ”œโ”€โ”€ basket/                       # Basket service chart
โ”‚   โ”‚   โ”œโ”€โ”€ discount/                     # Discount service chart
โ”‚   โ”‚   โ”œโ”€โ”€ ordering/                     # Ordering service chart
โ”‚   โ”‚   โ”œโ”€โ”€ ocelotapigw/                  # API Gateway chart
โ”‚   โ”‚   โ”œโ”€โ”€ prometheus/                   # Prometheus chart
โ”‚   โ”‚   โ”œโ”€โ”€ grafana/                      # Grafana chart
โ”‚   โ”‚   โ”œโ”€โ”€ elasticsearch/                # Elasticsearch chart
โ”‚   โ”‚   โ””โ”€โ”€ kibana/                       # Kibana chart
โ”‚   โ”œโ”€โ”€ k8s/                              # Kubernetes manifests
โ”‚   โ”‚   โ”œโ”€โ”€ deployments/                  # Service deployments
โ”‚   โ”‚   โ”œโ”€โ”€ services/                     # Service definitions
โ”‚   โ”‚   โ”œโ”€โ”€ ingress/                      # Ingress rules
โ”‚   โ”‚   โ””โ”€โ”€ monitoring/                   # Monitoring resources
โ”‚   โ””โ”€โ”€ monitoring/                       # Observability configs
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ .github/
โ”‚   โ””โ”€โ”€ workflows/                        # CI/CD pipelines
โ”‚       โ”œโ”€โ”€ ci.yml                        # Build, test, security scan
โ”‚       โ”œโ”€โ”€ cd.yml                        # Build images, push ECR, deploy
โ”‚       โ””โ”€โ”€ docker.yml                    # Publish to GHCR
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ scripts/
โ”‚   โ”œโ”€โ”€ deploy/                           # Deployment scripts
โ”‚   โ”‚   โ”œโ”€โ”€ deploy.sh                     # Local Minikube deployment
โ”‚   โ”‚   โ”œโ”€โ”€ deploy-aws.sh                 # Full AWS EKS deployment
โ”‚   โ”‚   โ”œโ”€โ”€ deploy-aws-minimal.sh         # Cost-optimized AWS deployment
โ”‚   โ”‚   โ”œโ”€โ”€ docker-deploy.sh              # Docker Compose deployment
โ”‚   โ”‚   โ””โ”€โ”€ build-images.sh               # Build Docker images
โ”‚   โ”œโ”€โ”€ cleanup/                          # Resource teardown
โ”‚   โ”œโ”€โ”€ access/                           # Service access portals
โ”‚   โ”œโ”€โ”€ debug/                            # Debugging utilities
โ”‚   โ””โ”€โ”€ monitoring/                       # Observability setup scripts
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ tools/postman/                     # API testing collections
โ”œโ”€โ”€ ๐Ÿ“ diagrams/                          # Architecture diagrams (eraser.io)
โ”‚
โ”œโ”€โ”€ README.md                             # This file
โ”œโ”€โ”€ DEPLOYMENT-GUIDE.md                   # Detailed deployment docs
โ”œโ”€โ”€ LICENSE                               # MIT License
โ””โ”€โ”€ docker-compose.yml                    # Local development stack

๐Ÿง  Architecture Patterns & Design

Microfrontend Architecture

The platform uses Webpack Module Federation with a shell-based orchestration pattern:

  • Host Application (Shell): Manages routing, authentication, shared layout
  • Remote Applications: Store, Checkout, Account, Admin - independently deployed
  • Shared Packages: Common authentication, UI components, injection utilities
  • Runtime Loading: Remotes loaded dynamically at runtime (no compile-time dependencies)
  • Development: Each micro-app runs on separate port (4200-4204)
  • Production: All apps bundled together, remotes served from /remotes/ directory
Benefits:
  • โœ… Independent deployability per micro-app
  • โœ… Team autonomy (each team owns a micro-app)
  • โœ… Technology flexibility (each remote can use different versions)
  • โœ… Better performance (lazy loading of remotes)

Backend Architecture

Each microservice follows Clean Architecture with CQRS Pattern:

Controllers/Endpoints โ†’ Mediator Pipeline โ†’ Commands/Queries
                                              โ†“
                                    Command Handlers / Query Handlers
                                              โ†“
                                         Domain Layer
                                              โ†“
                                      Infrastructure (Repositories, Services)
                                              โ†“
                                        Data Layer

Communication Patterns

  • Synchronous: REST APIs, gRPC (Basket โ†” Discount)
  • Asynchronous: RabbitMQ with MassTransit (Event-driven)
  • Frontend-Backend: REST APIs with JWT authentication

Security Architecture

  • Authentication: JWT planned (no auth middleware currently wired up)
  • Authorization: Role-based access control (RBAC)
  • Service-to-Service: Istio mTLS for encrypted communication
  • Data Security: Encryption at rest (S3, databases) and in transit (HTTPS/TLS)

๐Ÿข Business Features

Product Management

  • Full CRUD operations for products
  • Brand and type management
  • Image upload & storage (AWS S3 or LocalStack)
  • Product search and filtering

Shopping Experience

  • Real-time shopping basket (Redis-backed)
  • Coupon/discount application
  • Product recommendations
  • Multi-item checkout

Order Processing

  • Event-driven order creation
  • Order status tracking
  • Payment information handling
  • Order history and details

Admin Dashboard

  • Products: CRUD, bulk upload, categorization
  • Orders: View, manage, track
  • Brands & Types: Management
  • Activity Tracking: Audit log of all changes
  • Analytics: Real-time statistics and insights

Activity Tracking & Audit

  • Track all product changes (Create, Update, Delete)
  • Track all order lifecycle events
  • User accountability
  • Compliance reporting

๐Ÿงช Testing

E2E Testing (Playwright)

cd micro-frontends
npm run test:e2e              # Run all tests
npm run test:e2e:ui           # Interactive mode
npm run test:e2e:debug        # Debug mode
npm run test:e2e:report       # View report

Tests cover:

  • Cross-microfrontend navigation
  • Authentication flows
  • Shopping journey (browse โ†’ add to cart โ†’ checkout)
  • Admin dashboard functionality
  • Error handling

Unit Tests

# Frontend tests
npm test                      # All frontend tests
npm run test:coverage         # Coverage report

Backend tests

dotnet test # All backend tests dotnet test --filter Category=Integration # Integration tests only

API Testing (Postman)

  • Pre-built Postman collections for all services
  • Located in: tools/postman/

๐Ÿ”’ Security

Application Security

  • JWT Authentication (planned โ€” not yet wired up)
  • Role-Based Access Control (RBAC)
  • Input Validation with FluentValidation
  • SQL Injection Prevention via parameterized queries & ORM
  • CORS Configuration at API Gateway level

Cloud Security

  • IRSA (IAM Roles for Service Accounts) - no static credentials
  • Secrets Management via Kubernetes Secrets
  • Network Policies for pod-to-pod communication
  • Service Mesh mTLS for encrypted communication

CI/CD Security

  • Trivy for container image scanning
  • CodeQL for static code analysis
  • Dependency Scanning via GitHub Dependabot
  • SBOM Generation for supply chain security

Data Protection

  • Encryption at Rest: All databases encrypted
  • Encryption in Transit: HTTPS/TLS for all connections
  • S3 Bucket Policies: Restricted access to product images

๐Ÿ“Š Monitoring & Observability

The platform follows the 3 Pillars of Observability:

1๏ธโƒฃ Logs (ELK Stack)

  • Serilog: Structured logging in backend
  • Elasticsearch: Log aggregation and indexing
  • Kibana: Log exploration and visualization
  • Access: Kibana at localhost:5601

2๏ธโƒฃ Metrics (Prometheus & Grafana)

  • Prometheus: Metrics collection (15-second scrape interval)
  • Scrape Targets: API servers, Node Exporter, Kubernetes components
  • Grafana: Custom dashboards for application and infrastructure metrics
  • Access:
- Prometheus at localhost:9090 - Grafana at localhost:3000

3๏ธโƒฃ Traces (Jaeger & Istio)

  • Istio/Envoy: Automatic trace collection (service mesh layer)
  • Jaeger Collector: Trace aggregation
  • Jaeger UI: Trace visualization and analysis
  • Access: Jaeger at localhost:16686

Service Mesh Visualization

Health Checks

All services expose health check endpoints:

  • /health - Service health status
  • /health/live - Liveness probe
  • /health/ready - Readiness probe

โš™๏ธ CI/CD Pipeline

GitHub Actions Workflows

1. CI Pipeline (Continuous Integration)

Triggered on: Pull requests, pushes to main

Steps:

  • Code Quality
- Build .NET 10 backend - Run backend unit tests (with Cobertura coverage) - Run frontend tests via Nx affected - ESLint and Prettier
  • Security Scanning
- Trivy: Container vulnerability scanning - CodeQL: Static code analysis (C#, TypeScript)
  • Docker Build
- Build all 5 microservice images - Multi-arch support (linux/amd64) - Cache integration for speed
  • Integration Tests
- Start service containers (Redis, PostgreSQL, MongoDB, RabbitMQ) - Run integration test suite
  • Deployment Validation
- Helm chart linting - Kubernetes manifest validation

2. CD Pipeline (Continuous Deployment)

Triggered on: Tags, manual workflow dispatch

Steps:

  • Build & Push to ECR
- Build 5 microservice images - Push to AWS ECR - Scan images with Trivy - Tag: latest, git sha, version
  • Deploy to EKS (per environment)
- Environment-specific deployment (dev/staging/prod) - Helm upgrade --install for databases - Helm upgrade --install for services - S3 configuration and image migration - Health checks and smoke tests

3. Docker Pipeline

Triggered on: Pushes to main/release branches

Steps:

  • Build 5 microservice images
  • Publish to GitHub Container Registry (GHCR)
  • Automatic semantic versioning
  • Security scanning with Trivy

๐Ÿš€ Deployment

Local Development

# Requires: Docker, Docker Compose, Minikube, Helm, kubectl

Start everything locally

./scripts/deploy/deploy.sh

Access at http://localhost:4200

What's deployed:

  • Minikube Kubernetes cluster (10GB RAM, 8 CPUs)
  • All 5 microservices
  • All 4 databases
  • RabbitMQ message broker
  • LocalStack (S3 emulation)
  • Monitoring stack (Prometheus, Grafana, Elasticsearch, Kibana, Jaeger)

AWS Deployment

Prerequisites

aws configure                    # Configure AWS credentials
export AWS_REGION=ap-southeast-1 # Set region

Full Production Deployment

./scripts/deploy/deploy-aws.sh

What's deployed:

  • AWS EKS cluster (multi-AZ)
  • EC2 node group (1-3 m7i-flex.large instances)
  • RDS-managed databases (in Kubernetes)
  • Network Load Balancer with HTTPS
  • Full monitoring stack
  • Auto-scaling policies (HPA)
Time: ~30-40 minutes Cost: ~$150-300/month

Minimal Deployment (Cost-Optimized)

./scripts/deploy/deploy-aws-minimal.sh

What's deployed:

  • AWS EKS cluster (single AZ)
  • Single m7i-flex.large node (1-3 auto-scaling)
  • Core services only (no monitoring)
  • AWS S3 for image storage
Time: ~20-25 minutes Cost: ~$20-50/month

Configuration

For detailed configuration options, see:

๐Ÿ’ป Development

Frontend Development

cd micro-frontends

Install dependencies

npm install

Start all micro-apps in parallel

npm start

Or run individual micro-apps

npm run start:host # Port 4200 npm run start:store # Port 4201 npm run start:checkout # Port 4202 npm run start:account # Port 4203 npm run start:admin # Port 4204

Backend Development

# Catalog Service
cd Services/Catalog/Catalog.API
dotnet watch run        # Auto-reload on changes

Other services (similar pattern)

cd Services/Basket/Basket.API && dotnet watch run cd Services/Discount/Discount.API && dotnet watch run cd Services/Ordering/Ordering.API && dotnet watch run

Available npm Commands

# Building
npm run build          # Build all apps (dev)
npm run build:prod     # Build all apps (production)
npm run build:packages # Build shared packages

Testing

npm test # Run all tests npm run test:watch # Watch mode npm run test:coverage # Coverage report npm run test:e2e # E2E tests (Playwright)

Linting & Formatting

npm run lint # ESLint npm run lint:fix # Fix linting issues npm run format # Prettier

Nx Commands

npm run affected:test # Test affected apps npm run affected:build # Build affected apps npm run graph # View dependency graph npm run clean # Clean cache and dist

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

  • Development environment setup
  • Coding standards and guidelines
  • Testing requirements
  • Pull request process
  • Issue reporting guidelines
Also review:

๐Ÿ“š Documentation

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™‹ Support

For issues and questions:

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท sloweyyy/cloud-native-ecommerce-platform ยท Updated daily from GitHub