# shagun966/employee-portal architecture

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

- Interactive diagram: https://gitdiagram.com/shagun966/employee-portal
- Repository: https://github.com/shagun966/employee-portal

## Overview

This is an employee administration portal with both server-rendered account/employee workflows and a JWT authentication API. Users register or sign in; authenticated staff browse and filter employees, while Admins create, edit, and delete records. ASP.NET Core configures routing, authentication, and SQLite-backed persistence, and seeds initial accounts. The graph also preserves the forecast endpoint and the substantial domain/DTO modules. Relationships reflect the sampled controllers and startup wiring; unsampled views and the separate Netlify files are not connected speculatively.

Main entry points: [`Data/ApplicationDbContext.cs`](https://github.com/shagun966/employee-portal/blob/main/Data/ApplicationDbContext.cs) (EF data context), [`Controllers/AuthController.cs`](https://github.com/shagun966/employee-portal/blob/main/Controllers/AuthController.cs) (JWT auth API), [`Controllers/AccountController.cs`](https://github.com/shagun966/employee-portal/blob/main/Controllers/AccountController.cs) (Cookie account flow), [`Controllers/EmployeesController.cs`](https://github.com/shagun966/employee-portal/blob/main/Controllers/EmployeesController.cs) (Employee management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_startup["ASP.NET startup<br/>[Program.cs]"]
  node_db_context["EF data context"]
  node_sqlite[("SQLite database")]
  node_seeder["Account seeder<br/>[DbSeeder.cs]"]
  node_weather_controller["Forecast endpoint"]
end

subgraph group_identity["Identity and access"]
  node_account["Cookie account flow"]
  node_auth_api["JWT auth API<br/>[AuthController.cs]"]
end

subgraph group_employees["Employee administration"]
  node_employees_controller["Employee management"]
end

subgraph group_domain["Domain and contracts"]
  node_user["Portal user<br/>[User.cs]"]
  node_employee["Employee record<br/>[Employee.cs]"]
  node_login_dto["Login request<br/>[LoginRequestDto.cs]"]
  node_register_dto["Registration request"]
  node_auth_response["Token response<br/>[AuthResponseDto.cs]"]
  node_add_employee["Add employee DTO<br/>[AddEmployeeDTO.cs]"]
  node_update_employee["Update employee DTO"]
  node_forecast["Forecast model<br/>[WeatherForecast.cs]"]
end

node_startup -->|"configures"| node_db_context
node_startup -->|"runs seed"| node_seeder
node_startup -->|"configures SQLite"| node_sqlite
node_db_context -->|"maps entity"| node_employee
node_db_context -->|"maps entity"| node_user
node_seeder -->|"seeds accounts"| node_db_context
node_account -->|"reads and writes"| node_db_context
node_account -->|"accepts"| node_login_dto
node_account -->|"accepts"| node_register_dto
node_account -->|"authenticates users"| node_user
node_auth_api -->|"reads and writes"| node_db_context
node_auth_api -->|"accepts"| node_login_dto
node_auth_api -->|"accepts"| node_register_dto
node_auth_api -->|"authenticates users"| node_user
node_auth_api -->|"returns token"| node_auth_response
node_employees_controller -->|"reads and writes"| node_db_context
node_employees_controller -->|"accepts"| node_add_employee
node_employees_controller -->|"accepts"| node_update_employee
node_employees_controller -->|"manages records"| node_employee
node_weather_controller -->|"uses model"| node_forecast

click node_user "https://github.com/shagun966/employee-portal/blob/main/Models/Entities/User.cs"
click node_employee "https://github.com/shagun966/employee-portal/blob/main/Models/Entities/Employee.cs"
click node_login_dto "https://github.com/shagun966/employee-portal/blob/main/Models/DTOs/LoginRequestDto.cs"
click node_register_dto "https://github.com/shagun966/employee-portal/blob/main/Models/DTOs/RegisterRequestDto.cs"
click node_auth_response "https://github.com/shagun966/employee-portal/blob/main/Models/DTOs/AuthResponseDto.cs"
click node_add_employee "https://github.com/shagun966/employee-portal/blob/main/Models/AddEmployeeDTO.cs"
click node_update_employee "https://github.com/shagun966/employee-portal/blob/main/Models/UpdateEmployeeDTO.cs"
click node_startup "https://github.com/shagun966/employee-portal/blob/main/Program.cs"
click node_db_context "https://github.com/shagun966/employee-portal/blob/main/Data/ApplicationDbContext.cs"
click node_seeder "https://github.com/shagun966/employee-portal/blob/main/Data/DbSeeder.cs"
click node_account "https://github.com/shagun966/employee-portal/blob/main/Controllers/AccountController.cs"
click node_auth_api "https://github.com/shagun966/employee-portal/blob/main/Controllers/AuthController.cs"
click node_employees_controller "https://github.com/shagun966/employee-portal/blob/main/Controllers/EmployeesController.cs"
click node_weather_controller "https://github.com/shagun966/employee-portal/blob/main/Controllers/WeatherForecastController.cs"
click node_forecast "https://github.com/shagun966/employee-portal/blob/main/WeatherForecast.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_startup,node_db_context,node_sqlite,node_seeder,node_weather_controller toneBlue
class node_account,node_auth_api toneAmber
class node_employees_controller toneMint
class node_user,node_employee,node_login_dto,node_register_dto,node_auth_response,node_add_employee,node_update_employee,node_forecast toneRose
```

## Components

### Application runtime

- [ASP.NET startup](https://github.com/shagun966/employee-portal/blob/main/Program.cs): `Program.cs`
- [EF data context](https://github.com/shagun966/employee-portal/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`
- **SQLite database**
- [Account seeder](https://github.com/shagun966/employee-portal/blob/main/Data/DbSeeder.cs): `Data/DbSeeder.cs`
- [Forecast endpoint](https://github.com/shagun966/employee-portal/blob/main/Controllers/WeatherForecastController.cs): `Controllers/WeatherForecastController.cs`

### Identity and access

- [Cookie account flow](https://github.com/shagun966/employee-portal/blob/main/Controllers/AccountController.cs): `Controllers/AccountController.cs`
- [JWT auth API](https://github.com/shagun966/employee-portal/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`

### Employee administration

- [Employee management](https://github.com/shagun966/employee-portal/blob/main/Controllers/EmployeesController.cs): `Controllers/EmployeesController.cs`

### Domain and contracts

- [Portal user](https://github.com/shagun966/employee-portal/blob/main/Models/Entities/User.cs): `Models/Entities/User.cs`
- [Employee record](https://github.com/shagun966/employee-portal/blob/main/Models/Entities/Employee.cs): `Models/Entities/Employee.cs`
- [Login request](https://github.com/shagun966/employee-portal/blob/main/Models/DTOs/LoginRequestDto.cs): `Models/DTOs/LoginRequestDto.cs`
- [Registration request](https://github.com/shagun966/employee-portal/blob/main/Models/DTOs/RegisterRequestDto.cs): `Models/DTOs/RegisterRequestDto.cs`
- [Token response](https://github.com/shagun966/employee-portal/blob/main/Models/DTOs/AuthResponseDto.cs): `Models/DTOs/AuthResponseDto.cs`
- [Add employee DTO](https://github.com/shagun966/employee-portal/blob/main/Models/AddEmployeeDTO.cs): `Models/AddEmployeeDTO.cs`
- [Update employee DTO](https://github.com/shagun966/employee-portal/blob/main/Models/UpdateEmployeeDTO.cs): `Models/UpdateEmployeeDTO.cs`
- [Forecast model](https://github.com/shagun966/employee-portal/blob/main/WeatherForecast.cs): `WeatherForecast.cs`

## Connections

- ASP.NET startup → EF data context: configures (evidence: `Program.cs`)
- ASP.NET startup → Account seeder: runs seed (evidence: `Program.cs`)
- ASP.NET startup → SQLite database: configures SQLite (evidence: `Program.cs`)
- EF data context → Employee record: maps entity (evidence: `Data/ApplicationDbContext.cs`)
- EF data context → Portal user: maps entity (evidence: `Data/ApplicationDbContext.cs`)
- Account seeder → EF data context: seeds accounts (evidence: `Data/DbSeeder.cs`)
- Cookie account flow → EF data context: reads and writes (evidence: `Controllers/AccountController.cs`)
- Cookie account flow → Login request: accepts (evidence: `Controllers/AccountController.cs`)
- Cookie account flow → Registration request: accepts (evidence: `Controllers/AccountController.cs`)
- Cookie account flow → Portal user: authenticates users (evidence: `Controllers/AccountController.cs`)
- JWT auth API → EF data context: reads and writes (evidence: `Controllers/AuthController.cs`)
- JWT auth API → Login request: accepts (evidence: `Controllers/AuthController.cs`)
- JWT auth API → Registration request: accepts (evidence: `Controllers/AuthController.cs`)
- JWT auth API → Portal user: authenticates users (evidence: `Controllers/AuthController.cs`)
- JWT auth API → Token response: returns token (evidence: `Controllers/AuthController.cs`)
- Employee management → EF data context: reads and writes (evidence: `Controllers/EmployeesController.cs`)
- Employee management → Add employee DTO: accepts (evidence: `Controllers/EmployeesController.cs`)
- Employee management → Update employee DTO: accepts (evidence: `Controllers/EmployeesController.cs`)
- Employee management → Employee record: manages records (evidence: `Controllers/EmployeesController.cs`)
- Forecast endpoint → Forecast model: uses model (evidence: `Controllers/WeatherForecastController.cs`)
