# microsoftlearning/eshoponweb architecture

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

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

## Overview

eShopOnWeb is a single-process ASP.NET Core reference storefront. Customers browse the catalog, manage a basket, check out, and review orders; identity supports sign-in and account management. A separate PublicApi serves catalog operations used by the browser-based Blazor admin. The graph preserves those product areas and the core persistence and token layers. Some links are evidenced by the README or SOURCE INDEX references; unsampled endpoint and storefront internals are not expanded into speculative call chains.

Main entry points: [`src/Infrastructure/Data/EfRepository.cs`](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs) (EF Repository), [`src/PublicApi/Program.cs`](https://github.com/microsoftlearning/eshoponweb/blob/main/src/PublicApi/Program.cs) (Public API Host), [`src/BlazorAdmin/Services/CatalogItemService.cs`](https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs) (Catalog Admin Service), [`src/Web/Program.cs`](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Program.cs) (Web App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_web["Web App<br/>[Program.cs]"]
  node_catalog_view["Catalog Views"]
  node_identity_web["Account Management"]
end

subgraph group_commerce["Commerce"]
  node_basket_ui["Basket UI<br/>[Index.cshtml.cs]"]
  node_checkout["Checkout<br/>[Checkout.cshtml.cs]"]
  node_order_history["Order Queries"]
  node_order_details["Order Details"]
end

subgraph group_admin["Catalog Admin"]
  node_admin_ui["Blazor Admin<br/>[Program.cs]"]
  node_admin_catalog["Catalog Admin Service"]
  node_admin_cache["Catalog Cache"]
  node_http_client["API HTTP Client<br/>[HttpService.cs]"]
  node_toast["Toast Notifications<br/>[ToastService.cs]"]
end

subgraph group_api["Public API"]
  node_auth_api["Token Login"]
  node_api["Catalog Endpoints"]
  node_api_host["Public API Host<br/>[Program.cs]"]
end

subgraph group_core["Application Core"]
  node_basket_service["Basket Service<br/>[BasketService.cs]"]
  node_order_service["Order Service<br/>[OrderService.cs]"]
  node_catalog_core["Catalog Domain<br/>[CatalogItem.cs]"]
  node_order_domain["Order Aggregate<br/>[Order.cs]"]
end

subgraph group_infra["Infrastructure"]
  node_token_service["Token Claims"]
  node_repository["EF Repository<br/>[EfRepository.cs]"]
  node_basket_query["Basket Query"]
  node_catalog_db[("Catalog Database<br/>[CatalogContext.cs]")]
  node_identity_db[("Identity Database")]
  node_identity_user["Application User<br/>[ApplicationUser.cs]"]
end

node_shopper(("Shopper"))
node_admin_api(("Catalog API"))

node_shopper -->|"browses and shops"| node_web
node_web -.->|"serves catalog"| node_catalog_view
node_web -.->|"serves basket"| node_basket_ui
node_basket_ui -.->|"manages basket"| node_basket_service
node_checkout -.->|"creates order"| node_order_service
node_shopper -.->|"checks out"| node_checkout
node_shopper -.->|"views orders"| node_order_history
node_order_history -->|"queries orders"| node_repository
node_order_details -->|"queries order"| node_repository
node_order_service -->|"creates orders"| node_order_domain
node_order_service -->|"persists orders"| node_repository
node_basket_service -->|"persists baskets"| node_repository
node_identity_web -->|"manages account"| node_identity_user
node_auth_api -->|"requests token"| node_token_service
node_token_service -->|"looks up user"| node_identity_user
node_admin_ui -->|"registers services"| node_admin_catalog
node_admin_catalog -->|"sends requests"| node_http_client
node_admin_cache -->|"caches results"| node_admin_catalog
node_admin_catalog -->|"calls over HTTP"| node_api
node_http_client -->|"sends HTTP"| node_admin_api
node_http_client -->|"shows errors"| node_toast
node_admin_api -->|"served by"| node_api_host
node_api_host -->|"configures context"| node_catalog_db
node_api_host -->|"configures identity"| node_identity_db
node_repository -->|"uses context"| node_catalog_db
node_basket_query -->|"queries context"| node_catalog_db
node_repository -.->|"stores aggregates"| node_catalog_core
node_repository -.->|"stores aggregate"| node_order_domain
node_api_host -->|"registers service"| node_token_service

click node_web "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Program.cs"
click node_catalog_view "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Services/CatalogViewModelService.cs"
click node_basket_ui "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Pages/Basket/Index.cshtml.cs"
click node_checkout "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs"
click node_basket_service "https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Services/BasketService.cs"
click node_order_service "https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Services/OrderService.cs"
click node_order_history "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Features/MyOrders/GetMyOrdersHandler.cs"
click node_order_details "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Features/OrderDetails/GetOrderDetailsHandler.cs"
click node_identity_web "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Controllers/ManageController.cs"
click node_auth_api "https://github.com/microsoftlearning/eshoponweb/blob/main/src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs"
click node_token_service "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.cs"
click node_admin_ui "https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Program.cs"
click node_admin_catalog "https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs"
click node_admin_cache "https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs"
click node_http_client "https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/HttpService.cs"
click node_toast "https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/ToastService.cs"
click node_api "https://github.com/microsoftlearning/eshoponweb/tree/main/src/PublicApi/CatalogItemEndpoints"
click node_api_host "https://github.com/microsoftlearning/eshoponweb/blob/main/src/PublicApi/Program.cs"
click node_catalog_core "https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Entities/CatalogItem.cs"
click node_order_domain "https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Entities/OrderAggregate/Order.cs"
click node_repository "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs"
click node_basket_query "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/Queries/BasketQueryService.cs"
click node_catalog_db "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs"
click node_identity_db "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Identity/AppIdentityDbContext.cs"
click node_identity_user "https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Identity/ApplicationUser.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_view,node_identity_web toneBlue
class node_basket_ui,node_checkout,node_order_history,node_order_details toneAmber
class node_admin_ui,node_admin_catalog,node_admin_cache,node_http_client,node_toast,node_admin_api toneMint
class node_auth_api,node_api,node_api_host toneRose
class node_basket_service,node_order_service,node_catalog_core,node_order_domain,node_shopper toneIndigo
class node_token_service,node_repository,node_basket_query,node_catalog_db,node_identity_db,node_identity_user toneTeal
```

## Components

### Storefront

- [Web App](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Program.cs): `src/Web/Program.cs`
- [Catalog Views](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Services/CatalogViewModelService.cs): `src/Web/Services/CatalogViewModelService.cs`
- [Account Management](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Controllers/ManageController.cs): `src/Web/Controllers/ManageController.cs`

### Commerce

- [Basket UI](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Pages/Basket/Index.cshtml.cs): `src/Web/Pages/Basket/Index.cshtml.cs`
- [Checkout](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs): `src/Web/Pages/Basket/Checkout.cshtml.cs`
- [Order Queries](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Features/MyOrders/GetMyOrdersHandler.cs): `src/Web/Features/MyOrders/GetMyOrdersHandler.cs`
- [Order Details](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Web/Features/OrderDetails/GetOrderDetailsHandler.cs): `src/Web/Features/OrderDetails/GetOrderDetailsHandler.cs`

### Catalog Admin

- [Blazor Admin](https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Program.cs): `src/BlazorAdmin/Program.cs`
- [Catalog Admin Service](https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs): `src/BlazorAdmin/Services/CatalogItemService.cs`
- [Catalog Cache](https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs): `src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs`
- [API HTTP Client](https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/HttpService.cs): `src/BlazorAdmin/Services/HttpService.cs`
- [Toast Notifications](https://github.com/microsoftlearning/eshoponweb/blob/main/src/BlazorAdmin/Services/ToastService.cs): `src/BlazorAdmin/Services/ToastService.cs`

### Public API

- [Token Login](https://github.com/microsoftlearning/eshoponweb/blob/main/src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs): `src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs`
- [Catalog Endpoints](https://github.com/microsoftlearning/eshoponweb/tree/main/src/PublicApi/CatalogItemEndpoints): `src/PublicApi/CatalogItemEndpoints`
- [Public API Host](https://github.com/microsoftlearning/eshoponweb/blob/main/src/PublicApi/Program.cs): `src/PublicApi/Program.cs`

### Application Core

- [Basket Service](https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Services/BasketService.cs): `src/ApplicationCore/Services/BasketService.cs`
- [Order Service](https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Services/OrderService.cs): `src/ApplicationCore/Services/OrderService.cs`
- [Catalog Domain](https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Entities/CatalogItem.cs): `src/ApplicationCore/Entities/CatalogItem.cs`
- [Order Aggregate](https://github.com/microsoftlearning/eshoponweb/blob/main/src/ApplicationCore/Entities/OrderAggregate/Order.cs): `src/ApplicationCore/Entities/OrderAggregate/Order.cs`

### Infrastructure

- [Token Claims](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.cs): `src/Infrastructure/Identity/IdentityTokenClaimService.cs`
- [EF Repository](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs): `src/Infrastructure/Data/EfRepository.cs`
- [Basket Query](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/Queries/BasketQueryService.cs): `src/Infrastructure/Data/Queries/BasketQueryService.cs`
- [Catalog Database](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs): `src/Infrastructure/Data/CatalogContext.cs`
- [Identity Database](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Identity/AppIdentityDbContext.cs): `src/Infrastructure/Identity/AppIdentityDbContext.cs`
- [Application User](https://github.com/microsoftlearning/eshoponweb/blob/main/src/Infrastructure/Identity/ApplicationUser.cs): `src/Infrastructure/Identity/ApplicationUser.cs`

### Other components

- **Shopper**
- **Catalog API**

## Connections

- Shopper → Web App: browses and shops (evidence: `README.md`)
- Web App → Catalog Views: serves catalog
- Web App → Basket UI: serves basket
- Basket UI → Basket Service: manages basket
- Checkout → Order Service: creates order
- Shopper → Checkout: checks out
- Shopper → Order Queries: views orders
- Order Queries → EF Repository: queries orders (evidence: `src/Web/Features/MyOrders/GetMyOrdersHandler.cs`)
- Order Details → EF Repository: queries order (evidence: `src/Web/Features/OrderDetails/GetOrderDetailsHandler.cs`)
- Order Service → Order Aggregate: creates orders (evidence: `src/ApplicationCore/Services/OrderService.cs`)
- Order Service → EF Repository: persists orders (evidence: `src/ApplicationCore/Services/OrderService.cs`)
- Basket Service → EF Repository: persists baskets (evidence: `src/ApplicationCore/Services/BasketService.cs`)
- Account Management → Application User: manages account (evidence: `src/Web/Controllers/ManageController.cs`)
- Token Login → Token Claims: requests token (evidence: `src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs`)
- Token Claims → Application User: looks up user (evidence: `src/Infrastructure/Identity/IdentityTokenClaimService.cs`)
- Blazor Admin → Catalog Admin Service: registers services (evidence: `src/BlazorAdmin/Program.cs`)
- Catalog Admin Service → API HTTP Client: sends requests (evidence: `src/BlazorAdmin/Services/CatalogItemService.cs`)
- Catalog Cache → Catalog Admin Service: caches results (evidence: `src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs`)
- Catalog Admin Service → Catalog Endpoints: calls over HTTP (evidence: `README.md`)
- API HTTP Client → Catalog API: sends HTTP (evidence: `README.md`)
- API HTTP Client → Toast Notifications: shows errors (evidence: `src/BlazorAdmin/Services/HttpService.cs`)
- Catalog API → Public API Host: served by (evidence: `README.md`)
- Public API Host → Catalog Database: configures context (evidence: `src/PublicApi/Program.cs`)
- Public API Host → Identity Database: configures identity (evidence: `src/PublicApi/Program.cs`)
- EF Repository → Catalog Database: uses context (evidence: `src/Infrastructure/Data/EfRepository.cs`)
- Basket Query → Catalog Database: queries context (evidence: `src/Infrastructure/Data/Queries/BasketQueryService.cs`)
- EF Repository → Catalog Domain: stores aggregates
- EF Repository → Order Aggregate: stores aggregate
- Public API Host → Token Claims: registers service (evidence: `src/PublicApi/Program.cs`)
