# dotnet-architecture/eshoponweb architecture

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

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

## Overview

eShopOnWeb is a single-process ASP.NET Core store with a server-rendered storefront, a separate catalog PublicApi, and a Blazor WebAssembly admin client. Shoppers browse the catalog, manage a basket, check out, and view orders; users can also register and sign in. Admins use the browser client to manage catalog items through the API. The graph reflects the sampled service and startup code plus documented capabilities; several endpoint and order-handler implementations were not sampled, so uncertain internal calls are omitted.

Main entry points: [`src/Infrastructure/Data/CatalogContext.cs`](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs) (Catalog database), [`src/Web/Program.cs`](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Program.cs) (Web application), [`src/Infrastructure/Data/EfRepository.cs`](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs) (EF repository), [`src/Web/Pages/Basket/Checkout.cshtml.cs`](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs) (Basket and checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_web["Web application<br/>[Program.cs]"]
  node_catalog_views["Catalog browsing"]
  node_basket_pages["Basket and checkout<br/>[Checkout.cshtml.cs]"]
  node_basket_vm["Basket service adapter"]
  node_orders["Order pages<br/>[OrderController.cs]"]
  node_order_queries["Order queries"]
  node_identity_pages["Account management<br/>[Login.cshtml.cs]"]
  node_user_controller["User and token API<br/>[UserController.cs]"]
end

subgraph group_domain["Application Core"]
  node_basket_service["Basket operations<br/>[BasketService.cs]"]
  node_order_service["Order operations<br/>[OrderService.cs]"]
  node_catalog_entities["Store entities<br/>[CatalogItem.cs]"]
  node_basket_entities["Basket entities<br/>[Basket.cs]"]
  node_order_entities["Order entities<br/>[Order.cs]"]
  node_token_service["JWT claims service"]
end

subgraph group_data["Persistence"]
  node_catalog_db[("Catalog database<br/>[CatalogContext.cs]")]
  node_identity_db[("Identity database")]
  node_repository["EF repository<br/>[EfRepository.cs]"]
  node_basket_query["Basket count query"]
end

subgraph group_api["Catalog API"]
  node_public_api["Public API<br/>[Program.cs]"]
  node_catalog_endpoints["Catalog endpoints"]
  node_auth_endpoint["Authentication endpoint"]
end

subgraph group_admin["Admin Client"]
  node_admin_client["Blazor admin<br/>[Program.cs]"]
  node_admin_catalog["Catalog editing client"]
  node_http_service["HTTP client service<br/>[HttpService.cs]"]
end

node_shopper(("Shopper"))
node_admin_user(("Catalog administrator"))

node_shopper -->|"uses"| node_web
node_web -->|"serves pages"| node_catalog_views
node_web -->|"serves checkout"| node_basket_pages
node_web -->|"serves accounts"| node_identity_pages
node_shopper -->|"views orders"| node_orders
node_orders -->|"dispatches queries"| node_order_queries
node_basket_pages -->|"uses"| node_basket_vm
node_basket_vm -->|"calls"| node_basket_service
node_basket_pages -->|"checks out"| node_order_service
node_basket_service -->|"reads and writes"| node_repository
node_order_service -->|"reads and writes"| node_repository
node_order_queries -->|"queries"| node_repository
node_repository -->|"persists"| node_catalog_db
node_basket_query -->|"counts from"| node_catalog_db
node_catalog_db -->|"stores"| node_catalog_entities
node_catalog_db -->|"stores"| node_basket_entities
node_catalog_db -->|"stores"| node_order_entities
node_identity_pages -->|"manages identity"| node_identity_db
node_user_controller -->|"requests token"| node_token_service
node_token_service -->|"looks up users"| node_identity_db
node_shopper -->|"requests token"| node_user_controller
node_admin_user -->|"uses"| node_admin_client
node_admin_client -->|"uses"| node_admin_catalog
node_admin_catalog -->|"sends requests"| node_http_service
node_http_service -->|"calls"| node_public_api
node_public_api -->|"maps routes"| node_catalog_endpoints
node_public_api -->|"maps routes"| node_auth_endpoint

click node_web "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Program.cs"
click node_catalog_views "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Services/CatalogViewModelService.cs"
click node_basket_pages "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs"
click node_basket_vm "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Services/BasketViewModelService.cs"
click node_orders "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Controllers/OrderController.cs"
click node_order_queries "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Features/MyOrders/GetMyOrdersHandler.cs"
click node_identity_pages "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Areas/Identity/Pages/Account/Login.cshtml.cs"
click node_user_controller "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Controllers/UserController.cs"
click node_basket_service "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Services/BasketService.cs"
click node_order_service "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Services/OrderService.cs"
click node_catalog_entities "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Entities/CatalogItem.cs"
click node_basket_entities "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Entities/BasketAggregate/Basket.cs"
click node_order_entities "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Entities/OrderAggregate/Order.cs"
click node_catalog_db "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs"
click node_identity_db "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Identity/AppIdentityDbContext.cs"
click node_repository "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs"
click node_basket_query "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/Queries/BasketQueryService.cs"
click node_public_api "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/PublicApi/Program.cs"
click node_catalog_endpoints "https://github.com/dotnet-architecture/eshoponweb/tree/main/src/PublicApi/CatalogItemEndpoints"
click node_auth_endpoint "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs"
click node_admin_client "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/BlazorAdmin/Program.cs"
click node_admin_catalog "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs"
click node_http_service "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/BlazorAdmin/Services/HttpService.cs"
click node_token_service "https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.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_web,node_catalog_views,node_basket_pages,node_basket_vm,node_orders,node_order_queries,node_identity_pages,node_user_controller toneBlue
class node_basket_service,node_order_service,node_catalog_entities,node_basket_entities,node_order_entities,node_token_service toneAmber
class node_catalog_db,node_identity_db,node_repository,node_basket_query toneMint
class node_public_api,node_catalog_endpoints,node_auth_endpoint toneRose
class node_admin_client,node_admin_catalog,node_http_service,node_shopper,node_admin_user toneIndigo
```

## Components

### Storefront

- [Web application](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Program.cs): `src/Web/Program.cs`
- [Catalog browsing](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Services/CatalogViewModelService.cs): `src/Web/Services/CatalogViewModelService.cs`
- [Basket and checkout](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs): `src/Web/Pages/Basket/Checkout.cshtml.cs`
- [Basket service adapter](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Services/BasketViewModelService.cs): `src/Web/Services/BasketViewModelService.cs`
- [Order pages](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Controllers/OrderController.cs): `src/Web/Controllers/OrderController.cs`
- [Order queries](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Features/MyOrders/GetMyOrdersHandler.cs): `src/Web/Features/MyOrders/GetMyOrdersHandler.cs`
- [Account management](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Areas/Identity/Pages/Account/Login.cshtml.cs): `src/Web/Areas/Identity/Pages/Account/Login.cshtml.cs`
- [User and token API](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Web/Controllers/UserController.cs): `src/Web/Controllers/UserController.cs`

### Application Core

- [Basket operations](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Services/BasketService.cs): `src/ApplicationCore/Services/BasketService.cs`
- [Order operations](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Services/OrderService.cs): `src/ApplicationCore/Services/OrderService.cs`
- [Store entities](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Entities/CatalogItem.cs): `src/ApplicationCore/Entities/CatalogItem.cs`
- [Basket entities](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Entities/BasketAggregate/Basket.cs): `src/ApplicationCore/Entities/BasketAggregate/Basket.cs`
- [Order entities](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/ApplicationCore/Entities/OrderAggregate/Order.cs): `src/ApplicationCore/Entities/OrderAggregate/Order.cs`
- [JWT claims service](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.cs): `src/Infrastructure/Identity/IdentityTokenClaimService.cs`

### Persistence

- [Catalog database](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs): `src/Infrastructure/Data/CatalogContext.cs`
- [Identity database](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Identity/AppIdentityDbContext.cs): `src/Infrastructure/Identity/AppIdentityDbContext.cs`
- [EF repository](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs): `src/Infrastructure/Data/EfRepository.cs`
- [Basket count query](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/Infrastructure/Data/Queries/BasketQueryService.cs): `src/Infrastructure/Data/Queries/BasketQueryService.cs`

### Catalog API

- [Public API](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/PublicApi/Program.cs): `src/PublicApi/Program.cs`
- [Catalog endpoints](https://github.com/dotnet-architecture/eshoponweb/tree/main/src/PublicApi/CatalogItemEndpoints): `src/PublicApi/CatalogItemEndpoints`
- [Authentication endpoint](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs): `src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs`

### Admin Client

- [Blazor admin](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/BlazorAdmin/Program.cs): `src/BlazorAdmin/Program.cs`
- [Catalog editing client](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs): `src/BlazorAdmin/Services/CatalogItemService.cs`
- [HTTP client service](https://github.com/dotnet-architecture/eshoponweb/blob/main/src/BlazorAdmin/Services/HttpService.cs): `src/BlazorAdmin/Services/HttpService.cs`

### Other components

- **Shopper**
- **Catalog administrator**

## Connections

- Shopper → Web application: uses
- Web application → Catalog browsing: serves pages
- Web application → Basket and checkout: serves checkout
- Web application → Account management: serves accounts
- Shopper → Order pages: views orders
- Order pages → Order queries: dispatches queries
- Basket and checkout → Basket service adapter: uses
- Basket service adapter → Basket operations: calls
- Basket and checkout → Order operations: checks out
- Basket operations → EF repository: reads and writes
- Order operations → EF repository: reads and writes
- Order queries → EF repository: queries
- EF repository → Catalog database: persists
- Basket count query → Catalog database: counts from
- Catalog database → Store entities: stores
- Catalog database → Basket entities: stores
- Catalog database → Order entities: stores
- Account management → Identity database: manages identity
- User and token API → JWT claims service: requests token
- JWT claims service → Identity database: looks up users
- Shopper → User and token API: requests token
- Catalog administrator → Blazor admin: uses
- Blazor admin → Catalog editing client: uses
- Catalog editing client → HTTP client service: sends requests
- HTTP client service → Public API: calls
- Public API → Catalog endpoints: maps routes
- Public API → Authentication endpoint: maps routes
