# alexborges000/ecommercehub architecture

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

- Interactive diagram: https://gitdiagram.com/alexborges000/ecommercehub
- Repository: https://github.com/alexborges000/ecommercehub

## Overview

BlazorShop is a Blazor/ASP.NET Core e-commerce application. Its documented user workflow is browsing the product and category catalog, viewing product details, and managing a shopping cart through the Web client and REST API, with data persisted by the API. The tree also shows account, authentication, and address capabilities. Checkout, inventory, purchase history, and administration are documented as in development; their wiring is not established by the sampled source, so they are not represented as implemented flows.

Main entry points: [`BlazorShop.Api/Controllers/CarrinhoCompraController.cs`](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/CarrinhoCompraController.cs) (Cart endpoints), [`BlazorShop.Api/Context/AppDbContext.cs`](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Context/AppDbContext.cs) (SQL database), [`BlazorShop.Models/DTOs`](https://github.com/alexborges000/ecommercehub/tree/stable/BlazorShop.Models/DTOs) (Shared DTOs), [`BlazorShop.Api/Controllers/ProdutosController.cs`](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/ProdutosController.cs) (Product endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_webapp["Blazor application<br/>[Program.cs]"]
  node_webcatalog["Catalog client<br/>[ProdutoService.cs]"]
  node_webcart["Cart client"]
  node_webuser["Account client<br/>[UsuarioService.cs]"]
end

subgraph group_api["REST API"]
  node_api_products["Product endpoints"]
  node_api_cart["Cart endpoints"]
  node_api_users["User endpoints"]
  node_api_address["Address endpoints"]
  node_address_service["Address service<br/>[EnderecoService.cs]"]
end

subgraph group_domain["Commerce data"]
  node_cart_repo["Cart repository"]
  node_product_repo["Product repository"]
  node_address_repo["Address repository"]
  node_db[("SQL database<br/>[AppDbContext.cs]")]
  node_shared_models["Shared DTOs<br/>[DTOs]"]
end

subgraph group_identity["Accounts and security"]
  node_auth_endpoint["Auth endpoints<br/>[AuthController.cs]"]
  node_auth_service["Authentication service<br/>[AuthService.cs]"]
  node_user_service["User services<br/>[Usuarios]"]
  node_user_repo["User repository"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_webapp
node_webcatalog -->|"REST requests"| node_api_products
node_webcart -->|"REST requests"| node_api_cart
node_webuser -->|"REST requests"| node_api_users
node_api_cart -->|"invokes"| node_cart_repo
node_api_cart -->|"looks up products"| node_product_repo
node_cart_repo -->|"reads and writes"| node_db
node_product_repo -->|"reads"| node_db
node_api_users -->|"invokes"| node_user_service
node_user_service -->|"uses"| node_user_repo
node_api_users -->|"address operations"| node_address_service
node_api_address -->|"invokes"| node_address_service
node_address_service -->|"uses"| node_address_repo
node_address_repo -->|"reads and writes"| node_db
node_auth_endpoint -->|"invokes"| node_auth_service
node_auth_service -->|"looks up users"| node_user_repo
node_user_repo -->|"reads and writes"| node_db
node_api_products -->|"catalog access"| node_product_repo
node_api_products -->|"exchanges DTOs"| node_shared_models
node_api_cart -->|"exchanges DTOs"| node_shared_models
node_webcatalog -->|"uses DTOs"| node_shared_models
node_webcart -->|"uses DTOs"| node_shared_models

click node_webapp "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Program.cs"
click node_webcatalog "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Services/ProdutoService.cs"
click node_webcart "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Services/CarrinhoCompraService.cs"
click node_webuser "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Services/UsuarioService.cs"
click node_api_products "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/ProdutosController.cs"
click node_api_cart "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/CarrinhoCompraController.cs"
click node_api_users "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/UsuarioController.cs"
click node_api_address "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/EnderecoController.cs"
click node_auth_endpoint "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/AuthController.cs"
click node_auth_service "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Security/Authentication/AuthService.cs"
click node_user_service "https://github.com/alexborges000/ecommercehub/tree/stable/BlazorShop.Api/Services/Usuarios"
click node_address_service "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Services/Address/EnderecoService.cs"
click node_cart_repo "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/CarrinhoCompraRepository.cs"
click node_product_repo "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/ProdutoRepository.cs"
click node_user_repo "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/UsuarioRepository.cs"
click node_address_repo "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/EnderecoRepository.cs"
click node_db "https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Context/AppDbContext.cs"
click node_shared_models "https://github.com/alexborges000/ecommercehub/tree/stable/BlazorShop.Models/DTOs"

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_webcatalog,node_webcart,node_webuser toneBlue
class node_api_products,node_api_cart,node_api_users,node_api_address,node_address_service toneAmber
class node_cart_repo,node_product_repo,node_address_repo,node_db,node_shared_models toneMint
class node_auth_endpoint,node_auth_service,node_user_service,node_user_repo toneRose
class node_shopper toneIndigo
```

## Components

### Web client

- [Blazor application](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Program.cs): `BlazorShop.Web/Program.cs`
- [Catalog client](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Services/ProdutoService.cs): `BlazorShop.Web/Services/ProdutoService.cs`
- [Cart client](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Services/CarrinhoCompraService.cs): `BlazorShop.Web/Services/CarrinhoCompraService.cs`
- [Account client](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Web/Services/UsuarioService.cs): `BlazorShop.Web/Services/UsuarioService.cs`

### REST API

- [Product endpoints](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/ProdutosController.cs): `BlazorShop.Api/Controllers/ProdutosController.cs`
- [Cart endpoints](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/CarrinhoCompraController.cs): `BlazorShop.Api/Controllers/CarrinhoCompraController.cs`
- [User endpoints](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/UsuarioController.cs): `BlazorShop.Api/Controllers/UsuarioController.cs`
- [Address endpoints](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/EnderecoController.cs): `BlazorShop.Api/Controllers/EnderecoController.cs`
- [Address service](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Services/Address/EnderecoService.cs): `BlazorShop.Api/Services/Address/EnderecoService.cs`

### Commerce data

- [Cart repository](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/CarrinhoCompraRepository.cs): `BlazorShop.Api/Repositories/CarrinhoCompraRepository.cs`
- [Product repository](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/ProdutoRepository.cs): `BlazorShop.Api/Repositories/ProdutoRepository.cs`
- [Address repository](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/EnderecoRepository.cs): `BlazorShop.Api/Repositories/EnderecoRepository.cs`
- [SQL database](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Context/AppDbContext.cs): `BlazorShop.Api/Context/AppDbContext.cs`
- [Shared DTOs](https://github.com/alexborges000/ecommercehub/tree/stable/BlazorShop.Models/DTOs): `BlazorShop.Models/DTOs`

### Accounts and security

- [Auth endpoints](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Controllers/AuthController.cs): `BlazorShop.Api/Controllers/AuthController.cs`
- [Authentication service](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Security/Authentication/AuthService.cs): `BlazorShop.Api/Security/Authentication/AuthService.cs`
- [User services](https://github.com/alexborges000/ecommercehub/tree/stable/BlazorShop.Api/Services/Usuarios): `BlazorShop.Api/Services/Usuarios`
- [User repository](https://github.com/alexborges000/ecommercehub/blob/stable/BlazorShop.Api/Repositories/UsuarioRepository.cs): `BlazorShop.Api/Repositories/UsuarioRepository.cs`

### Other components

- **Shopper**

## Connections

- Shopper → Blazor application: uses
- Catalog client → Product endpoints: REST requests
- Cart client → Cart endpoints: REST requests
- Account client → User endpoints: REST requests
- Cart endpoints → Cart repository: invokes
- Cart endpoints → Product repository: looks up products
- Cart repository → SQL database: reads and writes
- Product repository → SQL database: reads
- User endpoints → User services: invokes
- User services → User repository: uses
- User endpoints → Address service: address operations
- Address endpoints → Address service: invokes
- Address service → Address repository: uses
- Address repository → SQL database: reads and writes
- Auth endpoints → Authentication service: invokes
- Authentication service → User repository: looks up users
- User repository → SQL database: reads and writes
- Product endpoints → Product repository: catalog access
- Product endpoints → Shared DTOs: exchanges DTOs
- Cart endpoints → Shared DTOs: exchanges DTOs
- Catalog client → Shared DTOs: uses DTOs
- Cart client → Shared DTOs: uses DTOs
