# wesley-silva/ecommerceenterprise architecture

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

- Interactive diagram: https://gitdiagram.com/wesley-silva/ecommerceenterprise
- Repository: https://github.com/wesley-silva/ecommerceenterprise

## Overview

This is an ASP.NET Core e-commerce application. A shopper authenticates, browses the catalog, manages a cart, and checks out through the MVC web app and Compras BFF; backend services handle customer, order, catalog, and cart responsibilities. The README also describes payment choices, order confirmation, and status tracking, but the provided source does not establish their runtime wiring. Relationships below are limited to shown calls or README-described capabilities; unsampled integrations are not asserted.

Main entry points: [`src/api gatways/ECE.BFF.Compras/Controllers/PedidoController.cs`](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Controllers/PedidoController.cs) (Order orchestration), [`src/services/ECE.Pedido.API/Controllers/PedidoController.cs`](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Controllers/PedidoController.cs) (Order API), [`src/services/ECE.Cliente.API/Controllers/ClienteController.cs`](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Cliente.API/Controllers/ClienteController.cs) (Customer API), [`src/web/ECE.WebApp.MVC/Controllers`](https://github.com/wesley-silva/ecommerceenterprise/tree/main/src/web/ECE.WebApp.MVC/Controllers) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Shopper experience"]
  node_mvc["Web application<br/>[Controllers]"]
  node_web_identity["Web authentication"]
  node_web_checkout["Checkout UI"]
  node_web_services["Web API clients"]
end

subgraph group_commerce["Commerce APIs"]
  node_bff_cart["Cart orchestration"]
  node_bff_order["Order orchestration"]
  node_cart_api["Cart API"]
  node_cart_store[("Cart database<br/>[CarrinhoContext.cs]")]
  node_catalog["Product catalog"]
  node_customer["Customer API"]
  node_customer_store[("Customer database<br/>[ClienteContext.cs]")]
  node_orders["Order API"]
  node_order_domain["Order domain<br/>[Pedido.cs]"]
  node_vouchers["Voucher handling"]
  node_payments["Payment options"]
  node_tracking["Order tracking<br/>[PedidoQueries.cs]"]
end

subgraph group_identity["Identity"]
  node_identity_api["Identity API<br/>[AuthController.cs]"]
  node_identity_store[("Identity database")]
end

subgraph group_shared["Shared infrastructure"]
  node_message_bus["Integration message bus<br/>[MessageBus.cs]"]
  node_mediator["Command and event mediator<br/>[MediatorHandler.cs]"]
  node_webapi_core["API response base<br/>[MainController.cs]"]
  node_response["Response envelope<br/>[ResponseResult.cs]"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_mvc
node_mvc -->|"routes login"| node_web_identity
node_web_identity -->|"authenticates"| node_identity_api
node_identity_api -->|"requests registration"| node_message_bus
node_identity_api -.->|"uses identity"| node_identity_store
node_message_bus -.->|"registration event"| node_customer
node_mvc -->|"starts checkout"| node_web_checkout
node_web_checkout -.->|"submits purchase"| node_web_services
node_web_services -.->|"calls BFF"| node_bff_order
node_bff_order -.->|"reads cart"| node_cart_api
node_bff_order -->|"checks products"| node_catalog
node_bff_order -->|"gets address"| node_customer
node_bff_order -.->|"finalizes order"| node_orders
node_bff_cart -.->|"manages cart"| node_cart_api
node_cart_api -->|"reads and writes"| node_cart_store
node_customer -->|"sends commands"| node_mediator
node_customer -->|"loads address"| node_customer_store
node_customer_store -->|"publishes events"| node_mediator
node_orders -->|"submits command"| node_mediator
node_orders -->|"uses order model"| node_order_domain
node_shopper -->|"browses"| node_catalog
node_shopper -.->|"chooses payment"| node_payments
node_orders -.->|"queries status"| node_tracking
node_shopper -.->|"tracks order"| node_tracking
node_orders -.->|"uses vouchers"| node_vouchers
node_webapi_core -->|"returns response"| node_response

click node_mvc "https://github.com/wesley-silva/ecommerceenterprise/tree/main/src/web/ECE.WebApp.MVC/Controllers"
click node_web_identity "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/web/ECE.WebApp.MVC/Controllers/IdentidadeController.cs"
click node_web_checkout "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/web/ECE.WebApp.MVC/Controllers/PedidoController.cs"
click node_web_services "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/web/ECE.WebApp.MVC/Services/ComprasBffService.cs"
click node_bff_cart "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Controllers/CarrinhoController.cs"
click node_bff_order "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Controllers/PedidoController.cs"
click node_cart_api "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Carrinho.API/Controllers/CarrinhoController.cs"
click node_cart_store "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Carrinho.API/Data/CarrinhoContext.cs"
click node_catalog "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Catalogo.API/Controllers/CatalogoController.cs"
click node_customer "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Cliente.API/Controllers/ClienteController.cs"
click node_customer_store "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Cliente.API/Data/ClienteContext.cs"
click node_orders "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Controllers/PedidoController.cs"
click node_order_domain "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.Domain/Pedidos/Pedido.cs"
click node_vouchers "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Controllers/VoucherController.cs"
click node_payments "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Services/PagamentoService.cs"
click node_tracking "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Application/Queries/PedidoQueries.cs"
click node_identity_api "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Identidade.API/Controllers/AuthController.cs"
click node_identity_store "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Identidade.API/Data/ApplicationDbContext.cs"
click node_message_bus "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.MessageBus/MessageBus.cs"
click node_mediator "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.Core/Mediator/MediatorHandler.cs"
click node_webapi_core "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.WebAPI.Core/Controller/MainController.cs"
click node_response "https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.Core/Comunication/ResponseResult.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_mvc,node_web_identity,node_web_checkout,node_web_services toneBlue
class node_bff_cart,node_bff_order,node_cart_api,node_cart_store,node_catalog,node_customer,node_customer_store,node_orders,node_order_domain,node_vouchers,node_payments,node_tracking toneAmber
class node_identity_api,node_identity_store toneMint
class node_message_bus,node_mediator,node_webapi_core,node_response toneRose
class node_shopper toneIndigo
```

## Components

### Shopper experience

- [Web application](https://github.com/wesley-silva/ecommerceenterprise/tree/main/src/web/ECE.WebApp.MVC/Controllers): `src/web/ECE.WebApp.MVC/Controllers`
- [Web authentication](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/web/ECE.WebApp.MVC/Controllers/IdentidadeController.cs): `src/web/ECE.WebApp.MVC/Controllers/IdentidadeController.cs`
- [Checkout UI](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/web/ECE.WebApp.MVC/Controllers/PedidoController.cs): `src/web/ECE.WebApp.MVC/Controllers/PedidoController.cs`
- [Web API clients](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/web/ECE.WebApp.MVC/Services/ComprasBffService.cs): `src/web/ECE.WebApp.MVC/Services/ComprasBffService.cs`

### Commerce APIs

- [Cart orchestration](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Controllers/CarrinhoController.cs): `src/api gatways/ECE.BFF.Compras/Controllers/CarrinhoController.cs`
- [Order orchestration](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Controllers/PedidoController.cs): `src/api gatways/ECE.BFF.Compras/Controllers/PedidoController.cs`
- [Cart API](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Carrinho.API/Controllers/CarrinhoController.cs): `src/services/ECE.Carrinho.API/Controllers/CarrinhoController.cs`
- [Cart database](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Carrinho.API/Data/CarrinhoContext.cs): `src/services/ECE.Carrinho.API/Data/CarrinhoContext.cs`
- [Product catalog](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Catalogo.API/Controllers/CatalogoController.cs): `src/services/ECE.Catalogo.API/Controllers/CatalogoController.cs`
- [Customer API](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Cliente.API/Controllers/ClienteController.cs): `src/services/ECE.Cliente.API/Controllers/ClienteController.cs`
- [Customer database](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Cliente.API/Data/ClienteContext.cs): `src/services/ECE.Cliente.API/Data/ClienteContext.cs`
- [Order API](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Controllers/PedidoController.cs): `src/services/ECE.Pedido.API/Controllers/PedidoController.cs`
- [Order domain](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.Domain/Pedidos/Pedido.cs): `src/services/ECE.Pedido.Domain/Pedidos/Pedido.cs`
- [Voucher handling](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Controllers/VoucherController.cs): `src/services/ECE.Pedido.API/Controllers/VoucherController.cs`
- [Payment options](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/api%20gatways/ECE.BFF.Compras/Services/PagamentoService.cs): `src/api gatways/ECE.BFF.Compras/Services/PagamentoService.cs`
- [Order tracking](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Pedido.API/Application/Queries/PedidoQueries.cs): `src/services/ECE.Pedido.API/Application/Queries/PedidoQueries.cs`

### Identity

- [Identity API](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Identidade.API/Controllers/AuthController.cs): `src/services/ECE.Identidade.API/Controllers/AuthController.cs`
- [Identity database](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/services/ECE.Identidade.API/Data/ApplicationDbContext.cs): `src/services/ECE.Identidade.API/Data/ApplicationDbContext.cs`

### Shared infrastructure

- [Integration message bus](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.MessageBus/MessageBus.cs): `src/building blocks/ECE.MessageBus/MessageBus.cs`
- [Command and event mediator](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.Core/Mediator/MediatorHandler.cs): `src/building blocks/ECE.Core/Mediator/MediatorHandler.cs`
- [API response base](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.WebAPI.Core/Controller/MainController.cs): `src/building blocks/ECE.WebAPI.Core/Controller/MainController.cs`
- [Response envelope](https://github.com/wesley-silva/ecommerceenterprise/blob/main/src/building%20blocks/ECE.Core/Comunication/ResponseResult.cs): `src/building blocks/ECE.Core/Comunication/ResponseResult.cs`

### Other components

- **Shopper**

## Connections

- Shopper → Web application: uses
- Web application → Web authentication: routes login (evidence: `src/web/ECE.WebApp.MVC/Controllers/IdentidadeController.cs`)
- Web authentication → Identity API: authenticates
- Identity API → Integration message bus: requests registration (evidence: `src/services/ECE.Identidade.API/Controllers/AuthController.cs`)
- Identity API → Identity database: uses identity
- Integration message bus → Customer API: registration event
- Web application → Checkout UI: starts checkout
- Checkout UI → Web API clients: submits purchase
- Web API clients → Order orchestration: calls BFF
- Order orchestration → Cart API: reads cart
- Order orchestration → Product catalog: checks products (evidence: `src/api gatways/ECE.BFF.Compras/Controllers/PedidoController.cs`)
- Order orchestration → Customer API: gets address (evidence: `src/api gatways/ECE.BFF.Compras/Controllers/PedidoController.cs`)
- Order orchestration → Order API: finalizes order
- Cart orchestration → Cart API: manages cart
- Cart API → Cart database: reads and writes (evidence: `src/services/ECE.Carrinho.API/Controllers/CarrinhoController.cs`)
- Customer API → Command and event mediator: sends commands (evidence: `src/services/ECE.Cliente.API/Controllers/ClienteController.cs`)
- Customer API → Customer database: loads address (evidence: `src/services/ECE.Cliente.API/Controllers/ClienteController.cs`)
- Customer database → Command and event mediator: publishes events (evidence: `src/services/ECE.Cliente.API/Data/ClienteContext.cs`)
- Order API → Command and event mediator: submits command (evidence: `src/services/ECE.Pedido.API/Controllers/PedidoController.cs`)
- Order API → Order domain: uses order model (evidence: `src/services/ECE.Pedido.API/Controllers/PedidoController.cs`)
- Shopper → Product catalog: browses
- Shopper → Payment options: chooses payment
- Order API → Order tracking: queries status
- Shopper → Order tracking: tracks order
- Order API → Voucher handling: uses vouchers
- API response base → Response envelope: returns response (evidence: `src/building blocks/ECE.WebAPI.Core/Controller/MainController.cs`)
