# azure-samples/eshoponazure architecture

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

- Interactive diagram: https://gitdiagram.com/azure-samples/eshoponazure
- Repository: https://github.com/azure-samples/eshoponazure

## Overview

eShop is a services-based e-commerce reference application. The principal journey is browsing a catalog, building a basket, and placing an order; order validation and later status changes are handled across backend services and integration events. The tree also shows mobile clients, payment and grace-period processing, catalog AI, and webhooks. The README establishes the product and services architecture, while source excerpts and index references support only selected internal relationships; uncertain runtime wiring is left unconnected or marked unverified.

Main entry points: [`src/Ordering.API`](https://github.com/azure-samples/eshoponazure/tree/main/src/Ordering.API) (Ordering API), [`src/EventBusServiceBus/ServiceBusEventBus.cs`](https://github.com/azure-samples/eshoponazure/blob/main/src/EventBusServiceBus/ServiceBusEventBus.cs) (Event bus), [`src/WebApp`](https://github.com/azure-samples/eshoponazure/tree/main/src/WebApp) (Web storefront), [`src/Catalog.API`](https://github.com/azure-samples/eshoponazure/tree/main/src/Catalog.API) (Catalog service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User applications"]
  node_webapp["Web storefront"]
  node_mobile["Mobile app"]
  node_hybrid["Hybrid app"]
end

subgraph group_commerce["Commerce services"]
  node_catalog["Catalog service<br/>[Catalog.API]"]
  node_catalogai["Catalog AI<br/>[CatalogAI.cs]"]
  node_basketapi["Basket service<br/>[Basket.API]"]
  node_basketstore[("Basket Redis store")]
  node_mobilebff["Mobile BFF"]
end

subgraph group_orders["Order processing"]
  node_orderingapi["Ordering API<br/>[Ordering.API]"]
  node_orderdomain["Order domain<br/>[Ordering.Domain]"]
  node_orderdb[("Ordering database<br/>[OrderingContext.cs]")]
  node_orderprocessor["Grace period worker"]
  node_payment["Payment processor"]
end

subgraph group_messaging["Events and messaging"]
  node_eventbus["Event bus"]
  node_eventlog[("Integration event log")]
end

subgraph group_webhooks["Webhook delivery"]
  node_webhookapi["Webhook service<br/>[Webhooks.API]"]
  node_webhookdb[("Webhook subscriptions<br/>[WebhooksContext.cs]")]
  node_webhookclient["Webhook client"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses storefront"| node_webapp
node_webapp -.->|"browses catalog"| node_catalog
node_webapp -.->|"manages basket"| node_basketapi
node_webapp -.->|"places orders"| node_orderingapi
node_mobile -.->|"uses basket"| node_basketapi
node_mobile -.->|"browses catalog"| node_catalog
node_mobile -.->|"submits orders"| node_orderingapi
node_hybrid -.->|"loads products"| node_catalog
node_basketapi -.->|"stores baskets"| node_basketstore
node_mobilebff -.->|"aggregates catalog"| node_catalog
node_orderingapi -.->|"handles commands"| node_orderdomain
node_orderingapi -.->|"persists orders"| node_orderdb
node_orderdomain -.->|"raises order event"| node_orderingapi
node_orderingapi -.->|"records events"| node_eventlog
node_orderingapi -.->|"publishes events"| node_eventbus
node_orderprocessor -->|"queries submitted orders"| node_orderdb
node_orderprocessor -->|"publishes confirmation"| node_eventbus
node_payment -->|"subscribes to events"| node_eventbus
node_eventbus -.->|"dispatches handlers"| node_orderingapi
node_webhookapi -->|"retrieves subscriptions"| node_webhookdb
node_webhookapi -.->|"handles integration events"| node_eventbus
node_webhookapi -.->|"delivers notifications"| node_webhookclient

click node_webapp "https://github.com/azure-samples/eshoponazure/tree/main/src/WebApp"
click node_mobile "https://github.com/azure-samples/eshoponazure/tree/main/src/ClientApp"
click node_hybrid "https://github.com/azure-samples/eshoponazure/tree/main/src/HybridApp"
click node_catalog "https://github.com/azure-samples/eshoponazure/tree/main/src/Catalog.API"
click node_catalogai "https://github.com/azure-samples/eshoponazure/blob/main/src/Catalog.API/Services/CatalogAI.cs"
click node_basketapi "https://github.com/azure-samples/eshoponazure/tree/main/src/Basket.API"
click node_basketstore "https://github.com/azure-samples/eshoponazure/blob/main/src/Basket.API/Repositories/RedisBasketRepository.cs"
click node_mobilebff "https://github.com/azure-samples/eshoponazure/tree/main/src/Mobile.Bff.Shopping"
click node_orderingapi "https://github.com/azure-samples/eshoponazure/tree/main/src/Ordering.API"
click node_orderdomain "https://github.com/azure-samples/eshoponazure/tree/main/src/Ordering.Domain"
click node_orderdb "https://github.com/azure-samples/eshoponazure/blob/main/src/Ordering.Infrastructure/OrderingContext.cs"
click node_orderprocessor "https://github.com/azure-samples/eshoponazure/blob/main/src/OrderProcessor/Services/GracePeriodManagerService.cs"
click node_payment "https://github.com/azure-samples/eshoponazure/tree/main/src/PaymentProcessor"
click node_eventbus "https://github.com/azure-samples/eshoponazure/blob/main/src/EventBusServiceBus/ServiceBusEventBus.cs"
click node_eventlog "https://github.com/azure-samples/eshoponazure/blob/main/src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs"
click node_webhookapi "https://github.com/azure-samples/eshoponazure/tree/main/src/Webhooks.API"
click node_webhookdb "https://github.com/azure-samples/eshoponazure/blob/main/src/Webhooks.API/Infrastructure/WebhooksContext.cs"
click node_webhookclient "https://github.com/azure-samples/eshoponazure/tree/main/src/WebhookClient"

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_webapp,node_mobile,node_hybrid toneBlue
class node_catalog,node_catalogai,node_basketapi,node_basketstore,node_mobilebff toneAmber
class node_orderingapi,node_orderdomain,node_orderdb,node_orderprocessor,node_payment toneMint
class node_eventbus,node_eventlog toneRose
class node_webhookapi,node_webhookdb,node_webhookclient,node_shopper toneIndigo
```

## Components

### User applications

- [Web storefront](https://github.com/azure-samples/eshoponazure/tree/main/src/WebApp): `src/WebApp`
- [Mobile app](https://github.com/azure-samples/eshoponazure/tree/main/src/ClientApp): `src/ClientApp`
- [Hybrid app](https://github.com/azure-samples/eshoponazure/tree/main/src/HybridApp): `src/HybridApp`

### Commerce services

- [Catalog service](https://github.com/azure-samples/eshoponazure/tree/main/src/Catalog.API): `src/Catalog.API`
- [Catalog AI](https://github.com/azure-samples/eshoponazure/blob/main/src/Catalog.API/Services/CatalogAI.cs): `src/Catalog.API/Services/CatalogAI.cs`
- [Basket service](https://github.com/azure-samples/eshoponazure/tree/main/src/Basket.API): `src/Basket.API`
- [Basket Redis store](https://github.com/azure-samples/eshoponazure/blob/main/src/Basket.API/Repositories/RedisBasketRepository.cs): `src/Basket.API/Repositories/RedisBasketRepository.cs`
- [Mobile BFF](https://github.com/azure-samples/eshoponazure/tree/main/src/Mobile.Bff.Shopping): `src/Mobile.Bff.Shopping`

### Order processing

- [Ordering API](https://github.com/azure-samples/eshoponazure/tree/main/src/Ordering.API): `src/Ordering.API`
- [Order domain](https://github.com/azure-samples/eshoponazure/tree/main/src/Ordering.Domain): `src/Ordering.Domain`
- [Ordering database](https://github.com/azure-samples/eshoponazure/blob/main/src/Ordering.Infrastructure/OrderingContext.cs): `src/Ordering.Infrastructure/OrderingContext.cs`
- [Grace period worker](https://github.com/azure-samples/eshoponazure/blob/main/src/OrderProcessor/Services/GracePeriodManagerService.cs): `src/OrderProcessor/Services/GracePeriodManagerService.cs`
- [Payment processor](https://github.com/azure-samples/eshoponazure/tree/main/src/PaymentProcessor): `src/PaymentProcessor`

### Events and messaging

- [Event bus](https://github.com/azure-samples/eshoponazure/blob/main/src/EventBusServiceBus/ServiceBusEventBus.cs): `src/EventBusServiceBus/ServiceBusEventBus.cs`
- [Integration event log](https://github.com/azure-samples/eshoponazure/blob/main/src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs): `src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs`

### Webhook delivery

- [Webhook service](https://github.com/azure-samples/eshoponazure/tree/main/src/Webhooks.API): `src/Webhooks.API`
- [Webhook subscriptions](https://github.com/azure-samples/eshoponazure/blob/main/src/Webhooks.API/Infrastructure/WebhooksContext.cs): `src/Webhooks.API/Infrastructure/WebhooksContext.cs`
- [Webhook client](https://github.com/azure-samples/eshoponazure/tree/main/src/WebhookClient): `src/WebhookClient`

### Other components

- **Shopper**

## Connections

- Shopper → Web storefront: uses storefront (evidence: `README.md`)
- Web storefront → Catalog service: browses catalog
- Web storefront → Basket service: manages basket
- Web storefront → Ordering API: places orders (evidence: `src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`)
- Mobile app → Basket service: uses basket
- Mobile app → Catalog service: browses catalog
- Mobile app → Ordering API: submits orders
- Hybrid app → Catalog service: loads products
- Basket service → Basket Redis store: stores baskets
- Mobile BFF → Catalog service: aggregates catalog
- Ordering API → Order domain: handles commands (evidence: `src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`)
- Ordering API → Ordering database: persists orders
- Order domain → Ordering API: raises order event (evidence: `src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`)
- Ordering API → Integration event log: records events
- Ordering API → Event bus: publishes events
- Grace period worker → Ordering database: queries submitted orders (evidence: `src/OrderProcessor/Services/GracePeriodManagerService.cs`)
- Grace period worker → Event bus: publishes confirmation (evidence: `src/OrderProcessor/Services/GracePeriodManagerService.cs`)
- Payment processor → Event bus: subscribes to events (evidence: `src/PaymentProcessor/Program.cs`)
- Event bus → Ordering API: dispatches handlers
- Webhook service → Webhook subscriptions: retrieves subscriptions (evidence: `src/Webhooks.API/Services/WebhooksRetriever.cs`)
- Webhook service → Event bus: handles integration events
- Webhook service → Webhook client: delivers notifications
