# joaooo555/ine_sgrh architecture

> Architecture diagram of the GitHub repository joaooo555/ine_sgrh, 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/joaooo555/ine_sgrh
- Repository: https://github.com/joaooo555/ine_sgrh

## Overview

SGRH is an ASP.NET Core MVC human-resources management application backed by Entity Framework Core and SQL Server. The principal evidenced workflow is an authenticated user managing personnel records: the MVC controllers handle requests, HomeController reads and updates employee, contract, document and absence data through AppDbContext, and the context persists it. Other model families indicate recruitment, training, internships, approvals and organizational administration. Authorization checks load profile permissions through AutorizacaoService. Controller excerpts are partial, so links to unsampled capabilities are limited to relationships shown by the source index; no unverified workflow is inferred.

Main entry points: [`SGRH/Controllers/HomeController.cs`](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/HomeController.cs) (HR operations), [`SGRH/Data/AppDbContext.cs`](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Data/AppDbContext.cs) (EF data context), [`SGRH/Services/AutorizacaoService.cs`](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Services/AutorizacaoService.cs) (Authorization service), [`SGRH/Controllers/AdminController.cs`](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/AdminController.cs) (User administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_account["Account access"]
  node_admin["User administration<br/>[AdminController.cs]"]
  node_authorization["Authorization service"]
  node_permissions["Permission filters"]
end

subgraph group_personnel["Personnel management"]
  node_employee["Employee records<br/>[Colaborador.cs]"]
  node_organization["Organizational units<br/>[UnidadeOrganica.cs]"]
  node_employment["Contracts and history<br/>[Contrato.cs]"]
  node_documents["Employee documents<br/>[Documento.cs]"]
  node_hr_controller["HR operations<br/>[HomeController.cs]"]
end

subgraph group_workforce["Workforce processes"]
  node_recruitment["Recruitment<br/>[Candidatura.cs]"]
  node_training["Training<br/>[AccaoFormacao.cs]"]
  node_internships["Internships<br/>[Estagio.cs]"]
  node_approvals["Approval requests<br/>[PedidoAprovacao.cs]"]
end

subgraph group_platform["Persistence and infrastructure"]
  node_dbcontext["EF data context<br/>[AppDbContext.cs]"]
  node_database[("SQL Server")]
end

node_user(("Staff user"))

node_user -->|"signs in"| node_account
node_user -->|"manages HR"| node_hr_controller
node_account -->|"queries users"| node_dbcontext
node_admin -->|"manages users"| node_dbcontext
node_admin -->|"checks access"| node_authorization
node_permissions -->|"checks permissions"| node_authorization
node_hr_controller -->|"loads permissions"| node_authorization
node_hr_controller -->|"reads and writes"| node_dbcontext
node_dbcontext -->|"persists records"| node_database
node_hr_controller -->|"manages records"| node_employee
node_hr_controller -->|"manages contracts"| node_employment
node_hr_controller -->|"stores documents"| node_documents
node_hr_controller -.->|"handles recruitment"| node_recruitment
node_hr_controller -.->|"handles training"| node_training
node_hr_controller -->|"registers interns"| node_internships
node_hr_controller -->|"handles approvals"| node_approvals
node_hr_controller -->|"uses units"| node_organization

click node_account "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/AccountController.cs"
click node_admin "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/AdminController.cs"
click node_authorization "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Services/AutorizacaoService.cs"
click node_permissions "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Authorization/VerificarPermissaoAttribute.cs"
click node_employee "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Colaborador.cs"
click node_organization "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/UnidadeOrganica.cs"
click node_employment "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Contrato.cs"
click node_documents "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Documento.cs"
click node_hr_controller "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/HomeController.cs"
click node_recruitment "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Candidatura.cs"
click node_training "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/AccaoFormacao.cs"
click node_internships "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Estagio.cs"
click node_approvals "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/PedidoAprovacao.cs"
click node_dbcontext "https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Data/AppDbContext.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_account,node_admin,node_authorization,node_permissions,node_user toneBlue
class node_employee,node_organization,node_employment,node_documents,node_hr_controller toneAmber
class node_recruitment,node_training,node_internships,node_approvals toneMint
class node_dbcontext,node_database toneRose
```

## Components

### Access and identity

- [Account access](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/AccountController.cs): `SGRH/Controllers/AccountController.cs`
- [User administration](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/AdminController.cs): `SGRH/Controllers/AdminController.cs`
- [Authorization service](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Services/AutorizacaoService.cs): `SGRH/Services/AutorizacaoService.cs`
- [Permission filters](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Authorization/VerificarPermissaoAttribute.cs): `SGRH/Authorization/VerificarPermissaoAttribute.cs`

### Personnel management

- [Employee records](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Colaborador.cs): `SGRH/Models/Colaborador.cs`
- [Organizational units](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/UnidadeOrganica.cs): `SGRH/Models/UnidadeOrganica.cs`
- [Contracts and history](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Contrato.cs): `SGRH/Models/Contrato.cs`
- [Employee documents](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Documento.cs): `SGRH/Models/Documento.cs`
- [HR operations](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Controllers/HomeController.cs): `SGRH/Controllers/HomeController.cs`

### Workforce processes

- [Recruitment](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Candidatura.cs): `SGRH/Models/Candidatura.cs`
- [Training](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/AccaoFormacao.cs): `SGRH/Models/AccaoFormacao.cs`
- [Internships](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/Estagio.cs): `SGRH/Models/Estagio.cs`
- [Approval requests](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Models/PedidoAprovacao.cs): `SGRH/Models/PedidoAprovacao.cs`

### Persistence and infrastructure

- [EF data context](https://github.com/joaooo555/ine_sgrh/blob/main/SGRH/Data/AppDbContext.cs): `SGRH/Data/AppDbContext.cs`
- **SQL Server**

### Other components

- **Staff user**

## Connections

- Staff user → Account access: signs in
- Staff user → HR operations: manages HR
- Account access → EF data context: queries users (evidence: `SGRH/Controllers/AccountController.cs`)
- User administration → EF data context: manages users (evidence: `SGRH/Controllers/AdminController.cs`)
- User administration → Authorization service: checks access (evidence: `SGRH/Controllers/AdminController.cs`)
- Permission filters → Authorization service: checks permissions (evidence: `SGRH/Authorization/VerificarPermissaoAttribute.cs`)
- HR operations → Authorization service: loads permissions (evidence: `SGRH/Controllers/HomeController.cs`)
- HR operations → EF data context: reads and writes (evidence: `SGRH/Controllers/HomeController.cs`)
- EF data context → SQL Server: persists records
- HR operations → Employee records: manages records (evidence: `SGRH/Controllers/HomeController.cs`)
- HR operations → Contracts and history: manages contracts (evidence: `SGRH/Controllers/HomeController.cs`)
- HR operations → Employee documents: stores documents (evidence: `SGRH/Controllers/HomeController.cs`)
- HR operations → Recruitment: handles recruitment
- HR operations → Training: handles training
- HR operations → Internships: registers interns (evidence: `SGRH/Controllers/HomeController.cs`)
- HR operations → Approval requests: handles approvals (evidence: `SGRH/Controllers/HomeController.cs`)
- HR operations → Organizational units: uses units (evidence: `SGRH/Controllers/HomeController.cs`)
