Skip to content

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.

  • 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.yml pins platform: linux/amd64 for orderdb.
  • Optional: the .NET 10 SDK (global.json pins 10.0.300 with rollForward: latestFeature) if you want to run services outside containers.
  1. Clone the repository and create your .env from the template:

    Terminal window
    git clone https://github.com/sloweyyy/cloud-native-ecommerce-platform.git
    cd cloud-native-ecommerce-platform
    cp .env.example .env

    .env.example holds the local credentials and composes the connection strings the services read, for example MONGODB_URL, REDIS_URL, POSTGRES_URL, SQLSERVER_URL and RABBITMQ_URL. The values are development defaults only.

  2. Build and start everything:

    Terminal window
    docker compose up -d --build

    Compose merges docker-compose.yml (images and build contexts) with docker-compose.override.yml (ports, environment, health checks, volumes). Services use depends_on with condition: service_healthy for MongoDB, PostgreSQL, SQL Server, Elasticsearch and LocalStack, so the APIs wait for their stores to be ready before they start.

  3. Call the API through the gateway:

    Terminal window
    curl "http://localhost:8010/Catalog/GetAllProducts?pageIndex=1&pageSize=5"
    curl http://localhost:8010/Catalog/GetAllBrands
    curl http://localhost:8010/Order/slowey # seeded demo order
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.

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:

Terminal window
cd src/Services/Catalog/Catalog.API
DatabaseSettings__ConnectionString="mongodb://localhost:27017" \
DatabaseSettings__DatabaseName=CatalogDb \
EventBusSettings__HostAddress="amqp://guest:guest@localhost:5672" \
ASPNETCORE_ENVIRONMENT=Development \
dotnet run