# mahmoudesawi/hr architecture

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

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

## Overview

This is a full-stack HR management system: staff use an Angular SPA to reach an ASP.NET Core REST API for sign-in and employee, department, and vacation workflows; the API persists data through Entity Framework Core to SQL Server. The graph includes the documented lookup classifications and role-based JWT authentication. The frontend API integration and some screens are documented but not represented in the sampled component source, so their internal wiring is kept at the documented SPA-to-API boundary.

Main entry points: [`HR/HrDbContext.cs`](https://github.com/mahmoudesawi/hr/blob/main/HR/HrDbContext.cs) (EF Core context), [`HR/Program.cs`](https://github.com/mahmoudesawi/hr/blob/main/HR/Program.cs) (API host), [`Frontend/HR/src/main.ts`](https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/main.ts) (Angular SPA), [`HR/Controllers/AuthController.cs`](https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/AuthController.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_spa["Angular SPA<br/>[main.ts]"]
  node_app["Root app<br/>[app.ts]"]
  node_employee_ui["Employee screen<br/>[employees.ts]"]
end

subgraph group_api["Web API"]
  node_host["API host<br/>[Program.cs]"]
end

subgraph group_domain["HR workflows"]
  node_auth["Authentication<br/>[AuthController.cs]"]
  node_employees["Employee management"]
  node_departments["Department tracking"]
  node_vacations["Vacation tracking"]
  node_lookups["Lookup classifications<br/>[Lookup.cs]"]
  node_models["HR entities"]
end

subgraph group_persistence["Persistence"]
  node_context["EF Core context<br/>[HrDbContext.cs]"]
end

node_staff(("HR user"))
node_sql[("SQL Server")]

node_staff -->|"uses"| node_spa
node_spa -->|"bootstraps"| node_app
node_app -->|"renders"| node_employee_ui
node_spa -->|"REST requests"| node_host
node_host -->|"routes"| node_auth
node_host -->|"routes"| node_employees
node_host -->|"routes"| node_departments
node_host -->|"routes"| node_vacations
node_host -->|"configures"| node_context
node_host -->|"validates JWTs"| node_auth
node_auth -->|"reads users"| node_context
node_employees -->|"queries and saves"| node_context
node_departments -->|"queries and saves"| node_context
node_vacations -->|"queries and saves"| node_context
node_context -->|"reads and writes"| node_sql
node_context -->|"maps entities"| node_models
node_context -->|"seeds classifications"| node_lookups

click node_spa "https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/main.ts"
click node_app "https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/app/app.ts"
click node_employee_ui "https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/app/components/employees/employees.ts"
click node_host "https://github.com/mahmoudesawi/hr/blob/main/HR/Program.cs"
click node_auth "https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/AuthController.cs"
click node_employees "https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/EmployeesController.cs"
click node_departments "https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/DepartmentsController.cs"
click node_vacations "https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/VacationsController.cs"
click node_lookups "https://github.com/mahmoudesawi/hr/blob/main/HR/Model/Lookup.cs"
click node_models "https://github.com/mahmoudesawi/hr/tree/main/HR/Model"
click node_context "https://github.com/mahmoudesawi/hr/blob/main/HR/HrDbContext.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_spa,node_app,node_employee_ui,node_staff toneBlue
class node_host,node_sql toneAmber
class node_auth,node_employees,node_departments,node_vacations,node_lookups,node_models toneMint
class node_context toneRose
```

## Components

### Angular client

- [Angular SPA](https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/main.ts): `Frontend/HR/src/main.ts`
- [Root app](https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/app/app.ts): `Frontend/HR/src/app/app.ts`
- [Employee screen](https://github.com/mahmoudesawi/hr/blob/main/Frontend/HR/src/app/components/employees/employees.ts): `Frontend/HR/src/app/components/employees/employees.ts`

### Web API

- [API host](https://github.com/mahmoudesawi/hr/blob/main/HR/Program.cs): `HR/Program.cs`

### HR workflows

- [Authentication](https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/AuthController.cs): `HR/Controllers/AuthController.cs`
- [Employee management](https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/EmployeesController.cs): `HR/Controllers/EmployeesController.cs`
- [Department tracking](https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/DepartmentsController.cs): `HR/Controllers/DepartmentsController.cs`
- [Vacation tracking](https://github.com/mahmoudesawi/hr/blob/main/HR/Controllers/VacationsController.cs): `HR/Controllers/VacationsController.cs`
- [Lookup classifications](https://github.com/mahmoudesawi/hr/blob/main/HR/Model/Lookup.cs): `HR/Model/Lookup.cs`
- [HR entities](https://github.com/mahmoudesawi/hr/tree/main/HR/Model): `HR/Model`

### Persistence

- [EF Core context](https://github.com/mahmoudesawi/hr/blob/main/HR/HrDbContext.cs): `HR/HrDbContext.cs`

### Other components

- **HR user**
- **SQL Server**

## Connections

- HR user → Angular SPA: uses
- Angular SPA → Root app: bootstraps
- Root app → Employee screen: renders
- Angular SPA → API host: REST requests
- API host → Authentication: routes
- API host → Employee management: routes
- API host → Department tracking: routes
- API host → Vacation tracking: routes
- API host → EF Core context: configures
- API host → Authentication: validates JWTs
- Authentication → EF Core context: reads users
- Employee management → EF Core context: queries and saves
- Department tracking → EF Core context: queries and saves
- Vacation tracking → EF Core context: queries and saves
- EF Core context → SQL Server: reads and writes
- EF Core context → HR entities: maps entities
- EF Core context → Lookup classifications: seeds classifications
