# akhileshp123/employeemanagement_system architecture

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

- Interactive diagram: https://gitdiagram.com/akhileshp123/employeemanagement_system
- Repository: https://github.com/akhileshp123/employeemanagement_system

## Overview

EmployeeManagementAPI is a browser-backed employee and department management API with JWT registration/login. The main workflow is a user operating the web UI, which calls API controllers; services validate and map requests, repositories persist and query records, and results return to the UI. Employee search includes department, salary, sorting, and paging; department operations include employee counts and deletion safeguards. The graph reflects sampled source and the tree; README content was not provided, so undocumented capabilities and unsampled wiring are not inferred.

Main entry points: [`EmployeeManagementAPI/Program.cs`](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Program.cs) (Application host), [`EmployeeManagementAPI/wwwroot/app.js`](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/wwwroot/app.js) (Management UI), [`EmployeeManagementAPI/Data/DbConnectionFactory.cs`](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Data/DbConnectionFactory.cs) (Connection factory), [`EmployeeManagementAPI/Services/EmployeeService.cs`](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/EmployeeService.cs) (Employee operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webui["Management UI<br/>[app.js]"]
end

subgraph group_api["API layer"]
  node_startup["Application host<br/>[Program.cs]"]
  node_middleware["Exception handling"]
  node_employee_api["Employee API"]
  node_department_api["Department API"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
end

subgraph group_domain["Domain services"]
  node_employee_service["Employee operations<br/>[EmployeeService.cs]"]
  node_department_service["Department operations"]
  node_auth_service["Authentication<br/>[AuthService.cs]"]
end

subgraph group_persistence["Persistence"]
  node_employee_repo["Employee queries"]
  node_department_repo["Department queries"]
  node_auth_repo["User queries<br/>[AuthRepository.cs]"]
  node_connection_factory["Connection factory"]
end

node_user(("User"))
node_mysql[("MySQL database")]

node_user -->|"uses"| node_webui
node_startup -->|"serves static UI"| node_webui
node_webui -->|"requests employee data"| node_employee_api
node_webui -->|"requests department data"| node_department_api
node_employee_api -->|"calls"| node_employee_service
node_department_api -->|"calls"| node_department_service
node_auth_api -->|"calls"| node_auth_service
node_employee_service -->|"queries and writes"| node_employee_repo
node_employee_service -->|"checks departments"| node_department_repo
node_department_service -->|"queries and writes"| node_department_repo
node_auth_service -->|"queries and writes"| node_auth_repo
node_employee_repo -->|"creates connections"| node_connection_factory
node_department_repo -->|"creates connections"| node_connection_factory
node_auth_repo -->|"creates connections"| node_connection_factory
node_connection_factory -->|"connects"| node_mysql
node_startup -->|"registers pipeline"| node_middleware
node_startup -->|"maps controllers"| node_employee_api
node_startup -->|"maps controllers"| node_department_api
node_startup -->|"maps controllers"| node_auth_api

click node_webui "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/wwwroot/app.js"
click node_startup "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Program.cs"
click node_middleware "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Middleware/ExceptionMiddleware.cs"
click node_employee_api "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/controllers/EmployeeController.cs"
click node_department_api "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/controllers/DepartmentController.cs"
click node_auth_api "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/controllers/AuthController.cs"
click node_employee_service "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/EmployeeService.cs"
click node_department_service "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/DepartmentService.cs"
click node_auth_service "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/AuthService.cs"
click node_employee_repo "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Repositories/EmployeeRepository.cs"
click node_department_repo "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Repositories/DepartmentRepository.cs"
click node_auth_repo "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Repositories/AuthRepository.cs"
click node_connection_factory "https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Data/DbConnectionFactory.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_webui,node_user toneBlue
class node_startup,node_middleware,node_employee_api,node_department_api,node_auth_api,node_mysql toneAmber
class node_employee_service,node_department_service,node_auth_service toneMint
class node_employee_repo,node_department_repo,node_auth_repo,node_connection_factory toneRose
```

## Components

### Web client

- [Management UI](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/wwwroot/app.js): `EmployeeManagementAPI/wwwroot/app.js`

### API layer

- [Application host](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Program.cs): `EmployeeManagementAPI/Program.cs`
- [Exception handling](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Middleware/ExceptionMiddleware.cs): `EmployeeManagementAPI/Middleware/ExceptionMiddleware.cs`
- [Employee API](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/controllers/EmployeeController.cs): `EmployeeManagementAPI/controllers/EmployeeController.cs`
- [Department API](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/controllers/DepartmentController.cs): `EmployeeManagementAPI/controllers/DepartmentController.cs`
- [Authentication API](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/controllers/AuthController.cs): `EmployeeManagementAPI/controllers/AuthController.cs`

### Domain services

- [Employee operations](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/EmployeeService.cs): `EmployeeManagementAPI/Services/EmployeeService.cs`
- [Department operations](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/DepartmentService.cs): `EmployeeManagementAPI/Services/DepartmentService.cs`
- [Authentication](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Services/AuthService.cs): `EmployeeManagementAPI/Services/AuthService.cs`

### Persistence

- [Employee queries](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Repositories/EmployeeRepository.cs): `EmployeeManagementAPI/Repositories/EmployeeRepository.cs`
- [Department queries](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Repositories/DepartmentRepository.cs): `EmployeeManagementAPI/Repositories/DepartmentRepository.cs`
- [User queries](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Repositories/AuthRepository.cs): `EmployeeManagementAPI/Repositories/AuthRepository.cs`
- [Connection factory](https://github.com/akhileshp123/employeemanagement_system/blob/main/EmployeeManagementAPI/Data/DbConnectionFactory.cs): `EmployeeManagementAPI/Data/DbConnectionFactory.cs`

### Other components

- **User**
- **MySQL database**

## Connections

- User → Management UI: uses
- Application host → Management UI: serves static UI
- Management UI → Employee API: requests employee data
- Management UI → Department API: requests department data
- Employee API → Employee operations: calls
- Department API → Department operations: calls
- Authentication API → Authentication: calls
- Employee operations → Employee queries: queries and writes
- Employee operations → Department queries: checks departments
- Department operations → Department queries: queries and writes
- Authentication → User queries: queries and writes
- Employee queries → Connection factory: creates connections
- Department queries → Connection factory: creates connections
- User queries → Connection factory: creates connections
- Connection factory → MySQL database: connects
- Application host → Exception handling: registers pipeline
- Application host → Employee API: maps controllers
- Application host → Department API: maps controllers
- Application host → Authentication API: maps controllers
