# f4cio/eshoponcontainers architecture

> Architecture diagram of the GitHub repository f4cio/eshoponcontainers, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/f4cio/eshoponcontainers
- Repository: https://github.com/f4cio/eshoponcontainers

## Overview

#### 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: [`SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs`](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs) (Ordering API), [`SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs`](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs) (Shopping BFFs), [`SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs`](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs) (Basket API), [`SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs`](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs) (Catalog API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clients &amp; Edge"]
  node_mvc["MVC storefront<br/>ASP.NET Core app<br/>[Program.cs]"]
  node_spa["Angular SPA host<br/>ASP.NET Core + Angular<br/>[Program.cs]"]
  node_shopping_bff["Shopping BFFs<br/>API aggregators<br/>[Program.cs]"]
  node_envoy{{"Envoy gateways<br/>Kubernetes gateway<br/>[envoy.yaml]"}}
end

subgraph group_commerce["Commerce Services"]
  node_catalog["Catalog API<br/>commerce service"]
  node_catalog_db[("Catalog SQL<br/>EF data store<br/>[CatalogContext.cs]")]
  node_basket["Basket API<br/>commerce service"]
  node_redis[("Basket Redis<br/>cart store")]
  node_ordering_api["Ordering API<br/>workflow service<br/>[Program.cs]"]
  node_order_domain["Order aggregate<br/>DDD domain<br/>[Order.cs]"]
  node_ordering_db[("Ordering SQL<br/>EF data store<br/>[OrderingContext.cs]")]
end

subgraph group_platform["Platform Services"]
  node_identity["Identity service<br/>auth server<br/>[Program.cs]"]
  node_identity_db[("Identity SQL<br/>EF user store")]
  node_payment["Payment API<br/>payment service"]
  node_realtime["Ordering SignalR hub<br/>realtime endpoint<br/>[NotificationHub.cs]"]
  node_webhooks["Webhooks API<br/>notification service"]
end

subgraph group_runtime["Runtime &amp; Delivery"]
  node_event_bus["Event bus<br/>integration messaging"]
  node_event_log[("Integration event log<br/>transactional outbox")]
  node_docker["Docker Compose<br/>local composition<br/>[docker-compose.yml]"]
  node_helm["Helm rollout<br/>Kubernetes deployment<br/>[deploy-all.sh]"]
end

node_mvc -->|"authenticates"| node_identity
node_spa -->|"authenticates"| node_identity
node_mvc -->|"commerce calls"| node_shopping_bff
node_spa -->|"commerce calls"| node_shopping_bff
node_envoy -->|"routes"| node_shopping_bff
node_shopping_bff -->|"aggregates"| node_catalog
node_shopping_bff -->|"aggregates"| node_basket
node_shopping_bff -->|"aggregates"| node_ordering_api
node_catalog -->|"persists"| node_catalog_db
node_basket -->|"stores carts"| node_redis
node_ordering_api -->|"executes commands"| node_order_domain
node_ordering_api -->|"persists"| node_ordering_db
node_identity -->|"stores users"| node_identity_db
node_basket -->|"UserCheckoutAccepted"| node_event_bus
node_event_bus -->|"checkout event"| node_ordering_api
node_ordering_api -->|"order status events"| node_event_bus
node_event_bus -->|"stock workflow"| node_catalog
node_event_bus -->|"stock confirmed"| node_payment
node_payment -->|"payment outcome"| node_event_bus
node_event_bus -->|"status updates"| node_realtime
node_event_bus -->|"status updates"| node_webhooks
node_ordering_api -->|"reliable publication"| node_event_log
node_event_log -->|"publishes"| node_event_bus
node_docker -.->|"local RabbitMQ"| node_event_bus
node_helm -.->|"deploys"| node_envoy
node_helm -.->|"deploys"| node_ordering_api

