# ak4m410x01/ecommerceapi architecture

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

- Interactive diagram: https://gitdiagram.com/ak4m410x01/ecommerceapi
- Repository: https://github.com/ak4m410x01/ecommerceapi

## Overview

E-Commerce API is an ASP.NET Core store backend. Clients call its API for authentication and product catalog operations; catalog queries use application handlers, repository abstractions, and persistence, while authentication delegates identity, token, and email work to infrastructure services. The README also advertises cart, order, and payment capabilities, but the supplied tree contains no corresponding implementation paths, so they are noted as unimplemented or unverified rather than modeled as runtime components. Relationships involving unsampled controllers are left unverified.

Main entry points: [`ECommerceAPI.Presentation/Controllers`](https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Presentation/Controllers) (HTTP API), [`ECommerceAPI.Application/Features/Product`](https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Application/Features/Product) (Catalog queries), [`ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs`](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs) (Authentication service), [`ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs`](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs) (Unit of work)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["API presentation"]
  node_api["HTTP API<br/>[Controllers]"]
  node_authcontroller["Authentication routes"]
  node_catalogcontrollers["Catalog routes<br/>[Product]"]
end

subgraph group_application["Application workflows"]
  node_authworkflow["Authentication workflow<br/>[Authentication]"]
  node_catalogqueries["Catalog queries<br/>[Product]"]
  node_profilequery["Profile lookup"]
  node_validation["Request validation"]
  node_catalogdomain["Product domain<br/>[Product.cs]"]
end

subgraph group_identity["Identity services"]
  node_authservice["Authentication service"]
  node_tokenservice["Token service<br/>[TokenService.cs]"]
  node_mailservice["Mail service<br/>[MailService.cs]"]
end

subgraph group_persistence["Data persistence"]
  node_repository["Repository abstraction<br/>[IBaseRepository.cs]"]
  node_unitwork["Unit of work<br/>[UnitOfWork.cs]"]
  node_dbcontext[("Application database")]
end

node_client(("API client"))
node_sqlserver[("SQL Server")]
node_cart["Cart capability"]
node_orders["Order capability"]
node_payments["Payment capability"]

node_client -->|"sends requests"| node_api
node_api -.->|"routes requests"| node_authcontroller
node_api -.->|"routes requests"| node_catalogcontrollers
node_authcontroller -.->|"dispatches commands"| node_authworkflow
node_catalogcontrollers -.->|"dispatches queries"| node_catalogqueries
node_catalogqueries -->|"queries through"| node_repository
node_catalogqueries -->|"uses"| node_unitwork
node_unitwork -->|"implements"| node_repository
node_unitwork -->|"uses"| node_dbcontext
node_authworkflow -.->|"delegates to"| node_authservice
node_authservice -->|"generates tokens"| node_tokenservice
node_authservice -->|"sends email"| node_mailservice
node_profilequery -->|"reads authorization header"| node_api
node_dbcontext -.->|"persists data"| node_sqlserver
node_client -.->|"uses advertised feature"| node_cart
node_client -.->|"uses advertised feature"| node_orders
node_client -.->|"uses advertised feature"| node_payments

