# arancibia14/erp-ati-termic-main architecture

> Architecture diagram of the GitHub repository arancibia14/erp-ati-termic-main, 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/arancibia14/erp-ati-termic-main
- Repository: https://github.com/arancibia14/erp-ati-termic-main

## Overview

ERP ATI Termic is a project-operations ERP for administrators and field supervisors. Users sign in, enter role-authorized modules, and manage project execution, purchasing, workforce and safety records, finances, and supporting documents. The React client routes those tasks to a REST backend; controllers implement business operations against Sequelize models backed by MySQL. The README documents the product capabilities and client/backend setup; sampled controller excerpts confirm several workflows, but most module-specific wiring was not sampled, so those links are shown at the documented layer boundaries.

Main entry points: [`client/src/pages`](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages) (ERP modules), [`models`](https://github.com/arancibia14/erp-ati-termic-main/tree/main/models) (Sequelize models), [`routes`](https://github.com/arancibia14/erp-ati-termic-main/tree/main/routes) (REST routes), [`controllers`](https://github.com/arancibia14/erp-ati-termic-main/tree/main/controllers) (Module controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["ERP client"]
  node_app["React application<br/>[App.jsx]"]
  node_pages["ERP modules"]
  node_axios["API client<br/>[axios.js]"]
end

subgraph group_api["API and access"]
  node_server["Express API<br/>[index.js]"]
  node_auth["Auth middleware<br/>[auth.js]"]
  node_routes["REST routes"]
  node_controllers["Module controllers"]
  node_models["Sequelize models"]
  node_database[("MySQL database<br/>[database.js]")]
end

subgraph group_projects["Project operations"]
  node_projects_ui["Project planning"]
  node_project_ops["Project services"]
  node_project_data["Project records"]
end

subgraph group_resources["People and procurement"]
  node_procurement_ui["Materials and purchasing"]
  node_procurement["Procurement services"]
  node_workforce_ui["Workforce and safety"]
  node_workforce["Workforce services"]
  node_workforce_data["People records"]
end

subgraph group_records["Finance and records"]
  node_finance_ui["Costs and budgets"]
  node_finance["Financial services"]
  node_documents_ui["Documents and evidence"]
  node_documents["Document services"]
  node_audit["Audit records<br/>[LogAuditoria.js]"]
end

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

node_user -->|"uses"| node_app
node_app -->|"renders routes"| node_pages
node_pages -->|"requests data"| node_axios
node_axios -->|"calls API"| node_server
node_server -->|"dispatches"| node_routes
node_routes -->|"guards requests"| node_auth
node_routes -->|"dispatches"| node_controllers
node_controllers -->|"reads and writes"| node_models
node_models -->|"uses ORM"| node_database
node_database -->|"connects"| node_mysql
node_pages -->|"includes"| node_projects_ui
node_projects_ui -->|"uses project APIs"| node_project_ops
node_project_ops -->|"reads and writes"| node_project_data
node_pages -->|"includes"| node_procurement_ui
node_procurement_ui -->|"uses purchasing APIs"| node_procurement
node_procurement -->|"reads and writes"| node_models
node_pages -->|"includes"| node_workforce_ui
node_workforce_ui -->|"uses workforce APIs"| node_workforce
node_workforce -->|"reads and writes"| node_workforce_data
node_pages -->|"includes"| node_finance_ui
node_finance_ui -->|"uses finance APIs"| node_finance
node_finance -->|"reads and writes"| node_models
node_pages -->|"includes"| node_documents_ui
node_documents_ui -->|"uses document APIs"| node_documents
node_documents -->|"reads and writes"| node_models
node_controllers -->|"records actions"| node_audit
node_auth -->|"checks sessions"| node_models

click node_app "https://github.com/arancibia14/erp-ati-termic-main/blob/main/client/src/App.jsx"
click node_pages "https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages"
click node_axios "https://github.com/arancibia14/erp-ati-termic-main/blob/main/client/src/api/axios.js"
click node_server "https://github.com/arancibia14/erp-ati-termic-main/blob/main/index.js"
click node_auth "https://github.com/arancibia14/erp-ati-termic-main/blob/main/middleware/auth.js"
click node_routes "https://github.com/arancibia14/erp-ati-termic-main/tree/main/routes"
click node_controllers "https://github.com/arancibia14/erp-ati-termic-main/tree/main/controllers"
click node_projects_ui "https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages"
click node_project_ops "https://github.com/arancibia14/erp-ati-termic-main/tree/main/controllers"
click node_project_data "https://github.com/arancibia14/erp-ati-termic-main/tree/main/models"
click node_procurement_ui "https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages"
click node_procurement "https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/solicitudMaterialController.js"
click node_workforce_ui "https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages"
click node_workforce "https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/entregaEppController.js"
click node_workforce_data "https://github.com/arancibia14/erp-ati-termic-main/tree/main/models"
click node_finance_ui "https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages"
click node_finance "https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/cajaChicaController.js"
click node_documents_ui "https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages"
click node_documents "https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/portafolioController.js"
click node_audit "https://github.com/arancibia14/erp-ati-termic-main/blob/main/models/LogAuditoria.js"
click node_models "https://github.com/arancibia14/erp-ati-termic-main/tree/main/models"
click node_database "https://github.com/arancibia14/erp-ati-termic-main/blob/main/config/database.js"

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_app,node_pages,node_axios,node_user toneBlue
class node_server,node_auth,node_routes,node_controllers,node_models,node_database,node_mysql toneAmber
class node_projects_ui,node_project_ops,node_project_data toneMint
class node_procurement_ui,node_procurement,node_workforce_ui,node_workforce,node_workforce_data toneRose
class node_finance_ui,node_finance,node_documents_ui,node_documents,node_audit toneIndigo
```

## Components

### ERP client

- [React application](https://github.com/arancibia14/erp-ati-termic-main/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [ERP modules](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages): `client/src/pages`
- [API client](https://github.com/arancibia14/erp-ati-termic-main/blob/main/client/src/api/axios.js): `client/src/api/axios.js`

### API and access

- [Express API](https://github.com/arancibia14/erp-ati-termic-main/blob/main/index.js): `index.js`
- [Auth middleware](https://github.com/arancibia14/erp-ati-termic-main/blob/main/middleware/auth.js): `middleware/auth.js`
- [REST routes](https://github.com/arancibia14/erp-ati-termic-main/tree/main/routes): `routes`
- [Module controllers](https://github.com/arancibia14/erp-ati-termic-main/tree/main/controllers): `controllers`
- [Sequelize models](https://github.com/arancibia14/erp-ati-termic-main/tree/main/models): `models`
- [MySQL database](https://github.com/arancibia14/erp-ati-termic-main/blob/main/config/database.js): `config/database.js`

### Project operations

- [Project planning](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages): `client/src/pages`
- [Project services](https://github.com/arancibia14/erp-ati-termic-main/tree/main/controllers): `controllers`
- [Project records](https://github.com/arancibia14/erp-ati-termic-main/tree/main/models): `models`

### People and procurement

- [Materials and purchasing](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages): `client/src/pages`
- [Procurement services](https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/solicitudMaterialController.js): `controllers/solicitudMaterialController.js`
- [Workforce and safety](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages): `client/src/pages`
- [Workforce services](https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/entregaEppController.js): `controllers/entregaEppController.js`
- [People records](https://github.com/arancibia14/erp-ati-termic-main/tree/main/models): `models`

### Finance and records

- [Costs and budgets](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages): `client/src/pages`
- [Financial services](https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/cajaChicaController.js): `controllers/cajaChicaController.js`
- [Documents and evidence](https://github.com/arancibia14/erp-ati-termic-main/tree/main/client/src/pages): `client/src/pages`
- [Document services](https://github.com/arancibia14/erp-ati-termic-main/blob/main/controllers/portafolioController.js): `controllers/portafolioController.js`
- [Audit records](https://github.com/arancibia14/erp-ati-termic-main/blob/main/models/LogAuditoria.js): `models/LogAuditoria.js`

### Other components

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

## Connections

- ERP user → React application: uses
- React application → ERP modules: renders routes
- ERP modules → API client: requests data
- API client → Express API: calls API
- Express API → REST routes: dispatches
- REST routes → Auth middleware: guards requests
- REST routes → Module controllers: dispatches
- Module controllers → Sequelize models: reads and writes
- Sequelize models → MySQL database: uses ORM
- MySQL database → MySQL: connects
- ERP modules → Project planning: includes
- Project planning → Project services: uses project APIs
- Project services → Project records: reads and writes
- ERP modules → Materials and purchasing: includes
- Materials and purchasing → Procurement services: uses purchasing APIs
- Procurement services → Sequelize models: reads and writes
- ERP modules → Workforce and safety: includes
- Workforce and safety → Workforce services: uses workforce APIs
- Workforce services → People records: reads and writes
- ERP modules → Costs and budgets: includes
- Costs and budgets → Financial services: uses finance APIs
- Financial services → Sequelize models: reads and writes
- ERP modules → Documents and evidence: includes
- Documents and evidence → Document services: uses document APIs
- Document services → Sequelize models: reads and writes
- Module controllers → Audit records: records actions
- Auth middleware → Sequelize models: checks sessions