click node_mvc "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Web/WebMVC/Program.cs"
click node_spa "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Web/WebSPA/Program.cs"
click node_shopping_bff "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs"
click node_envoy "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/deploy/k8s/helm/apigwws/envoy.yaml"
click node_catalog "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs"
click node_catalog_db "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs"
click node_basket "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs"
click node_redis "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Repositories/RedisBasketRepository.cs"
click node_ordering_api "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs"
click node_order_domain "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs"
click node_ordering_db "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs"
click node_identity "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Program.cs"
click node_identity_db "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs"
click node_payment "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs"
click node_realtime "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs"
click node_webhooks "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs"
click node_event_log "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs"
click node_docker "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/docker-compose.yml"
click node_helm "https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/deploy/k8s/helm/deploy-all.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mvc,node_spa,node_shopping_bff,node_envoy toneBlue
class node_catalog,node_catalog_db,node_basket,node_redis,node_ordering_api,node_order_domain,node_ordering_db toneAmber
class node_identity,node_identity_db,node_payment,node_realtime,node_webhooks toneMint
class node_event_bus,node_event_log,node_docker,node_helm toneRose
```

## Components

### Clients & Edge

- [MVC storefront](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Web/WebMVC/Program.cs): ASP.NET Core app · `SourceCode/eShopOnContainers/src/Web/WebMVC/Program.cs`
- [Angular SPA host](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Web/WebSPA/Program.cs): ASP.NET Core + Angular · `SourceCode/eShopOnContainers/src/Web/WebSPA/Program.cs`
- [Shopping BFFs](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs): API aggregators · Web and mobile aggregators compose commerce calls. · `SourceCode/eShopOnContainers/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs`
- [Envoy gateways](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/deploy/k8s/helm/apigwws/envoy.yaml): Kubernetes gateway · `SourceCode/eShopOnContainers/deploy/k8s/helm/apigwws/envoy.yaml`

### Commerce Services

- [Catalog API](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs): commerce service · Owns products, images, stock, and price events. · `SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs`
- [Catalog SQL](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs): EF data store · `SourceCode/eShopOnContainers/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs`
- [Basket API](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs): commerce service · Owns user carts and checkout initiation. · `SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Controllers/BasketController.cs`
- [Basket Redis](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Repositories/RedisBasketRepository.cs): cart store · `SourceCode/eShopOnContainers/src/Services/Basket/Basket.API/Repositories/RedisBasketRepository.cs`
- [Ordering API](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs): workflow service · Handles commands, queries, and idempotent order requests. · `SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.API/Program.cs`
- [Order aggregate](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs): DDD domain · `SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs`
- [Ordering SQL](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs): EF data store · `SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs`

### Platform Services

- [Identity service](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Program.cs): auth server · Provides authentication, authorization, and account UI. · `SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Program.cs`
- [Identity SQL](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs): EF user store · `SourceCode/eShopOnContainers/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs`
- [Payment API](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs): payment service · Consumes stock-confirmed orders and emits payment outcomes. · `SourceCode/eShopOnContainers/src/Services/Payment/Payment.API/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs`
- [Ordering SignalR hub](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs): realtime endpoint · `SourceCode/eShopOnContainers/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs`
- [Webhooks API](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs): notification service · Manages subscriptions and outbound webhook delivery. · `SourceCode/eShopOnContainers/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs`

### Runtime & Delivery

- **Event bus**: integration messaging · Abstracts RabbitMQ or Azure Service Bus transport.
- [Integration event log](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs): transactional outbox · Coordinates durable event publication with EF transactions. · `SourceCode/eShopOnContainers/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs`
- [Docker Compose](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/src/docker-compose.yml): local composition · `SourceCode/eShopOnContainers/src/docker-compose.yml`
- [Helm rollout](https://github.com/f4cio/eshoponcontainers/blob/main/SourceCode/eShopOnContainers/deploy/k8s/helm/deploy-all.sh): Kubernetes deployment · `SourceCode/eShopOnContainers/deploy/k8s/helm/deploy-all.sh`

## Connections

- 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
