# itschrisedu/nexora_back architecture

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

- Interactive diagram: https://gitdiagram.com/itschrisedu/nexora_back
- Repository: https://github.com/itschrisedu/nexora_back

## Overview

NEXORA is a NestJS commerce-lifecycle and credit-scoring backend for footwear retailers. Staff use authenticated APIs to manage customers, inventory, suppliers, and orders; order operations progress through preparation, dispatch, and delivery, with finance, credit, and notifications supporting the lifecycle. Reporting, POS/catalog, invoicing, configuration, and ML integration are additional capabilities indicated by the module tree. The excerpts confirm selected controller-to-query/command calls and direct Prisma access; wiring among unsampled contexts is therefore not inferred.

Main entry points: [`src/shared/infrastructure/prisma/prisma.service.ts`](https://github.com/itschrisedu/nexora_back/blob/main/src/shared/infrastructure/prisma/prisma.service.ts) (Persistence access), [`src/bounded-contexts/comercial/infrastructure/pedidos.controller.ts`](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/infrastructure/pedidos.controller.ts) (Order lifecycle), [`src/bounded-contexts/clientes/infrastructure/clientes.controller.ts`](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/clientes/infrastructure/clientes.controller.ts) (Customer CRM and credit), [`src/bounded-contexts/clientes/application/queries/ClientesQueryService.ts`](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/clientes/application/queries/ClientesQueryService.ts) (Customer queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Platform"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_tenant["Tenant management"]
  node_config["Business configuration"]
end

subgraph group_commerce["Commerce Operations"]
  node_customers["Customer CRM and credit"]
  node_customerqueries["Customer queries"]
  node_orders["Order lifecycle"]
  node_ordercommands["Order commands"]
  node_catalog["Catalog and POS<br/>[CatalogoService.ts]"]
end

subgraph group_supply["Supply and Inventory"]
  node_inventory["Inventory operations"]
  node_inventoryqueries["Inventory queries"]
  node_suppliers["Supplier purchasing"]
  node_supplierqueries["Supplier queries"]
end

subgraph group_business["Business Services"]
  node_finance["Financial operations"]
  node_financequeries["Financial queries"]
  node_invoicing["SRI invoicing"]
  node_reports["Operational reports<br/>[ReportesService.ts]"]
  node_notifications["Notifications"]
  node_ml["ML integration<br/>[MlBridgeService.ts]"]
end

subgraph group_shared["Shared Infrastructure"]
  node_prisma["Persistence access<br/>[prisma.service.ts]"]
  node_database[("PostgreSQL")]
  node_email["Email delivery"]
end

node_staff(("Retail staff"))

node_staff -->|"authenticates"| node_auth
node_staff -->|"manages clients"| node_customers
node_staff -->|"manages orders"| node_orders
node_staff -->|"manages stock"| node_inventory
node_staff -->|"manages purchasing"| node_suppliers
node_staff -->|"manages finances"| node_finance
node_staff -->|"configures business"| node_config
node_customers -->|"queries"| node_customerqueries
node_orders -->|"dispatches commands"| node_ordercommands
node_orders -->|"reads orders"| node_prisma
node_inventory -->|"queries"| node_inventoryqueries
node_suppliers -->|"queries"| node_supplierqueries
node_finance -->|"queries"| node_financequeries
node_customerqueries -->|"queries data"| node_prisma
node_inventoryqueries -->|"queries stock"| node_prisma
node_supplierqueries -->|"queries purchasing"| node_prisma
node_financequeries -->|"queries finance"| node_prisma
node_prisma -->|"persists data"| node_database
node_notifications -->|"sends email"| node_email

click node_auth "https://github.com/itschrisedu/nexora_back/blob/main/src/auth/auth.service.ts"
click node_tenant "https://github.com/itschrisedu/nexora_back/blob/main/src/auth/tenant.controller.ts"
click node_config "https://github.com/itschrisedu/nexora_back/blob/main/src/configuracion/configuracion.controller.ts"
click node_customers "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/clientes/infrastructure/clientes.controller.ts"
click node_customerqueries "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/clientes/application/queries/ClientesQueryService.ts"
click node_orders "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/infrastructure/pedidos.controller.ts"
click node_ordercommands "https://github.com/itschrisedu/nexora_back/tree/main/src/bounded-contexts/comercial/application/commands"
click node_catalog "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/application/CatalogoService.ts"
click node_inventory "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/inventario/infrastructure/inventario.controller.ts"
click node_inventoryqueries "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/inventario/application/queries/InventarioQueryService.ts"
click node_suppliers "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/proveedores/infrastructure/proveedores.controller.ts"
click node_supplierqueries "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/proveedores/application/queries/ProveedoresQueryService.ts"
click node_finance "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/financiero/infrastructure/financiero.controller.ts"
click node_financequeries "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/financiero/application/queries/FinancieroQueryService.ts"
click node_invoicing "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/facturacion-sri/application/FacturacionSriService.ts"
click node_reports "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/reportes/application/ReportesService.ts"
click node_notifications "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/notificaciones/application/NotificacionService.ts"
click node_ml "https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/application/MlBridgeService.ts"
click node_prisma "https://github.com/itschrisedu/nexora_back/blob/main/src/shared/infrastructure/prisma/prisma.service.ts"

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_auth,node_tenant,node_config toneBlue
class node_customers,node_customerqueries,node_orders,node_ordercommands,node_catalog toneAmber
class node_inventory,node_inventoryqueries,node_suppliers,node_supplierqueries toneMint
class node_finance,node_financequeries,node_invoicing,node_reports,node_notifications,node_ml toneRose
class node_prisma,node_database,node_email,node_staff toneIndigo
```

## Components

### Access and Platform

- [Authentication](https://github.com/itschrisedu/nexora_back/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [Tenant management](https://github.com/itschrisedu/nexora_back/blob/main/src/auth/tenant.controller.ts): `src/auth/tenant.controller.ts`
- [Business configuration](https://github.com/itschrisedu/nexora_back/blob/main/src/configuracion/configuracion.controller.ts): `src/configuracion/configuracion.controller.ts`

### Commerce Operations

- [Customer CRM and credit](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/clientes/infrastructure/clientes.controller.ts): `src/bounded-contexts/clientes/infrastructure/clientes.controller.ts`
- [Customer queries](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/clientes/application/queries/ClientesQueryService.ts): `src/bounded-contexts/clientes/application/queries/ClientesQueryService.ts`
- [Order lifecycle](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/infrastructure/pedidos.controller.ts): `src/bounded-contexts/comercial/infrastructure/pedidos.controller.ts`
- [Order commands](https://github.com/itschrisedu/nexora_back/tree/main/src/bounded-contexts/comercial/application/commands): `src/bounded-contexts/comercial/application/commands`
- [Catalog and POS](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/application/CatalogoService.ts): `src/bounded-contexts/comercial/application/CatalogoService.ts`

### Supply and Inventory

- [Inventory operations](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/inventario/infrastructure/inventario.controller.ts): `src/bounded-contexts/inventario/infrastructure/inventario.controller.ts`
- [Inventory queries](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/inventario/application/queries/InventarioQueryService.ts): `src/bounded-contexts/inventario/application/queries/InventarioQueryService.ts`
- [Supplier purchasing](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/proveedores/infrastructure/proveedores.controller.ts): `src/bounded-contexts/proveedores/infrastructure/proveedores.controller.ts`
- [Supplier queries](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/proveedores/application/queries/ProveedoresQueryService.ts): `src/bounded-contexts/proveedores/application/queries/ProveedoresQueryService.ts`

### Business Services

- [Financial operations](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/financiero/infrastructure/financiero.controller.ts): `src/bounded-contexts/financiero/infrastructure/financiero.controller.ts`
- [Financial queries](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/financiero/application/queries/FinancieroQueryService.ts): `src/bounded-contexts/financiero/application/queries/FinancieroQueryService.ts`
- [SRI invoicing](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/facturacion-sri/application/FacturacionSriService.ts): `src/bounded-contexts/facturacion-sri/application/FacturacionSriService.ts`
- [Operational reports](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/reportes/application/ReportesService.ts): `src/bounded-contexts/reportes/application/ReportesService.ts`
- [Notifications](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/notificaciones/application/NotificacionService.ts): `src/bounded-contexts/notificaciones/application/NotificacionService.ts`
- [ML integration](https://github.com/itschrisedu/nexora_back/blob/main/src/bounded-contexts/comercial/application/MlBridgeService.ts): `src/bounded-contexts/comercial/application/MlBridgeService.ts`

### Shared Infrastructure

- [Persistence access](https://github.com/itschrisedu/nexora_back/blob/main/src/shared/infrastructure/prisma/prisma.service.ts): `src/shared/infrastructure/prisma/prisma.service.ts`
- **PostgreSQL**
- **Email delivery**

### Other components

- **Retail staff**

## Connections

- Retail staff → Authentication: authenticates
- Retail staff → Customer CRM and credit: manages clients
- Retail staff → Order lifecycle: manages orders
- Retail staff → Inventory operations: manages stock
- Retail staff → Supplier purchasing: manages purchasing
- Retail staff → Financial operations: manages finances
- Retail staff → Business configuration: configures business
- Customer CRM and credit → Customer queries: queries
- Order lifecycle → Order commands: dispatches commands
- Order lifecycle → Persistence access: reads orders
- Inventory operations → Inventory queries: queries
- Supplier purchasing → Supplier queries: queries
- Financial operations → Financial queries: queries
- Customer queries → Persistence access: queries data
- Inventory queries → Persistence access: queries stock
- Supplier queries → Persistence access: queries purchasing
- Financial queries → Persistence access: queries finance
- Persistence access → PostgreSQL: persists data
- Notifications → Email delivery: sends email