click node_api "https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Presentation/Controllers"
click node_authcontroller "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Presentation/Controllers/User/Authentication/AuthenticationController.cs"
click node_catalogcontrollers "https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Presentation/Controllers/Product"
click node_authworkflow "https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Application/Features/User/Authentication"
click node_catalogqueries "https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Application/Features/Product"
click node_profilequery "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Application/Features/User/Profiles/Queries/GetProfileByUserAccessToken/Handlers/GetProfileByUserAccessTokenQueryHandler.cs"
click node_validation "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Application/Behaviors/Validations/ValidationPipelineBehavior.cs"
click node_authservice "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs"
click node_tokenservice "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Authentication/TokenService.cs"
click node_mailservice "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Mail/MailService.cs"
click node_catalogdomain "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Domain/Entities/Products/Product.cs"
click node_repository "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Application/Interfaces/Repositories/Base/IBaseRepository.cs"
click node_unitwork "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs"
click node_dbcontext "https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Persistence/DbContexts/ApplicationDbContext.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_api,node_authcontroller,node_catalogcontrollers,node_client toneBlue
class node_authworkflow,node_catalogqueries,node_profilequery,node_validation,node_catalogdomain,node_sqlserver toneAmber
class node_authservice,node_tokenservice,node_mailservice toneMint
class node_repository,node_unitwork,node_dbcontext toneRose
class node_cart,node_orders,node_payments toneIndigo
```

## Components

### API presentation

- [HTTP API](https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Presentation/Controllers): `ECommerceAPI.Presentation/Controllers`
- [Authentication routes](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Presentation/Controllers/User/Authentication/AuthenticationController.cs): `ECommerceAPI.Presentation/Controllers/User/Authentication/AuthenticationController.cs`
- [Catalog routes](https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Presentation/Controllers/Product): `ECommerceAPI.Presentation/Controllers/Product`

### Application workflows

- [Authentication workflow](https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Application/Features/User/Authentication): `ECommerceAPI.Application/Features/User/Authentication`
- [Catalog queries](https://github.com/ak4m410x01/ecommerceapi/tree/main/ECommerceAPI.Application/Features/Product): `ECommerceAPI.Application/Features/Product`
- [Profile lookup](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Application/Features/User/Profiles/Queries/GetProfileByUserAccessToken/Handlers/GetProfileByUserAccessTokenQueryHandler.cs): `ECommerceAPI.Application/Features/User/Profiles/Queries/GetProfileByUserAccessToken/Handlers/GetProfileByUserAccessTokenQueryHandler.cs`
- [Request validation](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Application/Behaviors/Validations/ValidationPipelineBehavior.cs): `ECommerceAPI.Application/Behaviors/Validations/ValidationPipelineBehavior.cs`
- [Product domain](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Domain/Entities/Products/Product.cs): `ECommerceAPI.Domain/Entities/Products/Product.cs`

### Identity services

- [Authentication service](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs): `ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs`
- [Token service](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Authentication/TokenService.cs): `ECommerceAPI.Infrastructure/Services/Authentication/TokenService.cs`
- [Mail service](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Infrastructure/Services/Mail/MailService.cs): `ECommerceAPI.Infrastructure/Services/Mail/MailService.cs`

### Data persistence

- [Repository abstraction](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Application/Interfaces/Repositories/Base/IBaseRepository.cs): `ECommerceAPI.Application/Interfaces/Repositories/Base/IBaseRepository.cs`
- [Unit of work](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs): `ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs`
- [Application database](https://github.com/ak4m410x01/ecommerceapi/blob/main/ECommerceAPI.Persistence/DbContexts/ApplicationDbContext.cs): `ECommerceAPI.Persistence/DbContexts/ApplicationDbContext.cs`

### Other components

- **API client**
- **SQL Server**
- **Cart capability**
- **Order capability**
- **Payment capability**

## Connections

- API client → HTTP API: sends requests (evidence: `README.md`)
- HTTP API → Authentication routes: routes requests (evidence: `ECommerceAPI.Presentation/Controllers/User/Authentication/AuthenticationController.cs`)
- HTTP API → Catalog routes: routes requests (evidence: `ECommerceAPI.Presentation/Controllers/Product/Inventories/InventoriesController.cs`)
- Authentication routes → Authentication workflow: dispatches commands (evidence: `ECommerceAPI.Presentation/Controllers/User/Authentication/AuthenticationController.cs`)
- Catalog routes → Catalog queries: dispatches queries (evidence: `ECommerceAPI.Presentation/Controllers/Product/Inventories/InventoriesController.cs`)
- Catalog queries → Repository abstraction: queries through (evidence: `ECommerceAPI.Application/Features/Product/Categories/Queries/GetAllCategories/Handlers/GetAllCategoriesQueryHandler.cs`)
- Catalog queries → Unit of work: uses (evidence: `ECommerceAPI.Application/Features/Product/Categories/Queries/GetAllCategories/Handlers/GetAllCategoriesQueryHandler.cs`)
- Unit of work → Repository abstraction: implements (evidence: `ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs`)
- Unit of work → Application database: uses (evidence: `ECommerceAPI.Persistence/UnitOfWork/UnitOfWork.cs`)
- Authentication workflow → Authentication service: delegates to
- Authentication service → Token service: generates tokens (evidence: `ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs`)
- Authentication service → Mail service: sends email (evidence: `ECommerceAPI.Infrastructure/Services/Authentication/AuthenticationService.cs`)
- Profile lookup → HTTP API: reads authorization header (evidence: `ECommerceAPI.Application/Features/User/Profiles/Queries/GetProfileByUserAccessToken/Handlers/GetProfileByUserAccessTokenQueryHandler.cs`)
- Application database → SQL Server: persists data (evidence: `README.md`)
- API client → Cart capability: uses advertised feature (evidence: `README.md`)
- API client → Order capability: uses advertised feature (evidence: `README.md`)
- API client → Payment capability: uses advertised feature (evidence: `README.md`)
