# ensiasi/eshoponweb architecture

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

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

## Overview

eShopOnWeb is a single-process ASP.NET Core reference storefront, with a separate PublicApi used by its browser-based Blazor admin. The main user journey is browsing the catalog, managing a basket, and placing and reviewing orders; identity and catalog administration are additional capabilities. The graph shows domain services, persistence, and the admin/API boundary. Source excerpts and the SOURCE INDEX establish several internal calls; where implementation details were not sampled, domain-stage links are left out rather than inferred.

Main entry points: [`src/Infrastructure/Data/EfRepository.cs`](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs) (Repository), [`src/PublicApi/Program.cs`](https://github.com/ensiasi/eshoponweb/blob/main/src/PublicApi/Program.cs) (Public API), [`src/BlazorAdmin/Services/CatalogItemService.cs`](https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs) (Catalog item service), [`src/Infrastructure/Identity/IdentityTokenClaimService.cs`](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.cs) (Token claims)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Storefront"]
  node_webapp["Web application<br/>[Program.cs]"]
  node_storefront["Catalog and basket"]
  node_checkout["Checkout and orders<br/>[Checkout.cshtml.cs]"]
  node_orderqueries["Order queries"]
  node_account["Account management"]
end

subgraph group_core["Application Core"]
  node_catalogdomain["Catalog domain<br/>[CatalogItem.cs]"]
  node_basketservice["Basket service<br/>[BasketService.cs]"]
  node_orderservice["Order service<br/>[OrderService.cs]"]
  node_orderdomain["Order aggregate<br/>[Order.cs]"]
end

subgraph group_infra["Infrastructure"]
  node_repository["Repository<br/>[EfRepository.cs]"]
  node_basketquery["Basket query"]
  node_catalogdb[("Catalog database<br/>[CatalogContext.cs]")]
  node_identitydb[("Identity database")]
  node_tokenclaims["Token claims"]
end

subgraph group_api["Public API"]
  node_publicapi["Public API<br/>[Program.cs]"]
  node_authendpoint["Authentication endpoint"]
  node_catalogendpoints["Catalog endpoints"]
end

subgraph group_admin["Blazor Admin"]
  node_adminui["Admin interface<br/>[List.razor.cs]"]
  node_admincatalog["Catalog item service"]
  node_admincache["Catalog cache"]
  node_httpservice["HTTP client<br/>[HttpService.cs]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses store"| node_webapp
node_adminui -->|"uses API"| node_publicapi
node_basketservice -->|"uses repository"| node_repository
node_orderservice -->|"uses repository"| node_repository
node_orderservice -->|"creates orders"| node_orderdomain
node_repository -->|"uses context"| node_catalogdb
node_basketquery -->|"queries context"| node_catalogdb
node_publicapi -->|"registers repository"| node_repository
node_publicapi -->|"registers service"| node_tokenclaims
node_authendpoint -->|"requests token"| node_tokenclaims
node_tokenclaims -.->|"looks up user"| node_identitydb
node_admincatalog -->|"sends API requests"| node_httpservice
node_admincache -->|"delegates requests"| node_admincatalog
node_admincatalog -.->|"calls catalog API"| node_catalogendpoints

click node_webapp "https://github.com/ensiasi/eshoponweb/blob/main/src/Web/Program.cs"
click node_storefront "https://github.com/ensiasi/eshoponweb/tree/main/src/Web/Pages"
click node_checkout "https://github.com/ensiasi/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs"
click node_orderqueries "https://github.com/ensiasi/eshoponweb/tree/main/src/Web/Features"
click node_account "https://github.com/ensiasi/eshoponweb/blob/main/src/Web/Controllers/ManageController.cs"
click node_catalogdomain "https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Entities/CatalogItem.cs"
click node_basketservice "https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Services/BasketService.cs"
click node_orderservice "https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Services/OrderService.cs"
click node_orderdomain "https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Entities/OrderAggregate/Order.cs"
click node_repository "https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs"
click node_basketquery "https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/Queries/BasketQueryService.cs"
click node_catalogdb "https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs"
click node_identitydb "https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Identity/AppIdentityDbContext.cs"
click node_tokenclaims "https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.cs"
click node_publicapi "https://github.com/ensiasi/eshoponweb/blob/main/src/PublicApi/Program.cs"
click node_authendpoint "https://github.com/ensiasi/eshoponweb/blob/main/src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs"
click node_catalogendpoints "https://github.com/ensiasi/eshoponweb/tree/main/src/PublicApi/CatalogItemEndpoints"
click node_adminui "https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Pages/CatalogItemPage/List.razor.cs"
click node_admincatalog "https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs"
click node_admincache "https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs"
click node_httpservice "https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/HttpService.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_storefront,node_checkout,node_orderqueries,node_account toneBlue
class node_catalogdomain,node_basketservice,node_orderservice,node_orderdomain toneAmber
class node_repository,node_basketquery,node_catalogdb,node_identitydb,node_tokenclaims toneMint
class node_publicapi,node_authendpoint,node_catalogendpoints toneRose
class node_adminui,node_admincatalog,node_admincache,node_httpservice,node_shopper toneIndigo
```

## Components

### Storefront

- [Web application](https://github.com/ensiasi/eshoponweb/blob/main/src/Web/Program.cs): `src/Web/Program.cs`
- [Catalog and basket](https://github.com/ensiasi/eshoponweb/tree/main/src/Web/Pages): `src/Web/Pages`
- [Checkout and orders](https://github.com/ensiasi/eshoponweb/blob/main/src/Web/Pages/Basket/Checkout.cshtml.cs): `src/Web/Pages/Basket/Checkout.cshtml.cs`
- [Order queries](https://github.com/ensiasi/eshoponweb/tree/main/src/Web/Features): `src/Web/Features`
- [Account management](https://github.com/ensiasi/eshoponweb/blob/main/src/Web/Controllers/ManageController.cs): `src/Web/Controllers/ManageController.cs`

### Application Core

- [Catalog domain](https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Entities/CatalogItem.cs): `src/ApplicationCore/Entities/CatalogItem.cs`
- [Basket service](https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Services/BasketService.cs): `src/ApplicationCore/Services/BasketService.cs`
- [Order service](https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Services/OrderService.cs): `src/ApplicationCore/Services/OrderService.cs`
- [Order aggregate](https://github.com/ensiasi/eshoponweb/blob/main/src/ApplicationCore/Entities/OrderAggregate/Order.cs): `src/ApplicationCore/Entities/OrderAggregate/Order.cs`

### Infrastructure

- [Repository](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/EfRepository.cs): `src/Infrastructure/Data/EfRepository.cs`
- [Basket query](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/Queries/BasketQueryService.cs): `src/Infrastructure/Data/Queries/BasketQueryService.cs`
- [Catalog database](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Data/CatalogContext.cs): `src/Infrastructure/Data/CatalogContext.cs`
- [Identity database](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Identity/AppIdentityDbContext.cs): `src/Infrastructure/Identity/AppIdentityDbContext.cs`
- [Token claims](https://github.com/ensiasi/eshoponweb/blob/main/src/Infrastructure/Identity/IdentityTokenClaimService.cs): `src/Infrastructure/Identity/IdentityTokenClaimService.cs`

### Public API

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

### Blazor Admin

- [Admin interface](https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Pages/CatalogItemPage/List.razor.cs): `src/BlazorAdmin/Pages/CatalogItemPage/List.razor.cs`
- [Catalog item service](https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/CatalogItemService.cs): `src/BlazorAdmin/Services/CatalogItemService.cs`
- [Catalog cache](https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs): `src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs`
- [HTTP client](https://github.com/ensiasi/eshoponweb/blob/main/src/BlazorAdmin/Services/HttpService.cs): `src/BlazorAdmin/Services/HttpService.cs`

### Other components

- **Shopper**

## Connections

- Shopper → Web application: browses store (evidence: `README.md`)
- Admin interface → Public API: uses API (evidence: `README.md`)
- Basket service → Repository: uses repository (evidence: `src/ApplicationCore/Services/BasketService.cs`)
- Order service → Repository: uses repository (evidence: `src/ApplicationCore/Services/OrderService.cs`)
- Order service → Order aggregate: creates orders (evidence: `src/ApplicationCore/Services/OrderService.cs`)
- Repository → Catalog database: uses context (evidence: `src/Infrastructure/Data/EfRepository.cs`)
- Basket query → Catalog database: queries context (evidence: `src/Infrastructure/Data/Queries/BasketQueryService.cs`)
- Public API → Repository: registers repository (evidence: `src/PublicApi/Program.cs`)
- Public API → Token claims: registers service (evidence: `src/PublicApi/Program.cs`)
- Authentication endpoint → Token claims: requests token (evidence: `src/PublicApi/AuthEndpoints/AuthenticateEndpoint.cs`)
- Token claims → Identity database: looks up user
- Catalog item service → HTTP client: sends API requests (evidence: `src/BlazorAdmin/Services/CatalogItemService.cs`)
- Catalog cache → Catalog item service: delegates requests (evidence: `src/BlazorAdmin/Services/CachedCatalogItemServiceDecorator.cs`)
- Catalog item service → Catalog endpoints: calls catalog API
