# pt131923/qlns-nh-m-11 architecture

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

- Interactive diagram: https://gitdiagram.com/pt131923/qlns-nh-m-11
- Repository: https://github.com/pt131923/qlns-nh-m-11

## Overview

This is an HR management application: an Angular client supports staff and administrative tasks through an ASP.NET API backed by MongoDB. The principal workflow is managing employees and departments, with contracts, attendance, and payroll as related HR stages; authentication and dashboard reporting are additional capabilities. Source excerpts show selected API-to-repository and payroll relationships, but not client HTTP wiring or most controller implementations, so those connections are omitted rather than inferred.

Main entry points: [`API/Services/PayrollService.cs`](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/PayrollService.cs) (Payroll service), [`client/src/app/app.module.ts`](https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/app.module.ts) (Angular application), [`API/Controllers/DepartmentsController.cs`](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/DepartmentsController.cs) (Department endpoints), [`API/Services/DashboardService.cs`](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/DashboardService.cs) (Dashboard service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_authui["Sign in and registration"]
  node_dashboardui["Dashboard view"]
  node_app["Angular application<br/>[app.module.ts]"]
end

subgraph group_api["API and domain"]
  node_api["HTTP API<br/>[Program.cs]"]
  node_employeecontroller["Employee endpoints"]
  node_departmentcontroller["Department endpoints"]
  node_salarycontroller["Salary endpoints"]
  node_dashboardcontroller["Dashboard endpoints"]
  node_domainmodels["HR domain models<br/>[Employee.cs]"]
  node_payrollmodels["Payroll model<br/>[Salary.cs]"]
  node_deptmodel["Department model<br/>[AppDepartment.cs]"]
end

subgraph group_data["Persistence and services"]
  node_employees["Employee repository"]
  node_departmentsrepo["Department repository"]
  node_payrollservice["Payroll service<br/>[PayrollService.cs]"]
  node_dashboardservice["Dashboard service"]
  node_mongo[("MongoDB")]
  node_authservice["Token service<br/>[TokenService.cs]"]
  node_userrepo["User repository<br/>[UserRepository.cs]"]
end

subgraph group_hr["HR operations"]
  node_staff["Employee management"]
  node_departments["Department management"]
  node_contracts["Contracts"]
  node_attendance["Timekeeping"]
  node_payroll["Salary and payroll"]
  node_leave["Leave management"]
  node_recruitment["Recruitment"]
  node_training["Training"]
  node_contacts["Contacts and history"]
  node_benefits["Benefits"]
end

node_actor(("HR staff"))
node_signalr(("SignalR clients"))

node_actor -->|"uses"| node_app
node_app -->|"declares"| node_authui
node_app -->|"declares"| node_dashboardui
node_employeecontroller -->|"calls"| node_employees
node_departmentcontroller -->|"calls"| node_departmentsrepo
node_salarycontroller -->|"uses"| node_payrollservice
node_payrollservice -->|"reads and writes"| node_mongo
node_dashboardservice -->|"reads"| node_mongo
node_dashboardservice -->|"sends updates"| node_signalr
node_employees -->|"uses"| node_mongo
node_departmentsrepo -->|"uses"| node_mongo
node_userrepo -->|"uses"| node_mongo
node_payrollservice -->|"reads"| node_domainmodels
node_payrollservice -->|"updates"| node_payrollmodels
node_departmentcontroller -->|"maps"| node_deptmodel
node_api -->|"configures collections"| node_mongo

click node_staff "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/employees"
click node_departments "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/departments"
click node_contracts "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/contract"
click node_attendance "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/timekeeping"
click node_payroll "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/salary"
click node_leave "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/leave"
click node_recruitment "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/recruitment"
click node_training "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/training"
click node_contacts "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/contact"
click node_benefits "https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/benefits"
click node_authui "https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/User/user-login/user-login.component.ts"
click node_dashboardui "https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/dashboard/dashboard.component.ts"
click node_app "https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/app.module.ts"
click node_api "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Program.cs"
click node_employeecontroller "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/EmployeesController.cs"
click node_departmentcontroller "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/DepartmentsController.cs"
click node_salarycontroller "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/SalariesController.cs"
click node_dashboardcontroller "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/DashboardController.cs"
click node_employees "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Data/EmployeeRepository.cs"
click node_departmentsrepo "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Data/DepartmentRepository.cs"
click node_payrollservice "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/PayrollService.cs"
click node_dashboardservice "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/DashboardService.cs"
click node_authservice "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/TokenService.cs"
click node_userrepo "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Data/UserRepository.cs"
click node_domainmodels "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Entities/Employee.cs"
click node_payrollmodels "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Entities/Salary.cs"
click node_deptmodel "https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Entities/AppDepartment.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_authui,node_dashboardui,node_app,node_signalr toneBlue
class node_api,node_employeecontroller,node_departmentcontroller,node_salarycontroller,node_dashboardcontroller,node_domainmodels,node_payrollmodels,node_deptmodel toneAmber
class node_employees,node_departmentsrepo,node_payrollservice,node_dashboardservice,node_mongo,node_authservice,node_userrepo toneMint
class node_staff,node_departments,node_contracts,node_attendance,node_payroll,node_leave,node_recruitment,node_training,node_contacts,node_benefits toneRose
class node_actor toneIndigo
```

## Components

### Angular client

- [Sign in and registration](https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/User/user-login/user-login.component.ts): `client/src/app/User/user-login/user-login.component.ts`
- [Dashboard view](https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/dashboard/dashboard.component.ts): `client/src/app/dashboard/dashboard.component.ts`
- [Angular application](https://github.com/pt131923/qlns-nh-m-11/blob/master/client/src/app/app.module.ts): `client/src/app/app.module.ts`

### API and domain

- [HTTP API](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Program.cs): `API/Program.cs`
- [Employee endpoints](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/EmployeesController.cs): `API/Controllers/EmployeesController.cs`
- [Department endpoints](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/DepartmentsController.cs): `API/Controllers/DepartmentsController.cs`
- [Salary endpoints](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/SalariesController.cs): `API/Controllers/SalariesController.cs`
- [Dashboard endpoints](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Controllers/DashboardController.cs): `API/Controllers/DashboardController.cs`
- [HR domain models](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Entities/Employee.cs): `API/Entities/Employee.cs`
- [Payroll model](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Entities/Salary.cs): `API/Entities/Salary.cs`
- [Department model](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Entities/AppDepartment.cs): `API/Entities/AppDepartment.cs`

### Persistence and services

- [Employee repository](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Data/EmployeeRepository.cs): `API/Data/EmployeeRepository.cs`
- [Department repository](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Data/DepartmentRepository.cs): `API/Data/DepartmentRepository.cs`
- [Payroll service](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/PayrollService.cs): `API/Services/PayrollService.cs`
- [Dashboard service](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/DashboardService.cs): `API/Services/DashboardService.cs`
- **MongoDB**
- [Token service](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Services/TokenService.cs): `API/Services/TokenService.cs`
- [User repository](https://github.com/pt131923/qlns-nh-m-11/blob/master/API/Data/UserRepository.cs): `API/Data/UserRepository.cs`

### HR operations

- [Employee management](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/employees): `client/src/app/employees`
- [Department management](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/departments): `client/src/app/departments`
- [Contracts](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/contract): `client/src/app/contract`
- [Timekeeping](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/timekeeping): `client/src/app/timekeeping`
- [Salary and payroll](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/salary): `client/src/app/salary`
- [Leave management](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/leave): `client/src/app/leave`
- [Recruitment](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/recruitment): `client/src/app/recruitment`
- [Training](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/training): `client/src/app/training`
- [Contacts and history](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/contact): `client/src/app/contact`
- [Benefits](https://github.com/pt131923/qlns-nh-m-11/tree/master/client/src/app/benefits): `client/src/app/benefits`

### Other components

- **HR staff**
- **SignalR clients**

## Connections

- HR staff → Angular application: uses
- Angular application → Sign in and registration: declares (evidence: `client/src/app/app.module.ts`)
- Angular application → Dashboard view: declares (evidence: `client/src/app/app.module.ts`)
- Employee endpoints → Employee repository: calls (evidence: `API/Controllers/EmployeesController.cs`)
- Department endpoints → Department repository: calls (evidence: `API/Controllers/DepartmentsController.cs`)
- Salary endpoints → Payroll service: uses (evidence: `API/Controllers/SalariesController.cs`)
- Payroll service → MongoDB: reads and writes (evidence: `API/Services/PayrollService.cs`)
- Dashboard service → MongoDB: reads (evidence: `API/Services/DashboardService.cs`)
- Dashboard service → SignalR clients: sends updates (evidence: `API/Services/DashboardService.cs`)
- Employee repository → MongoDB: uses (evidence: `API/Data/EmployeeRepository.cs`)
- Department repository → MongoDB: uses (evidence: `API/Data/DepartmentRepository.cs`)
- User repository → MongoDB: uses (evidence: `API/Data/UserRepository.cs`)
- Payroll service → HR domain models: reads (evidence: `API/Services/PayrollService.cs`)
- Payroll service → Payroll model: updates (evidence: `API/Services/PayrollService.cs`)
- Department endpoints → Department model: maps (evidence: `API/Controllers/DepartmentsController.cs`)
- HTTP API → MongoDB: configures collections (evidence: `API/Program.cs`)
