# hugotakeda/nexora architecture

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

- Interactive diagram: https://gitdiagram.com/hugotakeda/nexora
- Repository: https://github.com/hugotakeda/nexora

## Overview

NEXORA is a modular ERP with Field Service workflows and product-line variability. The primary web flow loads module and product metadata, then routes users to feature-enabled CRUD screens or the product-line screen; the server exposes these APIs and uses a shared MySQL-backed core. The README documents additional domain capabilities such as quotes, scheduling, technician assignment, service-order completion, payments, imports, and reports. Some implementation details were not sampled, so those relationships are omitted or marked unverified rather than inferred.

Main entry points: [`src/api/servidor.ts`](https://github.com/hugotakeda/nexora/blob/main/src/api/servidor.ts) (HTTP server), [`public/js/app.js`](https://github.com/hugotakeda/nexora/blob/main/public/js/app.js) (Web application), [`public/js/api.js`](https://github.com/hugotakeda/nexora/blob/main/public/js/api.js) (API client), [`src/dominio/OrdemServico.ts`](https://github.com/hugotakeda/nexora/blob/main/src/dominio/OrdemServico.ts) (Service orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Web application<br/>[app.js]"]
  node_crud["CRUD screens<br/>[telaCrud.js]"]
  node_variability_ui["Product-line screen"]
  node_web_api["API client<br/>[api.js]"]
end

subgraph group_api["API and product variation"]
  node_server["HTTP server<br/>[servidor.ts]"]
  node_module_catalog["CRUD module catalog<br/>[index.ts]"]
  node_module_specs["Screen definitions<br/>[clientes.modulo.ts]"]
end

subgraph group_core["Reusable application core"]
  node_product_lines["Product variation<br/>[LinhaProduto.ts]"]
  node_crud_controller["CRUD controller<br/>[ControladorCrud.ts]"]
  node_repository["Generic repository<br/>[RepositorioBase.ts]"]
  node_validation["Field validation<br/>[validacao.ts]"]
  node_db_connection["Database connection pool<br/>[ConexaoBanco.ts]"]
end

subgraph group_operations["Service operations"]
  node_customers["Customer records<br/>[Cliente.ts]"]
  node_quotes["Quotes and pricing<br/>[Orcamento.ts]"]
  node_service_orders["Service orders<br/>[OrdemServico.ts]"]
  node_field_schedule["Technician scheduling<br/>[Agendamento.ts]"]
  node_stock["Inventory<br/>[ItemEstoque.ts]"]
  node_finance["Financial entries"]
end

subgraph group_patterns["Business capabilities"]
  node_dispatch["Technician dispatch"]
  node_completion["Order completion<br/>[FinalizacaoOS.ts]"]
  node_payments["Payment processing"]
  node_reports["Operational reports"]
  node_imports["Customer imports"]
end

node_user(("ERP user"))
node_mysql[("MySQL database")]

node_user -->|"uses"| node_browser
node_browser -->|"loads metadata"| node_web_api
node_browser -->|"routes to"| node_crud
node_browser -->|"routes to"| node_variability_ui
node_crud -->|"requests data"| node_web_api
node_variability_ui -->|"requests variation"| node_web_api
node_web_api -.->|"calls API"| node_server
node_server -->|"loads modules"| node_module_catalog
node_module_catalog -->|"registers screen"| node_module_specs
node_server -->|"resolves features"| node_product_lines
node_server -->|"mounts CRUD"| node_crud_controller
node_server -->|"reads options"| node_repository
node_crud_controller -->|"delegates CRUD"| node_repository
node_repository -->|"queries through"| node_db_connection
node_server -->|"checks connection"| node_db_connection
node_db_connection -->|"queries"| node_mysql
node_module_specs -->|"uses rules"| node_validation
node_quotes -->|"references"| node_customers
node_service_orders -->|"requires approved"| node_quotes
node_field_schedule -.->|"schedules"| node_service_orders
node_dispatch -->|"assigns technician"| node_service_orders
node_completion -->|"finalizes"| node_service_orders
node_completion -->|"records usage"| node_stock
node_completion -->|"creates entry"| node_finance
node_payments -->|"processes payment"| node_finance
node_reports -->|"reports on"| node_finance
node_imports -->|"creates records"| node_customers

click node_browser "https://github.com/hugotakeda/nexora/blob/main/public/js/app.js"
click node_crud "https://github.com/hugotakeda/nexora/blob/main/public/js/telaCrud.js"
click node_variability_ui "https://github.com/hugotakeda/nexora/blob/main/public/js/telaVariabilidade.js"
click node_web_api "https://github.com/hugotakeda/nexora/blob/main/public/js/api.js"
click node_server "https://github.com/hugotakeda/nexora/blob/main/src/api/servidor.ts"
click node_module_catalog "https://github.com/hugotakeda/nexora/blob/main/src/modulos/index.ts"
click node_module_specs "https://github.com/hugotakeda/nexora/blob/main/src/modulos/clientes/clientes.modulo.ts"
click node_product_lines "https://github.com/hugotakeda/nexora/blob/main/src/nucleo/LinhaProduto.ts"
click node_crud_controller "https://github.com/hugotakeda/nexora/blob/main/src/nucleo/ControladorCrud.ts"
click node_repository "https://github.com/hugotakeda/nexora/blob/main/src/nucleo/RepositorioBase.ts"
click node_validation "https://github.com/hugotakeda/nexora/blob/main/src/nucleo/validacao.ts"
click node_db_connection "https://github.com/hugotakeda/nexora/blob/main/src/nucleo/ConexaoBanco.ts"
click node_customers "https://github.com/hugotakeda/nexora/blob/main/src/dominio/Cliente.ts"
click node_quotes "https://github.com/hugotakeda/nexora/blob/main/src/dominio/Orcamento.ts"
click node_service_orders "https://github.com/hugotakeda/nexora/blob/main/src/dominio/OrdemServico.ts"
click node_field_schedule "https://github.com/hugotakeda/nexora/blob/main/src/dominio/Agendamento.ts"
click node_stock "https://github.com/hugotakeda/nexora/blob/main/src/dominio/ItemEstoque.ts"
click node_finance "https://github.com/hugotakeda/nexora/blob/main/src/dominio/LancamentoFinanceiro.ts"
click node_dispatch "https://github.com/hugotakeda/nexora/blob/main/src/padroes/strategy/distribuicao-tecnico/GerenciadorDespacho.ts"
click node_completion "https://github.com/hugotakeda/nexora/blob/main/src/padroes/template-method/finalizacao-os/FinalizacaoOS.ts"
click node_payments "https://github.com/hugotakeda/nexora/blob/main/src/padroes/strategy/pagamento/ProcessadorCobranca.ts"
click node_reports "https://github.com/hugotakeda/nexora/blob/main/src/padroes/template-method/relatorio/RelatorioFinanceiro.ts"
click node_imports "https://github.com/hugotakeda/nexora/blob/main/src/padroes/template-method/importacao/ImportadorClientes.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_browser,node_crud,node_variability_ui,node_web_api,node_user toneBlue
class node_server,node_module_catalog,node_module_specs,node_mysql toneAmber
class node_product_lines,node_crud_controller,node_repository,node_validation,node_db_connection toneMint
class node_customers,node_quotes,node_service_orders,node_field_schedule,node_stock,node_finance toneRose
class node_dispatch,node_completion,node_payments,node_reports,node_imports toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/hugotakeda/nexora/blob/main/public/js/app.js): `public/js/app.js`
- [CRUD screens](https://github.com/hugotakeda/nexora/blob/main/public/js/telaCrud.js): `public/js/telaCrud.js`
- [Product-line screen](https://github.com/hugotakeda/nexora/blob/main/public/js/telaVariabilidade.js): `public/js/telaVariabilidade.js`
- [API client](https://github.com/hugotakeda/nexora/blob/main/public/js/api.js): `public/js/api.js`

### API and product variation

- [HTTP server](https://github.com/hugotakeda/nexora/blob/main/src/api/servidor.ts): `src/api/servidor.ts`
- [CRUD module catalog](https://github.com/hugotakeda/nexora/blob/main/src/modulos/index.ts): `src/modulos/index.ts`
- [Screen definitions](https://github.com/hugotakeda/nexora/blob/main/src/modulos/clientes/clientes.modulo.ts): `src/modulos/clientes/clientes.modulo.ts`

### Reusable application core

- [Product variation](https://github.com/hugotakeda/nexora/blob/main/src/nucleo/LinhaProduto.ts): `src/nucleo/LinhaProduto.ts`
- [CRUD controller](https://github.com/hugotakeda/nexora/blob/main/src/nucleo/ControladorCrud.ts): `src/nucleo/ControladorCrud.ts`
- [Generic repository](https://github.com/hugotakeda/nexora/blob/main/src/nucleo/RepositorioBase.ts): `src/nucleo/RepositorioBase.ts`
- [Field validation](https://github.com/hugotakeda/nexora/blob/main/src/nucleo/validacao.ts): `src/nucleo/validacao.ts`
- [Database connection pool](https://github.com/hugotakeda/nexora/blob/main/src/nucleo/ConexaoBanco.ts): `src/nucleo/ConexaoBanco.ts`

### Service operations

- [Customer records](https://github.com/hugotakeda/nexora/blob/main/src/dominio/Cliente.ts): `src/dominio/Cliente.ts`
- [Quotes and pricing](https://github.com/hugotakeda/nexora/blob/main/src/dominio/Orcamento.ts): `src/dominio/Orcamento.ts`
- [Service orders](https://github.com/hugotakeda/nexora/blob/main/src/dominio/OrdemServico.ts): `src/dominio/OrdemServico.ts`
- [Technician scheduling](https://github.com/hugotakeda/nexora/blob/main/src/dominio/Agendamento.ts): `src/dominio/Agendamento.ts`
- [Inventory](https://github.com/hugotakeda/nexora/blob/main/src/dominio/ItemEstoque.ts): `src/dominio/ItemEstoque.ts`
- [Financial entries](https://github.com/hugotakeda/nexora/blob/main/src/dominio/LancamentoFinanceiro.ts): `src/dominio/LancamentoFinanceiro.ts`

### Business capabilities

- [Technician dispatch](https://github.com/hugotakeda/nexora/blob/main/src/padroes/strategy/distribuicao-tecnico/GerenciadorDespacho.ts): `src/padroes/strategy/distribuicao-tecnico/GerenciadorDespacho.ts`
- [Order completion](https://github.com/hugotakeda/nexora/blob/main/src/padroes/template-method/finalizacao-os/FinalizacaoOS.ts): `src/padroes/template-method/finalizacao-os/FinalizacaoOS.ts`
- [Payment processing](https://github.com/hugotakeda/nexora/blob/main/src/padroes/strategy/pagamento/ProcessadorCobranca.ts): `src/padroes/strategy/pagamento/ProcessadorCobranca.ts`
- [Operational reports](https://github.com/hugotakeda/nexora/blob/main/src/padroes/template-method/relatorio/RelatorioFinanceiro.ts): `src/padroes/template-method/relatorio/RelatorioFinanceiro.ts`
- [Customer imports](https://github.com/hugotakeda/nexora/blob/main/src/padroes/template-method/importacao/ImportadorClientes.ts): `src/padroes/template-method/importacao/ImportadorClientes.ts`

### Other components

- **ERP user**
- **MySQL database**

## Connections

- ERP user → Web application: uses
- Web application → API client: loads metadata (evidence: `public/js/app.js`)
- Web application → CRUD screens: routes to (evidence: `public/js/app.js`)
- Web application → Product-line screen: routes to (evidence: `public/js/app.js`)
- CRUD screens → API client: requests data (evidence: `public/js/telaCrud.js`)
- Product-line screen → API client: requests variation (evidence: `public/js/telaVariabilidade.js`)
- API client → HTTP server: calls API
- HTTP server → CRUD module catalog: loads modules (evidence: `src/api/servidor.ts`)
- CRUD module catalog → Screen definitions: registers screen (evidence: `src/modulos/index.ts`)
- HTTP server → Product variation: resolves features (evidence: `src/api/servidor.ts`)
- HTTP server → CRUD controller: mounts CRUD (evidence: `src/api/servidor.ts`)
- HTTP server → Generic repository: reads options (evidence: `src/api/servidor.ts`)
- CRUD controller → Generic repository: delegates CRUD (evidence: `src/api/servidor.ts`)
- Generic repository → Database connection pool: queries through (evidence: `src/nucleo/RepositorioBase.ts`)
- HTTP server → Database connection pool: checks connection (evidence: `src/api/servidor.ts`)
- Database connection pool → MySQL database: queries (evidence: `src/nucleo/ConexaoBanco.ts`)
- Screen definitions → Field validation: uses rules (evidence: `src/modulos/clientes/clientes.modulo.ts`)
- Quotes and pricing → Customer records: references (evidence: `src/dominio/Orcamento.ts`)
- Service orders → Quotes and pricing: requires approved (evidence: `src/dominio/OrdemServico.ts`)
- Technician scheduling → Service orders: schedules
- Technician dispatch → Service orders: assigns technician (evidence: `src/padroes/strategy/distribuicao-tecnico/GerenciadorDespacho.ts`)
- Order completion → Service orders: finalizes (evidence: `src/padroes/template-method/finalizacao-os/FinalizacaoOS.ts`)
- Order completion → Inventory: records usage (evidence: `src/padroes/template-method/finalizacao-os/FinalizacaoOS.ts`)
- Order completion → Financial entries: creates entry (evidence: `src/padroes/template-method/finalizacao-os/FinalizacaoOS.ts`)
- Payment processing → Financial entries: processes payment (evidence: `src/padroes/strategy/pagamento/ProcessadorCobranca.ts`)
- Operational reports → Financial entries: reports on (evidence: `src/padroes/template-method/relatorio/RelatorioFinanceiro.ts`)
- Customer imports → Customer records: creates records (evidence: `src/padroes/template-method/importacao/ImportadorClientes.ts`)
