# dotnet/eshop architecture

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

- Interactive diagram: https://gitdiagram.com/dotnet/eshop
- Repository: https://github.com/dotnet/eshop

## Overview

eShop is a services-based e-commerce application with web and MAUI clients, catalog and basket services, identity, ordering, payment and event-driven supporting services. The expected customer journey is browsing products, building a basket and checking out into an order; the tree also shows order-status processing, location, chatbot and webhook capabilities. The sampled evidence supports several internal calls and registrations, but not most client-to-service or cross-service wiring, so those connections are omitted rather than inferred.

Main entry points: [`src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`](https://github.com/dotnet/eshop/blob/main/src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs) (Buyer validation), [`src/ClientApp`](https://github.com/dotnet/eshop/tree/main/src/ClientApp) (MAUI client), [`src/EventBus/Abstractions/IEventBus.cs`](https://github.com/dotnet/eshop/blob/main/src/EventBus/Abstractions/IEventBus.cs) (Event bus), [`src/OrderProcessor/Services/GracePeriodManagerService.cs`](https://github.com/dotnet/eshop/blob/main/src/OrderProcessor/Services/GracePeriodManagerService.cs) (Grace period)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Customer clients"]
  node_webapp["Web application"]
  node_maui["MAUI client"]
  node_location["Location model<br/>[Location.cs]"]
  node_clientorders["Order client<br/>[OrderService.cs]"]
  node_clientbasket["Basket client<br/>[Basket.cs]"]
  node_settings["Client settings"]
end

subgraph group_commerce["Commerce services"]
  node_catalog["Product catalog<br/>[CatalogApi.cs]"]
  node_basket["Basket service<br/>[BasketService.cs]"]
  node_basketstore[("Basket storage")]
  node_ordering["Order API<br/>[OrdersApi.cs]"]
  node_buyer["Buyer validation"]
  node_orderdomain["Order domain<br/>[Order.cs]"]
  node_orderstore[("Ordering context<br/>[OrderingContext.cs]")]
end

subgraph group_identity["Identity"]
  node_identity["Identity service"]
  node_deviceflow["Device authorization"]
end

subgraph group_events["Events and processing"]
  node_eventbus["Event bus<br/>[IEventBus.cs]"]
  node_integrationevent["Integration event"]
  node_graceperiod["Grace period"]
  node_payments["Payment processor<br/>[Program.cs]"]
  node_eventlog[("Event log")]
end

subgraph group_integrations["Webhooks"]
  node_webhooks["Webhook API"]
  node_webhookstore[("Webhook subscriptions<br/>[WebhooksContext.cs]")]
  node_webhookclient["Webhook client"]
end

node_customer(("Customer"))

node_maui -->|"reads"| node_settings
node_maui -->|"updates location"| node_location
node_buyer -->|"saves entities"| node_orderstore
node_buyer -->|"creates"| node_integrationevent
node_buyer -.-> node_eventlog
node_graceperiod -->|"publishes events"| node_eventbus
node_payments -->|"registers subscription"| node_eventbus
node_webhooks -->|"reads subscriptions"| node_webhookstore

click node_webapp "https://github.com/dotnet/eshop/tree/main/src/WebApp"
click node_maui "https://github.com/dotnet/eshop/tree/main/src/ClientApp"
click node_location "https://github.com/dotnet/eshop/blob/main/src/ClientApp/Models/Location/Location.cs"
click node_clientorders "https://github.com/dotnet/eshop/blob/main/src/ClientApp/Services/Order/OrderService.cs"
click node_clientbasket "https://github.com/dotnet/eshop/blob/main/src/ClientApp/Services/Basket/Protos/Basket.cs"
click node_settings "https://github.com/dotnet/eshop/blob/main/src/ClientApp/Services/Settings/ISettingsService.cs"
click node_catalog "https://github.com/dotnet/eshop/blob/main/src/Catalog.API/Apis/CatalogApi.cs"
click node_basket "https://github.com/dotnet/eshop/blob/main/src/Basket.API/Grpc/BasketService.cs"
click node_basketstore "https://github.com/dotnet/eshop/blob/main/src/Basket.API/Repositories/RedisBasketRepository.cs"
click node_ordering "https://github.com/dotnet/eshop/blob/main/src/Ordering.API/Apis/OrdersApi.cs"
click node_buyer "https://github.com/dotnet/eshop/blob/main/src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs"
click node_orderdomain "https://github.com/dotnet/eshop/blob/main/src/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs"
click node_orderstore "https://github.com/dotnet/eshop/blob/main/src/Ordering.Infrastructure/OrderingContext.cs"
click node_identity "https://github.com/dotnet/eshop/blob/main/src/Identity.API/Quickstart/Account/AccountController.cs"
click node_deviceflow "https://github.com/dotnet/eshop/blob/main/src/Identity.API/Quickstart/Device/DeviceController.cs"
click node_eventbus "https://github.com/dotnet/eshop/blob/main/src/EventBus/Abstractions/IEventBus.cs"
click node_integrationevent "https://github.com/dotnet/eshop/blob/main/src/EventBus/Events/IntegrationEvent.cs"
click node_graceperiod "https://github.com/dotnet/eshop/blob/main/src/OrderProcessor/Services/GracePeriodManagerService.cs"
click node_payments "https://github.com/dotnet/eshop/blob/main/src/PaymentProcessor/Program.cs"
click node_eventlog "https://github.com/dotnet/eshop/blob/main/src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs"
click node_webhooks "https://github.com/dotnet/eshop/blob/main/src/Webhooks.API/Services/WebhooksRetriever.cs"
click node_webhookstore "https://github.com/dotnet/eshop/blob/main/src/Webhooks.API/Infrastructure/WebhooksContext.cs"
click node_webhookclient "https://github.com/dotnet/eshop/blob/main/src/WebhookClient/Endpoints/WebhookEndpoints.cs"

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_maui,node_location,node_clientorders,node_clientbasket,node_settings toneBlue
class node_catalog,node_basket,node_basketstore,node_ordering,node_buyer,node_orderdomain,node_orderstore toneAmber
class node_identity,node_deviceflow toneMint
class node_eventbus,node_integrationevent,node_graceperiod,node_payments,node_eventlog toneRose
class node_webhooks,node_webhookstore,node_webhookclient,node_customer toneIndigo
```

## Components

### Customer clients

- [Web application](https://github.com/dotnet/eshop/tree/main/src/WebApp): `src/WebApp`
- [MAUI client](https://github.com/dotnet/eshop/tree/main/src/ClientApp): `src/ClientApp`
- [Location model](https://github.com/dotnet/eshop/blob/main/src/ClientApp/Models/Location/Location.cs): `src/ClientApp/Models/Location/Location.cs`
- [Order client](https://github.com/dotnet/eshop/blob/main/src/ClientApp/Services/Order/OrderService.cs): `src/ClientApp/Services/Order/OrderService.cs`
- [Basket client](https://github.com/dotnet/eshop/blob/main/src/ClientApp/Services/Basket/Protos/Basket.cs): `src/ClientApp/Services/Basket/Protos/Basket.cs`
- [Client settings](https://github.com/dotnet/eshop/blob/main/src/ClientApp/Services/Settings/ISettingsService.cs): `src/ClientApp/Services/Settings/ISettingsService.cs`

### Commerce services

- [Product catalog](https://github.com/dotnet/eshop/blob/main/src/Catalog.API/Apis/CatalogApi.cs): `src/Catalog.API/Apis/CatalogApi.cs`
- [Basket service](https://github.com/dotnet/eshop/blob/main/src/Basket.API/Grpc/BasketService.cs): `src/Basket.API/Grpc/BasketService.cs`
- [Basket storage](https://github.com/dotnet/eshop/blob/main/src/Basket.API/Repositories/RedisBasketRepository.cs): `src/Basket.API/Repositories/RedisBasketRepository.cs`
- [Order API](https://github.com/dotnet/eshop/blob/main/src/Ordering.API/Apis/OrdersApi.cs): `src/Ordering.API/Apis/OrdersApi.cs`
- [Buyer validation](https://github.com/dotnet/eshop/blob/main/src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs): `src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`
- [Order domain](https://github.com/dotnet/eshop/blob/main/src/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs): `src/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs`
- [Ordering context](https://github.com/dotnet/eshop/blob/main/src/Ordering.Infrastructure/OrderingContext.cs): `src/Ordering.Infrastructure/OrderingContext.cs`

### Identity

- [Identity service](https://github.com/dotnet/eshop/blob/main/src/Identity.API/Quickstart/Account/AccountController.cs): `src/Identity.API/Quickstart/Account/AccountController.cs`
- [Device authorization](https://github.com/dotnet/eshop/blob/main/src/Identity.API/Quickstart/Device/DeviceController.cs): `src/Identity.API/Quickstart/Device/DeviceController.cs`

### Events and processing

- [Event bus](https://github.com/dotnet/eshop/blob/main/src/EventBus/Abstractions/IEventBus.cs): `src/EventBus/Abstractions/IEventBus.cs`
- [Integration event](https://github.com/dotnet/eshop/blob/main/src/EventBus/Events/IntegrationEvent.cs): `src/EventBus/Events/IntegrationEvent.cs`
- [Grace period](https://github.com/dotnet/eshop/blob/main/src/OrderProcessor/Services/GracePeriodManagerService.cs): `src/OrderProcessor/Services/GracePeriodManagerService.cs`
- [Payment processor](https://github.com/dotnet/eshop/blob/main/src/PaymentProcessor/Program.cs): `src/PaymentProcessor/Program.cs`
- [Event log](https://github.com/dotnet/eshop/blob/main/src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs): `src/IntegrationEventLogEF/Services/IntegrationEventLogService.cs`

### Webhooks

- [Webhook API](https://github.com/dotnet/eshop/blob/main/src/Webhooks.API/Services/WebhooksRetriever.cs): `src/Webhooks.API/Services/WebhooksRetriever.cs`
- [Webhook subscriptions](https://github.com/dotnet/eshop/blob/main/src/Webhooks.API/Infrastructure/WebhooksContext.cs): `src/Webhooks.API/Infrastructure/WebhooksContext.cs`
- [Webhook client](https://github.com/dotnet/eshop/blob/main/src/WebhookClient/Endpoints/WebhookEndpoints.cs): `src/WebhookClient/Endpoints/WebhookEndpoints.cs`

### Other components

- **Customer**

## Connections

- MAUI client → Client settings: reads (evidence: `src/ClientApp/App.xaml.cs`)
- MAUI client → Location model: updates location (evidence: `src/ClientApp/App.xaml.cs`)
- Buyer validation → Ordering context: saves entities (evidence: `src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`)
- Buyer validation → Integration event: creates (evidence: `src/Ordering.API/Application/DomainEventHandlers/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs`)
- Buyer validation → Event log
- Grace period → Event bus: publishes events (evidence: `src/OrderProcessor/Services/GracePeriodManagerService.cs`)
- Payment processor → Event bus: registers subscription (evidence: `src/PaymentProcessor/Program.cs`)
- Webhook API → Webhook subscriptions: reads subscriptions (evidence: `src/Webhooks.API/Services/WebhooksRetriever.cs`)
