# gustavidal/tcc-rh architecture

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

- Interactive diagram: https://gitdiagram.com/gustavidal/tcc-rh
- Repository: https://github.com/gustavidal/tcc-rh

## Overview

Colabore is a workforce-management application with an Express API and a React dashboard. Users authenticate, access protected screens and resource endpoints, manage employees and their organizational data, and use goal, competency, time-tracking, and indicator features. The backend’s documented resource pattern separates routes, controllers, services, and Knex-backed DAOs; account, action, and indicator workflows have dedicated controllers. The tree also shows dashboard and collaborator views, but their API wiring was not sampled. Relationships below follow explicit imports or the README’s documented architecture.

Main entry points: [`routes/routes_colabore.js`](https://github.com/gustavidal/tcc-rh/blob/main/routes/routes_colabore.js) (API routes), [`utils/procedure.js`](https://github.com/gustavidal/tcc-rh/blob/main/utils/procedure.js) (Procedure helper), [`view/projeto/src/App.jsx`](https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/App.jsx) (Dashboard shell), [`controllers/controller_indicadores.js`](https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_indicadores.js) (Indicators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_app_ui["Dashboard shell<br/>[App.jsx]"]
  node_dashboard["Dashboard view<br/>[index.jsx]"]
  node_collaborators_ui["Collaborator views<br/>[index.jsx]"]
end

subgraph group_api["API and access"]
  node_api_routes["API routes<br/>[routes_colabore.js]"]
  node_auth["Authentication<br/>[autenticacao.js]"]
  node_authorization["Authorization<br/>[autorizacao.js]"]
  node_accounts["Account workflows"]
  node_actions["Composite actions"]
  node_screens["Screen queries"]
end

subgraph group_workforce["Workforce records"]
  node_resource_routes["Resource endpoints"]
  node_resource_controllers["Resource controllers"]
  node_resource_services["Resource services"]
  node_workforce_data["Employee records"]
end

subgraph group_performance["Goals and indicators"]
  node_indicators["Indicators"]
  node_performance_services["Performance services"]
  node_performance_data["Goals and metrics"]
end

subgraph group_data["Persistence"]
  node_procedure_helper["Procedure helper<br/>[procedure.js]"]
  node_knex["Knex connection<br/>[global_knex.js]"]
  node_database[("MySQL database")]
end

node_user(("User"))

node_user -.->|"uses"| node_app_ui
node_app_ui -.->|"renders"| node_dashboard
node_app_ui -.->|"renders"| node_collaborators_ui
node_user -->|"requests"| node_api_routes
node_api_routes -->|"checks identity"| node_auth
node_api_routes -->|"checks access"| node_authorization
node_api_routes -->|"routes account"| node_accounts
node_api_routes -->|"routes actions"| node_actions
node_api_routes -->|"routes screens"| node_screens
node_api_routes -->|"routes indicators"| node_indicators
node_api_routes -->|"mounts resources"| node_resource_routes
node_resource_routes -->|"dispatches to"| node_resource_controllers
node_resource_controllers -->|"calls services"| node_resource_services
node_resource_services -.->|"calls DAOs"| node_workforce_data
node_accounts -->|"executes procedures"| node_procedure_helper
node_indicators -->|"calls services"| node_performance_services
node_indicators -->|"executes procedures"| node_procedure_helper
node_actions -->|"executes procedures"| node_procedure_helper
node_performance_services -.->|"uses metric DAOs"| node_performance_data
node_workforce_data -.->|"executes procedures"| node_procedure_helper
node_procedure_helper -.->|"uses connection"| node_knex
node_knex -.->|"queries"| node_database

click node_app_ui "https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/App.jsx"
click node_dashboard "https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/pages/Dashboard/index.jsx"
click node_collaborators_ui "https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/pages/Colaboradores/index.jsx"
click node_api_routes "https://github.com/gustavidal/tcc-rh/blob/main/routes/routes_colabore.js"
click node_auth "https://github.com/gustavidal/tcc-rh/blob/main/middleware/autenticacao.js"
click node_authorization "https://github.com/gustavidal/tcc-rh/blob/main/middleware/autorizacao.js"
click node_accounts "https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_conta.js"
click node_actions "https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_acoes.js"
click node_screens "https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_colabore.js"
click node_resource_routes "https://github.com/gustavidal/tcc-rh/tree/main/routes"
click node_resource_controllers "https://github.com/gustavidal/tcc-rh/tree/main/controllers"
click node_resource_services "https://github.com/gustavidal/tcc-rh/tree/main/services"
click node_workforce_data "https://github.com/gustavidal/tcc-rh/tree/main/models/DAO"
click node_indicators "https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_indicadores.js"
click node_performance_services "https://github.com/gustavidal/tcc-rh/tree/main/services"
click node_performance_data "https://github.com/gustavidal/tcc-rh/tree/main/models/DAO"
click node_procedure_helper "https://github.com/gustavidal/tcc-rh/blob/main/utils/procedure.js"
click node_knex "https://github.com/gustavidal/tcc-rh/blob/main/models/global_knex/global_knex.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_ui,node_dashboard,node_collaborators_ui,node_user toneBlue
class node_api_routes,node_auth,node_authorization,node_accounts,node_actions,node_screens toneAmber
class node_resource_routes,node_resource_controllers,node_resource_services,node_workforce_data toneMint
class node_indicators,node_performance_services,node_performance_data toneRose
class node_procedure_helper,node_knex,node_database toneIndigo
```

## Components

### Web interface

- [Dashboard shell](https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/App.jsx): `view/projeto/src/App.jsx`
- [Dashboard view](https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/pages/Dashboard/index.jsx): `view/projeto/src/pages/Dashboard/index.jsx`
- [Collaborator views](https://github.com/gustavidal/tcc-rh/blob/main/view/projeto/src/pages/Colaboradores/index.jsx): `view/projeto/src/pages/Colaboradores/index.jsx`

### API and access

- [API routes](https://github.com/gustavidal/tcc-rh/blob/main/routes/routes_colabore.js): `routes/routes_colabore.js`
- [Authentication](https://github.com/gustavidal/tcc-rh/blob/main/middleware/autenticacao.js): `middleware/autenticacao.js`
- [Authorization](https://github.com/gustavidal/tcc-rh/blob/main/middleware/autorizacao.js): `middleware/autorizacao.js`
- [Account workflows](https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_conta.js): `controllers/controller_conta.js`
- [Composite actions](https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_acoes.js): `controllers/controller_acoes.js`
- [Screen queries](https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_colabore.js): `controllers/controller_colabore.js`

### Workforce records

- [Resource endpoints](https://github.com/gustavidal/tcc-rh/tree/main/routes): `routes`
- [Resource controllers](https://github.com/gustavidal/tcc-rh/tree/main/controllers): `controllers`
- [Resource services](https://github.com/gustavidal/tcc-rh/tree/main/services): `services`
- [Employee records](https://github.com/gustavidal/tcc-rh/tree/main/models/DAO): `models/DAO`

### Goals and indicators

- [Indicators](https://github.com/gustavidal/tcc-rh/blob/main/controllers/controller_indicadores.js): `controllers/controller_indicadores.js`
- [Performance services](https://github.com/gustavidal/tcc-rh/tree/main/services): `services`
- [Goals and metrics](https://github.com/gustavidal/tcc-rh/tree/main/models/DAO): `models/DAO`

### Persistence

- [Procedure helper](https://github.com/gustavidal/tcc-rh/blob/main/utils/procedure.js): `utils/procedure.js`
- [Knex connection](https://github.com/gustavidal/tcc-rh/blob/main/models/global_knex/global_knex.js): `models/global_knex/global_knex.js`
- **MySQL database**

### Other components

- **User**

## Connections

- User → Dashboard shell: uses
- Dashboard shell → Dashboard view: renders
- Dashboard shell → Collaborator views: renders
- User → API routes: requests (evidence: `routes/routes_colabore.js`)
- API routes → Authentication: checks identity (evidence: `routes/routes_colabore.js`)
- API routes → Authorization: checks access (evidence: `routes/routes_colabore.js`)
- API routes → Account workflows: routes account (evidence: `routes/routes_colabore.js`)
- API routes → Composite actions: routes actions (evidence: `routes/routes_colabore.js`)
- API routes → Screen queries: routes screens (evidence: `routes/routes_colabore.js`)
- API routes → Indicators: routes indicators (evidence: `routes/routes_colabore.js`)
- API routes → Resource endpoints: mounts resources (evidence: `routes/routes_colabore.js`)
- Resource endpoints → Resource controllers: dispatches to (evidence: `routes/departamento.router.js`)
- Resource controllers → Resource services: calls services (evidence: `controllers/departamento/controller_departamento.js`)
- Resource services → Employee records: calls DAOs (evidence: `services/meta_organizacional_funcionario/service_meta_organizacional_funcionario.js`)
- Account workflows → Procedure helper: executes procedures (evidence: `controllers/controller_conta.js`)
- Indicators → Performance services: calls services (evidence: `controllers/controller_indicadores.js`)
- Indicators → Procedure helper: executes procedures (evidence: `controllers/controller_indicadores.js`)
- Composite actions → Procedure helper: executes procedures (evidence: `controllers/controller_acoes.js`)
- Performance services → Goals and metrics: uses metric DAOs (evidence: `services/meta_organizacional_funcionario/service_meta_organizacional_funcionario.js`)
- Employee records → Procedure helper: executes procedures
- Procedure helper → Knex connection: uses connection
- Knex connection → MySQL database: queries
