Getting started
The quickest way to see the platform working is the Docker Compose stack at the repository root. It builds the four service images and the gateway from source and starts every dependency they need.
Prerequisites
Section titled “Prerequisites”- Docker Desktop (or Docker Engine with the Compose plugin). Give it at least 6 GB of memory: Elasticsearch alone reserves 1 GB of heap by default, and SQL Server needs about 2 GB.
- On Apple Silicon, the SQL Server image runs under emulation, because
docker-compose.ymlpinsplatform: linux/amd64fororderdb. - Optional: the .NET 10 SDK (
global.jsonpins10.0.300withrollForward: latestFeature) if you want to run services outside containers.
Run it
Section titled “Run it”-
Clone the repository and create your
.envfrom the template:Terminal window git clone https://github.com/sloweyyy/cloud-native-ecommerce-platform.gitcd cloud-native-ecommerce-platformcp .env.example .env.env.exampleholds the local credentials and composes the connection strings the services read, for exampleMONGODB_URL,REDIS_URL,POSTGRES_URL,SQLSERVER_URLandRABBITMQ_URL. The values are development defaults only. -
Build and start everything:
Terminal window docker compose up -d --buildCompose merges
docker-compose.yml(images and build contexts) withdocker-compose.override.yml(ports, environment, health checks, volumes). Services usedepends_onwithcondition: service_healthyfor MongoDB, PostgreSQL, SQL Server, Elasticsearch and LocalStack, so the APIs wait for their stores to be ready before they start. -
Call the API through the gateway:
Terminal window curl "http://localhost:8010/Catalog/GetAllProducts?pageIndex=1&pageSize=5"curl http://localhost:8010/Catalog/GetAllBrandscurl http://localhost:8010/Order/slowey # seeded demo order
What is running
Section titled “What is running”| Component | Container | Host port | Notes |
|---|---|---|---|
| Ocelot API Gateway | ocelot.apigateway |
8010 | Loads ocelot.Development.json, which targets host.docker.internal:800x |
| Catalog.API | catalog.api |
8000 | Swagger at /swagger (Development only) |
| Basket.API | basket.api |
8001 | Swagger with v1 and v2 documents |
| Discount.API | discount.api |
8002 → 8080 | gRPC over HTTP/2 only; GET / returns a hint message |
| Ordering.API | ordering.api |
8003 | Swagger at /swagger |
| MongoDB | catalogdb |
27017 | Catalog store |
| Redis | basketdb |
6379 | Basket store |
| PostgreSQL | discountdb |
5432 | Discount store |
| SQL Server 2022 | orderdb |
1433 | Ordering store (Developer edition) |
| RabbitMQ | rabbitmq |
5672, 15672 | Management UI on 15672 |
| Elasticsearch 7.9.2 | elasticsearch |
9200 | Log sink, security disabled |
| Kibana 7.9.2 | kibana |
5601 | Log exploration |
| LocalStack | localstack |
4566 | S3 emulation for product images |
| pgAdmin | pgadmin |
5050 | PostgreSQL admin UI |
| Portainer | portainer |
9000 | Container admin UI |
Prometheus, Grafana and Jaeger are not part of the Compose stack. They come with the Kubernetes and Istio deployment, described in Observability.
Running a service outside Docker
Section titled “Running a service outside Docker”Each API reads its settings from appsettings.json, where values are placeholders such as ${MONGODB_URL}. Override them with environment variables using the double-underscore convention, as the override file does:
cd src/Services/Catalog/Catalog.APIDatabaseSettings__ConnectionString="mongodb://localhost:27017" \DatabaseSettings__DatabaseName=CatalogDb \EventBusSettings__HostAddress="amqp://guest:guest@localhost:5672" \ASPNETCORE_ENVIRONMENT=Development \dotnet runOther ways to run it
Section titled “Other ways to run it”- Kubernetes (Minikube):
deploy/k8s/deploy-all.shapplies the raw manifests and installs Istio with the Jaeger, Kiali and Grafana add-ons. See Kubernetes and Helm. - Helm:
deploy/helm/install-helm.shinstalls the charts indeploy/helm. - AWS:
scripts/deploy/deploy-aws.shuses the CloudFormation templates, anddeploy/terraformholds the Terraform alternative. See AWS. - Frontend:
cd frontend/web && npm ci && npx nx serve host. The host serves on port 4200 and loads its remotes from ports 4201 to 4204. See Micro-frontends.