# ma7moudkolib/hr-managementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/ma7moudkolib/hr-managementsystem
- Repository: https://github.com/ma7moudkolib/hr-managementsystem

## Overview

This is a full-stack HR management system: Angular provides user-facing workflows and an ASP.NET Core API implements authentication and HR operations backed by Entity Framework. The principal workflow is a user action through the UI/API, service logic, repositories, and persisted HR records. The README documents company, department, employee, attendance, leave, and payroll capabilities; several implementation files are present in the tree but were not excerpted, so their internal calls are not asserted here. Frontend leave management is explicitly shown using mock data, so it is kept distinct from the API workflow.

Main entry points: [`Backend/src/Service/ServiceManager.cs`](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Service/ServiceManager.cs) (Service manager), [`Frontend/src/app/app.module.ts`](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/app.module.ts) (Angular app), [`Frontend/src/app/features/auth`](https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Frontend/src/app/features/auth) (Login and registration), [`Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts`](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts) (Leave manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular application"]
  node_webapp["Angular app<br/>[app.module.ts]"]
  node_authui["Login and registration"]
  node_companyui["Company management UI"]
  node_employeeui["Employee management UI"]
  node_attendanceui["Attendance tracker"]
  node_leaveui["Leave manager"]
  node_payrollui["Payroll summary UI"]
  node_authclient["Authentication client<br/>[auth.service.ts]"]
  node_mockdata["Mock data service"]
end

subgraph group_api["HTTP API"]
  node_authcontroller["Authentication API"]
  node_companiescontroller["Companies API"]
  node_departmentscontroller["Departments API"]
  node_employeescontroller["Employees API"]
  node_attendancecontroller["Attendance API"]
  node_leavecontroller["Leave API<br/>[LeaveController.cs]"]
  node_payrollcontroller["Payroll API"]
end

subgraph group_services["Application services"]
  node_servicehub["Service manager<br/>[ServiceManager.cs]"]
  node_authservice["Authentication service"]
  node_hrservices["HR domain services"]
end

subgraph group_persistence["Persistence"]
  node_repohub["Repository manager"]
  node_dbcontext[("HR database context")]
end

subgraph group_domain["HR workflows"]
  node_hrrecords["HR records"]
end

node_user(("HR user"))

node_user -->|"uses"| node_authui
node_user -.->|"manages"| node_companyui
node_user -.->|"manages"| node_employeeui
node_user -.->|"tracks"| node_attendanceui
node_user -->|"manages"| node_leaveui
node_user -.->|"views"| node_payrollui
node_webapp -->|"declares"| node_authui
node_webapp -->|"declares"| node_companyui
node_webapp -->|"declares"| node_employeeui
node_webapp -->|"declares"| node_attendanceui
node_webapp -->|"declares"| node_leaveui
node_webapp -->|"declares"| node_payrollui
node_authui -.->|"uses"| node_authclient
node_authclient -->|"posts credentials"| node_authcontroller
node_user -->|"registers or logs in"| node_authcontroller
node_user -->|"manages"| node_companiescontroller
node_user -->|"manages"| node_departmentscontroller
node_user -->|"manages"| node_employeescontroller
node_user -->|"tracks"| node_attendancecontroller
node_user -->|"requests approval"| node_leavecontroller
node_user -->|"generates summaries"| node_payrollcontroller
node_employeescontroller -->|"calls services"| node_servicehub
node_leavecontroller -->|"calls services"| node_servicehub
node_payrollcontroller -->|"calls payroll service"| node_hrservices
node_authcontroller -.->|"dispatches authentication"| node_servicehub
node_companiescontroller -.->|"dispatches company work"| node_servicehub
node_departmentscontroller -.->|"dispatches department work"| node_servicehub
node_attendancecontroller -.->|"dispatches attendance work"| node_servicehub
node_servicehub -->|"creates"| node_authservice
node_servicehub -->|"creates services"| node_hrservices
node_hrservices -.->|"uses repositories"| node_repohub
node_repohub -->|"uses context"| node_dbcontext
node_dbcontext -->|"maps records"| node_hrrecords
node_leaveui -->|"loads and updates"| node_mockdata

click node_webapp "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/app.module.ts"
click node_authui "https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Frontend/src/app/features/auth"
click node_companyui "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/company/company-list/company-list.component.ts"
click node_employeeui "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/employees/employee-list/employee-list.component.ts"
click node_attendanceui "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/attendance-tracker/attendance-tracker.component.ts"
click node_leaveui "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts"
click node_payrollui "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/payroll-summary/payroll-summary.component.ts"
click node_authclient "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/services/auth.service.ts"
click node_authcontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/AuthenticationController.cs"
click node_companiescontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/CompaniesController.cs"
click node_departmentscontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/DepartmentController.cs"
click node_employeescontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/EmployeesController.cs"
click node_attendancecontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/AttendanceController.cs"
click node_leavecontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/LeaveController.cs"
click node_payrollcontroller "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/PayrollController.cs"
click node_servicehub "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Service/ServiceManager.cs"
click node_authservice "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Service/AuthenticationService.cs"
click node_hrservices "https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Backend/src/Service"
click node_repohub "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Repository/RepositoryManager.cs"
click node_dbcontext "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Repository/DatabaseContext/RepositoryContext.cs"
click node_hrrecords "https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Backend/src/Entities/Models"
click node_mockdata "https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/services/mock-data.service.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_webapp,node_authui,node_companyui,node_employeeui,node_attendanceui,node_leaveui,node_payrollui,node_authclient,node_mockdata,node_user toneBlue
class node_authcontroller,node_companiescontroller,node_departmentscontroller,node_employeescontroller,node_attendancecontroller,node_leavecontroller,node_payrollcontroller toneAmber
class node_servicehub,node_authservice,node_hrservices toneMint
class node_repohub,node_dbcontext toneRose
class node_hrrecords toneIndigo
```

## Components

### Angular application

- [Angular app](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/app.module.ts): `Frontend/src/app/app.module.ts`
- [Login and registration](https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Frontend/src/app/features/auth): `Frontend/src/app/features/auth`
- [Company management UI](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/company/company-list/company-list.component.ts): `Frontend/src/app/features/company/company-list/company-list.component.ts`
- [Employee management UI](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/employees/employee-list/employee-list.component.ts): `Frontend/src/app/features/employees/employee-list/employee-list.component.ts`
- [Attendance tracker](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/attendance-tracker/attendance-tracker.component.ts): `Frontend/src/app/features/hr-dashboard/attendance-tracker/attendance-tracker.component.ts`
- [Leave manager](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts): `Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts`
- [Payroll summary UI](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/features/hr-dashboard/payroll-summary/payroll-summary.component.ts): `Frontend/src/app/features/hr-dashboard/payroll-summary/payroll-summary.component.ts`
- [Authentication client](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/services/auth.service.ts): `Frontend/src/app/services/auth.service.ts`
- [Mock data service](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Frontend/src/app/services/mock-data.service.ts): `Frontend/src/app/services/mock-data.service.ts`

### HTTP API

- [Authentication API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/AuthenticationController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/AuthenticationController.cs`
- [Companies API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/CompaniesController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/CompaniesController.cs`
- [Departments API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/DepartmentController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/DepartmentController.cs`
- [Employees API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/EmployeesController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/EmployeesController.cs`
- [Attendance API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/AttendanceController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/AttendanceController.cs`
- [Leave API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/LeaveController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/LeaveController.cs`
- [Payroll API](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/CompanyEmployees.Presentation/Controllers/PayrollController.cs): `Backend/src/CompanyEmployees.Presentation/Controllers/PayrollController.cs`

### Application services

- [Service manager](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Service/ServiceManager.cs): `Backend/src/Service/ServiceManager.cs`
- [Authentication service](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Service/AuthenticationService.cs): `Backend/src/Service/AuthenticationService.cs`
- [HR domain services](https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Backend/src/Service): `Backend/src/Service`

### Persistence

- [Repository manager](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Repository/RepositoryManager.cs): `Backend/src/Repository/RepositoryManager.cs`
- [HR database context](https://github.com/ma7moudkolib/hr-managementsystem/blob/master/Backend/src/Repository/DatabaseContext/RepositoryContext.cs): `Backend/src/Repository/DatabaseContext/RepositoryContext.cs`

### HR workflows

- [HR records](https://github.com/ma7moudkolib/hr-managementsystem/tree/master/Backend/src/Entities/Models): `Backend/src/Entities/Models`

### Other components

- **HR user**

## Connections

- HR user → Login and registration: uses
- HR user → Company management UI: manages (evidence: `README.md`)
- HR user → Employee management UI: manages (evidence: `README.md`)
- HR user → Attendance tracker: tracks (evidence: `README.md`)
- HR user → Leave manager: manages (evidence: `Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts`)
- HR user → Payroll summary UI: views (evidence: `README.md`)
- Angular app → Login and registration: declares (evidence: `Frontend/src/app/app.module.ts`)
- Angular app → Company management UI: declares (evidence: `Frontend/src/app/app.module.ts`)
- Angular app → Employee management UI: declares (evidence: `Frontend/src/app/app.module.ts`)
- Angular app → Attendance tracker: declares (evidence: `Frontend/src/app/app.module.ts`)
- Angular app → Leave manager: declares (evidence: `Frontend/src/app/app.module.ts`)
- Angular app → Payroll summary UI: declares (evidence: `Frontend/src/app/app.module.ts`)
- Login and registration → Authentication client: uses (evidence: `Frontend/src/app/features/auth/register/register.component.ts`)
- Authentication client → Authentication API: posts credentials (evidence: `Frontend/src/app/services/auth.service.ts`)
- HR user → Authentication API: registers or logs in (evidence: `README.md`)
- HR user → Companies API: manages (evidence: `README.md`)
- HR user → Departments API: manages (evidence: `README.md`)
- HR user → Employees API: manages (evidence: `README.md`)
- HR user → Attendance API: tracks (evidence: `README.md`)
- HR user → Leave API: requests approval (evidence: `README.md`)
- HR user → Payroll API: generates summaries (evidence: `README.md`)
- Employees API → Service manager: calls services (evidence: `Backend/src/CompanyEmployees.Presentation/Controllers/EmployeesController.cs`)
- Leave API → Service manager: calls services (evidence: `Backend/src/CompanyEmployees.Presentation/Controllers/LeaveController.cs`)
- Payroll API → HR domain services: calls payroll service (evidence: `Backend/src/CompanyEmployees.Presentation/Controllers/PayrollController.cs`)
- Authentication API → Service manager: dispatches authentication
- Companies API → Service manager: dispatches company work
- Departments API → Service manager: dispatches department work
- Attendance API → Service manager: dispatches attendance work
- Service manager → Authentication service: creates (evidence: `Backend/src/Service/ServiceManager.cs`)
- Service manager → HR domain services: creates services (evidence: `Backend/src/Service/ServiceManager.cs`)
- HR domain services → Repository manager: uses repositories
- Repository manager → HR database context: uses context (evidence: `Backend/src/Repository/RepositoryManager.cs`)
- HR database context → HR records: maps records (evidence: `Backend/src/Repository/DatabaseContext/RepositoryContext.cs`)
- Leave manager → Mock data service: loads and updates (evidence: `Frontend/src/app/features/hr-dashboard/leave-manager/leave-manager.component.ts`)
