# chaitanyapuranik/payrollmanagementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/chaitanyapuranik/payrollmanagementsystem
- Repository: https://github.com/chaitanyapuranik/payrollmanagementsystem
- Video tour (about a minute): https://gitdiagram.com/chaitanyapuranik/payrollmanagementsystem/video

## Overview

This ASP.NET Core Razor Pages application takes employees from registration and login through weekly timesheet entry and submission; administrators review submitted sheets, generate payroll at the documented flat 13% tax rate, and inspect reports and run history. Identity and role policies protect the user and admin areas, while services implement timesheet and payroll operations over the EF Core context. The excerpts show service-to-context behavior and startup registration; page-to-service calls are supported by the source index, while unspecified database hosting is represented generically.

Main entry points: [`Data/AppDbContext.cs`](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Data/AppDbContext.cs) (EF Core context), [`Program.cs`](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Program.cs) (Razor Pages host), [`Services/Interfaces/ITimesheetService.cs`](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Interfaces/ITimesheetService.cs) (Timesheet contract), [`Services/Implementations/TimesheetService.cs`](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Implementations/TimesheetService.cs) (Timesheet service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_web["Razor Pages host<br/>[Program.cs]"]
  node_identity_pages["Identity pages"]
  node_app_user["Identity user<br/>[AppUser.cs]"]
  node_registration["Registration<br/>[Register.cshtml.cs]"]
  node_profile["Profile management<br/>[Index.cshtml.cs]"]
  node_email["Email sender<br/>[EmailSender.cs]"]
end

subgraph group_timesheets["Timesheet workflow"]
  node_user_home["User dashboard<br/>[Index.cshtml.cs]"]
  node_timesheet_edit["Timesheet entry<br/>[Edit.cshtml.cs]"]
  node_timesheet_service["Timesheet service"]
  node_timesheet_interface["Timesheet contract"]
  node_admin_dashboard["Admin dashboard<br/>[Index.cshtml.cs]"]
  node_timesheet_review["Timesheet review<br/>[Review.cshtml.cs]"]
  node_timesheet_list["Submitted timesheets<br/>[Index.cshtml.cs]"]
end

subgraph group_payroll["Payroll operations"]
  node_payroll_generate["Payroll generation<br/>[Generate.cshtml.cs]"]
  node_payroll_service["Payroll service<br/>[PayrollService.cs]"]
  node_payroll_interface["Payroll contract<br/>[IPayrollService.cs]"]
  node_payroll_history["Run history<br/>[Index.cshtml.cs]"]
  node_payroll_report["Payroll report<br/>[Report.cshtml.cs]"]
end

subgraph group_persistence["Domain and persistence"]
  node_dbcontext["EF Core context<br/>[AppDbContext.cs]"]
  node_database[("Application database")]
  node_employee_model["Employee records<br/>[Employee.cs]"]
  node_timesheet_model["Timesheet records<br/>[Timesheet.cs]"]
  node_entry_model["Daily entries<br/>[TimesheetEntry.cs]"]
  node_payrun_model["Pay run records<br/>[PayRun.cs]"]
  node_paydetail_model["Pay details<br/>[PayDetail.cs]"]
end

node_employee(("Employee"))
node_admin(("Administrator"))

node_employee -->|"uses"| node_web
node_admin -->|"uses"| node_web
node_web -->|"maps pages"| node_identity_pages
node_web -->|"configures"| node_dbcontext
node_web -->|"registers"| node_timesheet_service
node_web -->|"registers"| node_payroll_service
node_web -->|"configures identity"| node_app_user
node_web -->|"registers"| node_email
node_registration -->|"creates"| node_app_user
node_registration -->|"creates"| node_employee_model
node_registration -->|"persists"| node_dbcontext
node_profile -->|"reads and updates"| node_dbcontext
node_user_home -->|"reads"| node_dbcontext
node_timesheet_edit -->|"calls"| node_timesheet_interface
node_timesheet_service -->|"reads and writes"| node_dbcontext
node_timesheet_service -->|"implements"| node_timesheet_interface
node_timesheet_service -->|"loads and saves"| node_timesheet_model
node_timesheet_service -->|"loads and saves"| node_entry_model
node_admin_dashboard -->|"calls"| node_timesheet_interface
node_admin_dashboard -->|"calls"| node_payroll_interface
node_timesheet_review -->|"calls"| node_timesheet_interface
node_timesheet_list -->|"calls"| node_timesheet_interface
node_payroll_generate -->|"reads submissions"| node_timesheet_interface
node_payroll_generate -->|"starts run"| node_payroll_interface
node_payroll_service -->|"implements"| node_payroll_interface
node_payroll_service -->|"reads and writes"| node_dbcontext
node_payroll_service -->|"creates"| node_payrun_model
node_payroll_service -->|"calculates and creates"| node_paydetail_model
node_payroll_history -->|"calls"| node_payroll_interface
node_payroll_report -->|"calls"| node_payroll_interface
node_dbcontext -.->|"persists entities"| node_database
node_dbcontext -->|"stores identity"| node_app_user
node_dbcontext -->|"maps"| node_employee_model
node_dbcontext -->|"maps"| node_timesheet_model
node_dbcontext -->|"maps"| node_entry_model
node_dbcontext -->|"maps"| node_payrun_model
node_dbcontext -->|"maps"| node_paydetail_model

click node_web "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Program.cs"
click node_identity_pages "https://github.com/chaitanyapuranik/payrollmanagementsystem/tree/master/Areas/Identity/Pages"
click node_app_user "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Areas/Identity/Data/AppUser.cs"
click node_registration "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Areas/Identity/Pages/Account/Register.cshtml.cs"
click node_profile "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/User/Profile/Index.cshtml.cs"
click node_user_home "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/User/Index.cshtml.cs"
click node_timesheet_edit "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/User/Timesheets/Edit.cshtml.cs"
click node_timesheet_service "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Implementations/TimesheetService.cs"
click node_timesheet_interface "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Interfaces/ITimesheetService.cs"
click node_admin_dashboard "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/Index.cshtml.cs"
click node_timesheet_review "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/Timesheets/Review.cshtml.cs"
click node_timesheet_list "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/Timesheets/Index.cshtml.cs"
click node_payroll_generate "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/PayrollRuns/Generate.cshtml.cs"
click node_payroll_service "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Implementations/PayrollService.cs"
click node_payroll_interface "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Interfaces/IPayrollService.cs"
click node_payroll_history "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/PayrollRuns/Index.cshtml.cs"
click node_payroll_report "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/PayrollRuns/Report.cshtml.cs"
click node_dbcontext "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Data/AppDbContext.cs"
click node_employee_model "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/Employee.cs"
click node_timesheet_model "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/Timesheet.cs"
click node_entry_model "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/TimesheetEntry.cs"
click node_payrun_model "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/PayRun.cs"
click node_paydetail_model "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/PayDetail.cs"
click node_email "https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/EmailSender.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_web,node_identity_pages,node_app_user,node_registration,node_profile,node_email toneBlue
class node_user_home,node_timesheet_edit,node_timesheet_service,node_timesheet_interface,node_admin_dashboard,node_timesheet_review,node_timesheet_list toneAmber
class node_payroll_generate,node_payroll_service,node_payroll_interface,node_payroll_history,node_payroll_report toneMint
class node_dbcontext,node_database,node_employee_model,node_timesheet_model,node_entry_model,node_payrun_model,node_paydetail_model toneRose
class node_employee,node_admin toneIndigo
```

## Components

### Identity and access

- [Razor Pages host](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Program.cs): `Program.cs`
- [Identity pages](https://github.com/chaitanyapuranik/payrollmanagementsystem/tree/master/Areas/Identity/Pages): `Areas/Identity/Pages`
- [Identity user](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Areas/Identity/Data/AppUser.cs): `Areas/Identity/Data/AppUser.cs`
- [Registration](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Areas/Identity/Pages/Account/Register.cshtml.cs): `Areas/Identity/Pages/Account/Register.cshtml.cs`
- [Profile management](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/User/Profile/Index.cshtml.cs): `Pages/User/Profile/Index.cshtml.cs`
- [Email sender](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/EmailSender.cs): `Services/EmailSender.cs`

### Timesheet workflow

- [User dashboard](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/User/Index.cshtml.cs): `Pages/User/Index.cshtml.cs`
- [Timesheet entry](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/User/Timesheets/Edit.cshtml.cs): `Pages/User/Timesheets/Edit.cshtml.cs`
- [Timesheet service](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Implementations/TimesheetService.cs): `Services/Implementations/TimesheetService.cs`
- [Timesheet contract](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Interfaces/ITimesheetService.cs): `Services/Interfaces/ITimesheetService.cs`
- [Admin dashboard](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/Index.cshtml.cs): `Pages/Admin/Index.cshtml.cs`
- [Timesheet review](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/Timesheets/Review.cshtml.cs): `Pages/Admin/Timesheets/Review.cshtml.cs`
- [Submitted timesheets](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/Timesheets/Index.cshtml.cs): `Pages/Admin/Timesheets/Index.cshtml.cs`

### Payroll operations

- [Payroll generation](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/PayrollRuns/Generate.cshtml.cs): `Pages/Admin/PayrollRuns/Generate.cshtml.cs`
- [Payroll service](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Implementations/PayrollService.cs): `Services/Implementations/PayrollService.cs`
- [Payroll contract](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Services/Interfaces/IPayrollService.cs): `Services/Interfaces/IPayrollService.cs`
- [Run history](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/PayrollRuns/Index.cshtml.cs): `Pages/Admin/PayrollRuns/Index.cshtml.cs`
- [Payroll report](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Pages/Admin/PayrollRuns/Report.cshtml.cs): `Pages/Admin/PayrollRuns/Report.cshtml.cs`

### Domain and persistence

- [EF Core context](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Data/AppDbContext.cs): `Data/AppDbContext.cs`
- **Application database**
- [Employee records](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/Employee.cs): `Models/Employee.cs`
- [Timesheet records](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/Timesheet.cs): `Models/Timesheet.cs`
- [Daily entries](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/TimesheetEntry.cs): `Models/TimesheetEntry.cs`
- [Pay run records](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/PayRun.cs): `Models/PayRun.cs`
- [Pay details](https://github.com/chaitanyapuranik/payrollmanagementsystem/blob/master/Models/PayDetail.cs): `Models/PayDetail.cs`

### Other components

- **Employee**
- **Administrator**

## Connections

- Employee → Razor Pages host: uses (evidence: `README.md`)
- Administrator → Razor Pages host: uses (evidence: `README.md`)
- Razor Pages host → Identity pages: maps pages (evidence: `Program.cs`)
- Razor Pages host → EF Core context: configures (evidence: `Program.cs`)
- Razor Pages host → Timesheet service: registers (evidence: `Program.cs`)
- Razor Pages host → Payroll service: registers (evidence: `Program.cs`)
- Razor Pages host → Identity user: configures identity (evidence: `Program.cs`)
- Razor Pages host → Email sender: registers (evidence: `Program.cs`)
- Registration → Identity user: creates (evidence: `Areas/Identity/Pages/Account/Register.cshtml.cs`)
- Registration → Employee records: creates (evidence: `Areas/Identity/Pages/Account/Register.cshtml.cs`)
- Registration → EF Core context: persists (evidence: `Areas/Identity/Pages/Account/Register.cshtml.cs`)
- Profile management → EF Core context: reads and updates (evidence: `Pages/User/Profile/Index.cshtml.cs`)
- User dashboard → EF Core context: reads (evidence: `Pages/User/Index.cshtml.cs`)
- Timesheet entry → Timesheet contract: calls (evidence: `Pages/User/Timesheets/Edit.cshtml.cs`)
- Timesheet service → EF Core context: reads and writes (evidence: `Services/Implementations/TimesheetService.cs`)
- Timesheet service → Timesheet contract: implements (evidence: `Services/Implementations/TimesheetService.cs`)
- Timesheet service → Timesheet records: loads and saves (evidence: `Services/Implementations/TimesheetService.cs`)
- Timesheet service → Daily entries: loads and saves (evidence: `Services/Implementations/TimesheetService.cs`)
- Admin dashboard → Timesheet contract: calls (evidence: `Pages/Admin/Index.cshtml.cs`)
- Admin dashboard → Payroll contract: calls (evidence: `Pages/Admin/Index.cshtml.cs`)
- Timesheet review → Timesheet contract: calls (evidence: `Pages/Admin/Timesheets/Review.cshtml.cs`)
- Submitted timesheets → Timesheet contract: calls (evidence: `Pages/Admin/Timesheets/Index.cshtml.cs`)
- Payroll generation → Timesheet contract: reads submissions (evidence: `Pages/Admin/PayrollRuns/Generate.cshtml.cs`)
- Payroll generation → Payroll contract: starts run (evidence: `Pages/Admin/PayrollRuns/Generate.cshtml.cs`)
- Payroll service → Payroll contract: implements (evidence: `Services/Implementations/PayrollService.cs`)
- Payroll service → EF Core context: reads and writes (evidence: `Services/Implementations/PayrollService.cs`)
- Payroll service → Pay run records: creates (evidence: `Services/Implementations/PayrollService.cs`)
- Payroll service → Pay details: calculates and creates (evidence: `Services/Implementations/PayrollService.cs`)
- Run history → Payroll contract: calls (evidence: `Pages/Admin/PayrollRuns/Index.cshtml.cs`)
- Payroll report → Payroll contract: calls (evidence: `Pages/Admin/PayrollRuns/Report.cshtml.cs`)
- EF Core context → Application database: persists entities (evidence: `Data/AppDbContext.cs`)
- EF Core context → Identity user: stores identity (evidence: `Data/AppDbContext.cs`)
- EF Core context → Employee records: maps (evidence: `Data/AppDbContext.cs`)
- EF Core context → Timesheet records: maps (evidence: `Data/AppDbContext.cs`)
- EF Core context → Daily entries: maps (evidence: `Data/AppDbContext.cs`)
- EF Core context → Pay run records: maps (evidence: `Data/AppDbContext.cs`)
- EF Core context → Pay details: maps (evidence: `Data/AppDbContext.cs`)
