Skip to content

Cloud-native e-commerce, documented from the source

Four .NET 10 microservices behind an Ocelot gateway, each with its own database, talking over REST, gRPC and RabbitMQ. It ships to Kubernetes with Helm, Istio and Terraform on AWS. Every page here was written by reading the code, and it says so where the code falls short.
4microservices (.NET 10)
4database engines, one per service
3communication styles: REST, gRPC, AMQP
15Helm charts
8Terraform modules on AWS
10GitHub Actions workflows

This is a portfolio-scale e-commerce backend built as a set of independently deployable services. A shopper browses a product catalog, adds items to a basket (discounts are applied on the way in), and checks out. Checkout emits an integration event that the ordering service turns into a persisted order. The discount service owns coupons and is reached only over gRPC.

The repository contains more than application code. It also includes the delivery infrastructure: Dockerfiles and a Compose stack for local development, raw Kubernetes manifests and Helm charts, an Istio service mesh with Jaeger and Kiali, Terraform modules and CloudFormation templates for AWS (VPC, EKS, ECR and managed data stores), and GitHub Actions pipelines for CI, image publishing, SBOM generation, Terraform checks and deployment to EKS.

The frontend is a React 18 micro-frontend application built with Nx and Webpack Module Federation, found in frontend/web. It is covered in its own section.

flowchart TB
  user(["Browser: React MFE host"])
  gw["Ocelot API Gateway :8010"]
  user -->|HTTP| gw

  gw -->|REST| cat["Catalog.API"]
  gw -->|REST| bas["Basket.API"]
  gw -->|REST| ord["Ordering.API"]
  bas -->|"gRPC GetDiscount"| dis["Discount.API (gRPC only)"]

  cat --> mongo[("MongoDB")]
  cat --> s3[("S3 / LocalStack")]
  bas --> redis[("Redis")]
  dis --> pg[("PostgreSQL")]
  ord --> mssql[("SQL Server")]

  bas -. "BasketCheckoutEvent" .-> mq{{"RabbitMQ via MassTransit"}}
  cat -. "ProductActivityEvent" .-> mq
  mq -. "consumed by" .-> ord

All four services also send structured logs to Elasticsearch through the shared Serilog configuration, and traces to Jaeger over OTLP.

The architecture page covers service boundaries, data ownership, and when the system uses synchronous or asynchronous communication. Request flows walks through the three main user journeys with sequence diagrams.

Concern Technology (version pinned in the repo) Where
Runtime .NET SDK 10.0.300, net10.0 target global.json
Web APIs ASP.NET Core controllers, Asp.Versioning.Mvc 10.2, Swashbuckle 6.9 Directory.Packages.props
CQRS / dispatch In-house Common.Mediator (replaced MediatR) src/BuildingBlocks/Common.Mediator
Mapping Riok.Mapperly 4.3 (source-generated, replaced AutoMapper) per-service Mappers/ folders
Validation FluentValidation 11.12 (Ordering) src/Services/Ordering/Ordering.Application/Validators
Messaging MassTransit 8.5 on RabbitMQ 3 src/BuildingBlocks/EventBus.Messages
Sync RPC gRPC (Grpc.AspNetCore 2.83), protobuf contract src/Services/Discount/Discount.Application/Protos/discount.proto
Gateway Ocelot 23.4 src/ApiGateways/Ocelot.ApiGateway
Data MongoDB.Driver 3.12, StackExchange.Redis cache, Npgsql 10 + Dapper, EF Core 10 (SQL Server) service Infrastructure projects
Object storage AWSSDK.S3, with LocalStack for local development src/Services/Catalog/Catalog.Infrastructure/Services/S3ImageStorageService.cs
Logging Serilog 8 with Console and Elasticsearch sinks src/BuildingBlocks/Common.Logging/Logging.cs
Tracing OpenTelemetry 1.19, OTLP exporter to Jaeger each service’s Program.cs
Containers Multi-stage Dockerfiles, Docker Compose docker-compose.yml
Orchestration Kubernetes manifests, 15 Helm charts, HPA, PDBs, NetworkPolicies deploy
Service mesh Istio (sidecars, ingress gateway, telemetry), Jaeger, Kiali deploy/istio
Cloud Terraform (AWS provider ~> 5.80) and CloudFormation deploy/terraform, deploy/aws/cloudformation
CI/CD GitHub Actions, Trivy, CodeQL, Syft/Grype SBOM, semantic-release, Dependabot .github/workflows
Load testing k6 (smoke, load, stress, spike, soak, workflow scripts) tests/load/k6
Frontend React 18, Nx 23.2.1, Module Federation, TanStack Router/Query, Ant Design, MSAL frontend/web
Terminal window
git clone https://github.com/sloweyyy/cloud-native-ecommerce-platform.git
cd cloud-native-ecommerce-platform
cp .env.example .env # connection strings and credentials for local containers
docker compose up -d --build # 4 APIs, gateway, 4 databases, RabbitMQ, ES/Kibana, LocalStack
curl http://localhost:8010/Catalog/GetAllProducts # through the Ocelot gateway

See Getting started for ports, what each container does, and troubleshooting.