How f4cio/eshoponcontainers works
Purpose and entry points
This is a containerized .NET e-commerce reference system built as independently deployable services, client-facing web apps, and API gateways. Local composition starts from SourceCode/eShopOnContainers/src/docker-compose.yml; Kubernetes rollout is orchestrated by SourceCode/eShopOnContainers/deploy/k8s/helm/deploy-all.sh. Each service/app is an ASP.NET Core entry point via its Program.cs, for example SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs.
Client and edge layer
MVC and Angular SPA clients provide catalog, basket, and order experiences; they authenticate against the identity service and call backend APIs through web-oriented BFF aggregation/gateway layers.
• MVC: SourceCode/eShopOnContainers/src/Web/WebMVC/Program.cs, SourceCode/eShopOnContainers/src/Web/WebMVC/Services/OrderingService.cs
• SPA host/client: SourceCode/eShopOnContainers/src/Web/WebSPA/Program.cs, SourceCode/eShopOnContainers/src/Web/WebSPA/Client/src/modules/app.module.ts
• Web/mobile shopping aggregators combine basket, catalog, and ordering calls, including gRPC clients: SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs, SourceCode/eShopOnContainers/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs
• Kubernetes API-gateway deployments use Envoy configuration: SourceCode/eShopOnContainers/deploy/k8s/helm/apigwws/envoy.yaml.
Core commerce services
Catalog owns product data, images, stock handling, and product-price events. Basket owns per-user carts in Redis and emits checkout events. Ordering is the principal workflow boundary, with DDD aggregates, command/query separation, transactions, and idempotent requests.
• Catalog: SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs, SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs
• Basket: SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs, SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Repositories/RedisBasketRepository.cs
• Ordering API/domain/infrastructure: SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs, SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs, SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs.
Identity, payment, notifications, and webhooks
Identity is a dedicated authentication/authorization server with its own EF user store and interactive account/consent UI. Payment reacts to order stock-confirmation events and publishes payment outcome events. Ordering status changes fan out to a SignalR hub and optional webhook subscriptions.
• Identity: SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Program.cs, SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs
• Payment: SourceCode/eShopOnContainers/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs
• Realtime updates: SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs
• Webhook delivery/subscriptions: SourceCode/eShopOnContainers/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs, SourceCode/eShopOnContainers/src/Services/Webhooks/Webhooks.API/Services/WebhooksSender.cs.
Event-driven checkout flow
Checkout crosses service boundaries asynchronously: Basket publishes UserCheckoutAccepted; Ordering creates and advances an order; Catalog confirms or rejects stock; Payment reports success/failure; Ordering publishes status events for clients and webhooks. Shared EventBus abstractions isolate business services from transport choice, while EF integration-event logs and resilient transactions support persistence-to-publication reliability.
• Event contracts/handlers: SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs, SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs
• Transport implementations: SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs, SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs
• Outbox-style event log: SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs.
Runtime, data, and deployment boundaries
The primary runtime is .NET/ASP.NET Core in Docker containers; the SPA additionally uses Angular/Node tooling. Services expose HTTP APIs and selected gRPC contracts. SQL-backed EF contexts serve catalog, ordering, identity, and webhooks; Redis serves baskets. RabbitMQ is provisioned for local/Kubernetes messaging, while Azure templates support SQL, Redis, Service Bus, Cosmos DB, and storage. ELK deployment assets provide centralized logging.
• Composition: SourceCode/eShopOnContainers/src/docker-compose.yml, SourceCode/eShopOnContainers/src/docker-compose.elk.yml
• Kubernetes service charts: SourceCode/eShopOnContainers/deploy/k8s/helm/ordering-api/Chart.yaml, SourceCode/eShopOnContainers/deploy/k8s/helm/rabbitmq/Chart.yaml
• Azure infrastructure: SourceCode/eShopOnContainers/deploy/azure/az/servicebus/sbusdeploy.json, SourceCode/eShopOnContainers/deploy/azure/az/sql/sqldeploy.json.
Main entry points: Ordering.API/Program.cs Ordering API · aggregator/Program.cs Shopping BFFs · BasketController.cs Basket API · CatalogController.cs Catalog API
Components 20
Clients & Edge
- MVC storefront
SourceCode/eShopOnContainers/src/Web/WebMVC/Program.cs - Angular SPA host
SourceCode/eShopOnContainers/src/Web/WebSPA/Program.cs - Shopping BFFs · Web and mobile aggregators compose commerce calls.
SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs - Envoy gateways
SourceCode/eShopOnContainers/deploy/k8s/helm/apigwws/envoy.yaml
Commerce Services
- Catalog API · Owns products, images, stock, and price events.
SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs - Catalog SQL
SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs - Basket API · Owns user carts and checkout initiation.
SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs - Basket Redis
SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Repositories/RedisBasketRepository.cs - Ordering API · Handles commands, queries, and idempotent order requests.
SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs - Order aggregate
SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs - Ordering SQL
SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs
Platform Services
- Identity service · Provides authentication, authorization, and account UI.
SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Program.cs - Identity SQL
SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs - Payment API · Consumes stock-confirmed orders and emits payment outcomes.
SourceCode/eShopOnContainers/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs - Ordering SignalR hub
SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs - Webhooks API · Manages subscriptions and outbound webhook delivery.
SourceCode/eShopOnContainers/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs
Runtime & Delivery
- Event bus · Abstracts RabbitMQ or Azure Service Bus transport.
- Integration event log · Coordinates durable event publication with EF transactions.
SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs - Docker Compose
SourceCode/eShopOnContainers/src/docker-compose.yml - Helm rollout
SourceCode/eShopOnContainers/deploy/k8s/helm/deploy-all.sh
Connections 26
- MVC storefront → Identity service: authenticates
- Angular SPA host → Identity service: authenticates
- MVC storefront → Shopping BFFs: commerce calls
- Angular SPA host → Shopping BFFs: commerce calls
- Envoy gateways → Shopping BFFs: routes
- Shopping BFFs → Catalog API: aggregates
- Shopping BFFs → Basket API: aggregates
- Shopping BFFs → Ordering API: aggregates
- Catalog API → Catalog SQL: persists
- Basket API → Basket Redis: stores carts
- Ordering API → Order aggregate: executes commands
- Ordering API → Ordering SQL: persists
- Identity service → Identity SQL: stores users
- Basket API → Event bus: UserCheckoutAccepted
- Event bus → Ordering API: checkout event
- Ordering API → Event bus: order status events
- Event bus → Catalog API: stock workflow
- Event bus → Payment API: stock confirmed
- Payment API → Event bus: payment outcome
- Event bus → Ordering SignalR hub: status updates
- Event bus → Webhooks API: status updates
- Ordering API → Integration event log: reliable publication
- Integration event log → Event bus: publishes
- Docker Compose → Event bus: local RabbitMQ
- Helm rollout → Envoy gateways: deploys
- Helm rollout → Ordering API: deploys