# jahnavicse/employeeapi architecture

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

- Interactive diagram: https://gitdiagram.com/jahnavicse/employeeapi
- Repository: https://github.com/jahnavicse/employeeapi

## Overview

This is an ASP.NET Core employee-management API with JWT login and role-protected employee administration. A client obtains a token from the login endpoint, then uses the employee endpoints to search, page, retrieve, create, update, or soft-delete employee records. Employee operations pass through a repository to an EF Core context and SQL Server. The graph reflects the supplied source excerpts and SOURCE INDEX; the README is empty, and unsampled migration or configuration details are not inferred.

Main entry points: [`Sujay sir Test-Emp_API/Program.cs`](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Program.cs) (ASP.NET host), [`Sujay sir Test-Emp_API/Controllers/EmployeesController.cs`](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Controllers/EmployeesController.cs) (Employee endpoints), [`Sujay sir Test-Emp_API/Controllers/AuthController.cs`](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Controllers/AuthController.cs) (Login endpoint), [`Sujay sir Test-Emp_API/Data/Data.cs`](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Data/Data.cs) (EF Core context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surface"]
  node_app["ASP.NET host<br/>[Program.cs]"]
  node_employee_api["Employee endpoints"]
  node_dtos["Request and response DTOs<br/>[EmployeeDtos.cs]"]
end

subgraph group_security["Authentication"]
  node_auth["Login endpoint<br/>[AuthController.cs]"]
  node_jwt["JWT validation<br/>[Program.cs]"]
end

subgraph group_employee["Employee domain"]
  node_repo_contract["Repository contract"]
  node_employee_repo["Employee repository"]
  node_employee_model["Employee entity<br/>[Employee.cs]"]
  node_department_model["Department entity<br/>[Department.cs]"]
end

subgraph group_persistence["Persistence"]
  node_context["EF Core context<br/>[Data.cs]"]
  node_sql[("SQL Server")]
end

subgraph group_docs["API documentation"]
  node_openapi["OpenAPI security scheme"]
end

node_client(("API client"))

node_client -->|"requests login"| node_auth
node_client -->|"calls endpoints"| node_employee_api
node_app -->|"maps controllers"| node_auth
node_app -->|"maps controllers"| node_employee_api
node_auth -->|"uses login DTOs"| node_dtos
node_auth -->|"returns JWT"| node_client
node_app -->|"configures validation"| node_jwt
node_employee_api -->|"calls operations"| node_repo_contract
node_employee_api -->|"accepts and returns"| node_dtos
node_employee_repo -->|"implements"| node_repo_contract
node_employee_repo -->|"queries and saves"| node_context
node_employee_repo -->|"maps DTOs"| node_dtos
node_context -->|"maps entity"| node_employee_model
node_context -->|"maps and seeds"| node_department_model
node_app -->|"registers context"| node_context
node_app -->|"configures SQL Server"| node_sql
node_app -->|"registers transformer"| node_openapi

click node_app "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Program.cs"
click node_auth "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Controllers/AuthController.cs"
click node_jwt "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Program.cs"
click node_employee_api "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Controllers/EmployeesController.cs"
click node_dtos "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/DTOs/EmployeeDtos.cs"
click node_repo_contract "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Repository/IEmployeeRepository.cs"
click node_employee_repo "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Repository/EmployeeRepository.cs"
click node_context "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Data/Data.cs"
click node_employee_model "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Models/Employee.cs"
click node_department_model "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Models/Department.cs"
click node_openapi "https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/OpenApi/BearerSecuritySchemeTransformer.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_app,node_employee_api,node_dtos,node_client toneBlue
class node_auth,node_jwt toneAmber
class node_repo_contract,node_employee_repo,node_employee_model,node_department_model toneMint
class node_context,node_sql toneRose
class node_openapi toneIndigo
```

## Components

### API surface

- [ASP.NET host](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Program.cs): `Sujay sir Test-Emp_API/Program.cs`
- [Employee endpoints](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Controllers/EmployeesController.cs): `Sujay sir Test-Emp_API/Controllers/EmployeesController.cs`
- [Request and response DTOs](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/DTOs/EmployeeDtos.cs): `Sujay sir Test-Emp_API/DTOs/EmployeeDtos.cs`

### Authentication

- [Login endpoint](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Controllers/AuthController.cs): `Sujay sir Test-Emp_API/Controllers/AuthController.cs`
- [JWT validation](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Program.cs): `Sujay sir Test-Emp_API/Program.cs`

### Employee domain

- [Repository contract](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Repository/IEmployeeRepository.cs): `Sujay sir Test-Emp_API/Repository/IEmployeeRepository.cs`
- [Employee repository](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Repository/EmployeeRepository.cs): `Sujay sir Test-Emp_API/Repository/EmployeeRepository.cs`
- [Employee entity](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Models/Employee.cs): `Sujay sir Test-Emp_API/Models/Employee.cs`
- [Department entity](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Models/Department.cs): `Sujay sir Test-Emp_API/Models/Department.cs`

### Persistence

- [EF Core context](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/Data/Data.cs): `Sujay sir Test-Emp_API/Data/Data.cs`
- **SQL Server**

### API documentation

- [OpenAPI security scheme](https://github.com/jahnavicse/employeeapi/blob/main/Sujay%20sir%20Test-Emp_API/OpenApi/BearerSecuritySchemeTransformer.cs): `Sujay sir Test-Emp_API/OpenApi/BearerSecuritySchemeTransformer.cs`

### Other components

- **API client**

## Connections

- API client → Login endpoint: requests login (evidence: `Sujay sir Test-Emp_API/Controllers/AuthController.cs`)
- API client → Employee endpoints: calls endpoints (evidence: `Sujay sir Test-Emp_API/Controllers/EmployeesController.cs`)
- ASP.NET host → Login endpoint: maps controllers (evidence: `Sujay sir Test-Emp_API/Program.cs`)
- ASP.NET host → Employee endpoints: maps controllers (evidence: `Sujay sir Test-Emp_API/Program.cs`)
- Login endpoint → Request and response DTOs: uses login DTOs (evidence: `Sujay sir Test-Emp_API/Controllers/AuthController.cs`)
- Login endpoint → API client: returns JWT (evidence: `Sujay sir Test-Emp_API/Controllers/AuthController.cs`)
- ASP.NET host → JWT validation: configures validation (evidence: `Sujay sir Test-Emp_API/Program.cs`)
- Employee endpoints → Repository contract: calls operations (evidence: `Sujay sir Test-Emp_API/Controllers/EmployeesController.cs`)
- Employee endpoints → Request and response DTOs: accepts and returns (evidence: `Sujay sir Test-Emp_API/Controllers/EmployeesController.cs`)
- Employee repository → Repository contract: implements (evidence: `Sujay sir Test-Emp_API/Repository/EmployeeRepository.cs`)
- Employee repository → EF Core context: queries and saves (evidence: `Sujay sir Test-Emp_API/Repository/EmployeeRepository.cs`)
- Employee repository → Request and response DTOs: maps DTOs (evidence: `Sujay sir Test-Emp_API/Repository/EmployeeRepository.cs`)
- EF Core context → Employee entity: maps entity (evidence: `Sujay sir Test-Emp_API/Data/Data.cs`)
- EF Core context → Department entity: maps and seeds (evidence: `Sujay sir Test-Emp_API/Data/Data.cs`)
- ASP.NET host → EF Core context: registers context (evidence: `Sujay sir Test-Emp_API/Program.cs`)
- ASP.NET host → SQL Server: configures SQL Server (evidence: `Sujay sir Test-Emp_API/Program.cs`)
- ASP.NET host → OpenAPI security scheme: registers transformer (evidence: `Sujay sir Test-Emp_API/Program.cs`)
