# alexanderm2122/ecommerce-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/alexanderm2122/ecommerce-frontend
- Repository: https://github.com/alexanderm2122/ecommerce-frontend

## Overview

This is an ASP.NET Core MVC ecommerce frontend that brokers browser workflows to a separate Node.js API backed by MySQL. The main shopper journey is browsing products, managing a cart, confirming a simulated purchase, and viewing the resulting order; the README also documents account login and administration. The graph separates MVC workflow handlers from API clients and the external backend. Edges are limited to calls visible in excerpts or source-index references and to relationships documented by the README; some controllers and service registrations were not sampled.

Main entry points: [`Services/ProductosClientService.cs`](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ProductosClientService.cs) (Product client), [`Services/CategoriasClientService.cs`](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/CategoriasClientService.cs) (Category client), [`Services/ArchivosClientService.cs`](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ArchivosClientService.cs) (File client), [`Controllers/ProductosController.cs`](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ProductosController.cs) (Product management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopper["Shopping workflows"]
  node_buy["Browse catalog"]
  node_cart["Manage cart"]
  node_orders["View orders"]
end

subgraph group_identity["Identity and accounts"]
  node_auth["Account workflows<br/>[AuthController.cs]"]
end

subgraph group_admin["Store administration"]
  node_product_admin["Product management"]
  node_category_admin["Category management"]
  node_file_admin["Image management"]
  node_user_admin["User management"]
  node_audit["Audit log"]
end

subgraph group_integration["API integration"]
  node_product_api["Product client"]
  node_category_api["Category client"]
  node_file_api["File client"]
  node_purchase_api["Purchase client"]
  node_user_api["User client"]
  node_auth_api["Authentication client"]
  node_audit_api["Audit client"]
  node_models["API view models"]
  node_frontend_runtime["MVC runtime<br/>[Program.cs]"]
end

node_shopper(("Shopper"))
node_backend[("Node API and MySQL")]

node_shopper -->|"browses"| node_buy
node_shopper -->|"manages"| node_cart
node_shopper -->|"views"| node_orders
node_shopper -->|"signs in"| node_auth
node_buy -->|"requests products"| node_product_api
node_buy -->|"loads categories"| node_category_api
node_cart -->|"updates cart"| node_purchase_api
node_orders -->|"loads orders"| node_purchase_api
node_product_admin -->|"manages products"| node_product_api
node_product_admin -->|"loads categories"| node_category_api
node_product_admin -->|"loads images"| node_file_api
node_category_admin -->|"manages categories"| node_category_api
node_file_admin -->|"manages images"| node_file_api
node_user_admin -->|"manages users"| node_user_api
node_audit -.->|"requests audit"| node_audit_api
node_auth -->|"sends auth requests"| node_auth_api
node_product_api -->|"adds image content"| node_file_api
node_product_api -->|"sends API requests"| node_backend
node_category_api -->|"sends API requests"| node_backend
node_file_api -->|"sends API requests"| node_backend
node_purchase_api -->|"sends API requests"| node_backend
node_user_api -->|"sends API requests"| node_backend
node_auth_api -->|"sends auth requests"| node_backend
node_backend -.->|"returns API data"| node_models
node_frontend_runtime -->|"validates sessions"| node_auth_api

click node_buy "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ComprarController.cs"
click node_cart "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/CarritoController.cs"
click node_orders "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/PedidosController.cs"
click node_product_admin "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ProductosController.cs"
click node_category_admin "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/CategoriasController.cs"
click node_file_admin "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ArchivosController.cs"
click node_user_admin "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/UsuariosController.cs"
click node_audit "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/BitacoraController.cs"
click node_auth "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/AuthController.cs"
click node_product_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ProductosClientService.cs"
click node_category_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/CategoriasClientService.cs"
click node_file_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ArchivosClientService.cs"
click node_purchase_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ComprasClientService.cs"
click node_user_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/UsuariosClientService.cs"
click node_auth_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/AuthClientService.cs"
click node_audit_api "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/BitacoraClientService.cs"
click node_models "https://github.com/alexanderm2122/ecommerce-frontend/tree/main/Models"
click node_frontend_runtime "https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Program.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_buy,node_cart,node_orders toneBlue
class node_auth,node_backend toneAmber
class node_product_admin,node_category_admin,node_file_admin,node_user_admin,node_audit toneMint
class node_product_api,node_category_api,node_file_api,node_purchase_api,node_user_api,node_auth_api,node_audit_api,node_models,node_frontend_runtime toneRose
class node_shopper toneIndigo
```

## Components

### Shopping workflows

- [Browse catalog](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ComprarController.cs): `Controllers/ComprarController.cs`
- [Manage cart](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/CarritoController.cs): `Controllers/CarritoController.cs`
- [View orders](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/PedidosController.cs): `Controllers/PedidosController.cs`

### Identity and accounts

- [Account workflows](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`

### Store administration

- [Product management](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ProductosController.cs): `Controllers/ProductosController.cs`
- [Category management](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/CategoriasController.cs): `Controllers/CategoriasController.cs`
- [Image management](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/ArchivosController.cs): `Controllers/ArchivosController.cs`
- [User management](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/UsuariosController.cs): `Controllers/UsuariosController.cs`
- [Audit log](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Controllers/BitacoraController.cs): `Controllers/BitacoraController.cs`

### API integration

- [Product client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ProductosClientService.cs): `Services/ProductosClientService.cs`
- [Category client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/CategoriasClientService.cs): `Services/CategoriasClientService.cs`
- [File client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ArchivosClientService.cs): `Services/ArchivosClientService.cs`
- [Purchase client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/ComprasClientService.cs): `Services/ComprasClientService.cs`
- [User client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/UsuariosClientService.cs): `Services/UsuariosClientService.cs`
- [Authentication client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/AuthClientService.cs): `Services/AuthClientService.cs`
- [Audit client](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Services/BitacoraClientService.cs): `Services/BitacoraClientService.cs`
- [API view models](https://github.com/alexanderm2122/ecommerce-frontend/tree/main/Models): `Models`
- [MVC runtime](https://github.com/alexanderm2122/ecommerce-frontend/blob/main/Program.cs): `Program.cs`

### Other components

- **Shopper**
- **Node API and MySQL**

## Connections

- Shopper → Browse catalog: browses
- Shopper → Manage cart: manages
- Shopper → View orders: views
- Shopper → Account workflows: signs in
- Browse catalog → Product client: requests products (evidence: `Controllers/ComprarController.cs`)
- Browse catalog → Category client: loads categories (evidence: `Controllers/ComprarController.cs`)
- Manage cart → Purchase client: updates cart (evidence: `Controllers/CarritoController.cs`)
- View orders → Purchase client: loads orders (evidence: `Controllers/PedidosController.cs`)
- Product management → Product client: manages products (evidence: `Controllers/ProductosController.cs`)
- Product management → Category client: loads categories (evidence: `Controllers/ProductosController.cs`)
- Product management → File client: loads images (evidence: `Controllers/ProductosController.cs`)
- Category management → Category client: manages categories (evidence: `Controllers/CategoriasController.cs`)
- Image management → File client: manages images (evidence: `Controllers/ArchivosController.cs`)
- User management → User client: manages users (evidence: `Controllers/UsuariosController.cs`)
- Audit log → Audit client: requests audit
- Account workflows → Authentication client: sends auth requests (evidence: `Controllers/AuthController.cs`)
- Product client → File client: adds image content (evidence: `Services/ProductosClientService.cs`)
- Product client → Node API and MySQL: sends API requests (evidence: `Services/ProductosClientService.cs`)
- Category client → Node API and MySQL: sends API requests (evidence: `Services/CategoriasClientService.cs`)
- File client → Node API and MySQL: sends API requests (evidence: `Services/ArchivosClientService.cs`)
- Purchase client → Node API and MySQL: sends API requests (evidence: `Services/ComprasClientService.cs`)
- User client → Node API and MySQL: sends API requests (evidence: `Services/UsuariosClientService.cs`)
- Authentication client → Node API and MySQL: sends auth requests (evidence: `Services/AuthClientService.cs`)
- Node API and MySQL → API view models: returns API data
- MVC runtime → Authentication client: validates sessions (evidence: `Program.cs`)
