# rajgohel2908/peoplepay360-hr-payroll architecture

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

- Interactive diagram: https://gitdiagram.com/rajgohel2908/peoplepay360-hr-payroll
- Repository: https://github.com/rajgohel2908/peoplepay360-hr-payroll

## Overview

PeoplePay360 is an HR and payroll application. Staff and employees use the web client to access workforce records, attendance and leave, payroll, payslips, reports, and administration; API routes dispatch requests to domain controllers, which use payroll logic and persistent data. The sampled payrun controller references calculation and validation modules, and the leave controller explicitly calls notification, email, and audit services. Many page and route implementations were not sampled, so their internal interactions are not inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/App.jsx) (Web application), [`client/src/api/client.js`](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/api/client.js) (API client), [`server/database/connection.js`](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/database/connection.js) (Application database), [`server/controllers/payrunController.js`](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/payrunController.js) (Payrun controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Web application<br/>[App.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_reports_ui["Reports"]
  node_admin_ui["Administration<br/>[UserManagement.jsx]"]
  node_dashboard_ui["Dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_workforce["Workforce operations"]
  node_employee_ui["Employee records<br/>[EmployeeList.jsx]"]
  node_employee360_ui["Employee 360<br/>[Employee360.jsx]"]
  node_attendance_ui["Attendance<br/>[AttendanceList.jsx]"]
  node_leave_ui["Time off"]
  node_contracts_ui["Contracts<br/>[ContractList.jsx]"]
  node_schedules_ui["Schedules<br/>[ScheduleList.jsx]"]
  node_ess_ui["Employee portal<br/>[EmployeePortal.jsx]"]
  node_workforce_api["Workforce controllers"]
  node_leave_api["Time-off controller"]
end

subgraph group_payroll["Payroll"]
  node_payroll_ui["Payrun workflow<br/>[PayrunWizard.jsx]"]
  node_payroll_detail_ui["Payroll detail<br/>[PayrollDetail.jsx]"]
  node_validation_ui["Payroll validation"]
  node_salary_ui["Salary structures"]
  node_payslips_ui["Payslips<br/>[PayslipList.jsx]"]
  node_payrun_api["Payrun controller"]
  node_calculator["Payroll calculator<br/>[calculator.js]"]
  node_salary_rules["Salary rule engine"]
  node_validator["Payroll validator<br/>[validator.js]"]
  node_variance["Variance detector"]
end

subgraph group_platform["API platform"]
  node_payrun_routes["Payrun routes<br/>[payrunRoutes.js]"]
  node_api_app["API application<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_rbac["Role authorization<br/>[rbac.js]"]
  node_admin_api["Admin controller<br/>[adminController.js]"]
end

subgraph group_shared["Shared services"]
  node_database[("Application database<br/>[connection.js]")]
  node_audit["Audit logging<br/>[auditService.js]"]
  node_notifications["Notifications"]
  node_email["Email delivery<br/>[emailService.js]"]
end

node_user(("HR / employee"))

node_user -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_employee_ui
node_webapp -->|"routes to"| node_employee360_ui
node_webapp -->|"routes to"| node_attendance_ui
node_webapp -->|"routes to"| node_leave_ui
node_webapp -->|"routes to"| node_payroll_ui
node_webapp -->|"routes to"| node_payroll_detail_ui
node_webapp -->|"routes to"| node_validation_ui
node_webapp -->|"routes to"| node_salary_ui
node_webapp -.->|"may call"| node_api_client
node_employee_ui -.->|"may request data"| node_api_client
node_leave_ui -.->|"may request data"| node_api_client
node_payroll_ui -.->|"may request data"| node_api_client
node_webapp -.->|"calls API"| node_api_app
node_api_app -->|"mounts"| node_payrun_routes
node_payrun_routes -->|"dispatches"| node_payrun_api
node_payrun_routes -->|"authenticates"| node_auth
node_payrun_routes -->|"checks roles"| node_rbac
node_payrun_api -->|"computes with"| node_calculator
node_payrun_api -->|"validates with"| node_validator
node_payrun_api -->|"detects variances"| node_variance
node_calculator -->|"evaluates rules"| node_salary_rules
node_calculator -->|"uses"| node_validator
node_payrun_api -->|"reads and writes"| node_database
node_workforce_api -->|"reads and writes"| node_database
node_leave_api -->|"reads and writes"| node_database
node_leave_api -->|"creates"| node_notifications
node_leave_api -->|"sends"| node_email
node_leave_api -->|"records"| node_audit
node_audit -->|"writes logs"| node_database
node_email -->|"logs delivery"| node_database
node_webapp -.->|"routes to"| node_reports_ui
node_webapp -->|"routes to"| node_admin_ui
node_webapp -.->|"routes to"| node_dashboard_ui
node_api_app -->|"mounts admin routes"| node_admin_api
node_contracts_ui -.->|"may request data"| node_api_client
node_schedules_ui -.->|"may request data"| node_api_client
node_ess_ui -.->|"may request data"| node_api_client
node_payslips_ui -.->|"may request data"| node_api_client
node_payroll_ui -.->|"uses payrun API"| node_payrun_routes
node_salary_ui -.->|"configures payroll data"| node_database

click node_webapp "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/App.jsx"
click node_api_client "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/api/client.js"
click node_employee_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/employees/EmployeeList.jsx"
click node_employee360_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/employees/Employee360.jsx"
click node_attendance_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/attendance/AttendanceList.jsx"
click node_leave_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/timeoff/TimeOffDashboard.jsx"
click node_contracts_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/contracts/ContractList.jsx"
click node_schedules_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/schedules/ScheduleList.jsx"
click node_ess_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/ess/EmployeePortal.jsx"
click node_workforce_api "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/employeeController.js"
click node_leave_api "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/timeOffController.js"
click node_payroll_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payroll/PayrunWizard.jsx"
click node_payroll_detail_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payroll/PayrollDetail.jsx"
click node_validation_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payroll/PayrollValidationCenter.jsx"
click node_salary_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/salary/SalaryStructures.jsx"
click node_payslips_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payslips/PayslipList.jsx"
click node_payrun_routes "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/routes/payrunRoutes.js"
click node_payrun_api "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/payrunController.js"
click node_calculator "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/calculator.js"
click node_salary_rules "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/salaryRuleEngine.js"
click node_validator "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/validator.js"
click node_variance "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/varianceDetector.js"
click node_api_app "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/app.js"
click node_auth "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/middleware/auth.js"
click node_rbac "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/middleware/rbac.js"
click node_database "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/database/connection.js"
click node_audit "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/services/auditService.js"
click node_notifications "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/services/notificationService.js"
click node_email "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/services/emailService.js"
click node_reports_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/reports/ReportsDashboard.jsx"
click node_admin_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/admin/UserManagement.jsx"
click node_admin_api "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/adminController.js"
click node_dashboard_ui "https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/dashboard/Dashboard.jsx"

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_webapp,node_api_client,node_reports_ui,node_admin_ui,node_dashboard_ui toneBlue
class node_employee_ui,node_employee360_ui,node_attendance_ui,node_leave_ui,node_contracts_ui,node_schedules_ui,node_ess_ui,node_workforce_api,node_leave_api toneAmber
class node_payroll_ui,node_payroll_detail_ui,node_validation_ui,node_salary_ui,node_payslips_ui,node_payrun_api,node_calculator,node_salary_rules,node_validator,node_variance toneMint
class node_payrun_routes,node_api_app,node_auth,node_rbac,node_admin_api toneRose
class node_database,node_audit,node_notifications,node_email,node_user toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [API client](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Reports](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/reports/ReportsDashboard.jsx): `client/src/pages/reports/ReportsDashboard.jsx`
- [Administration](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/admin/UserManagement.jsx): `client/src/pages/admin/UserManagement.jsx`
- [Dashboard](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/dashboard/Dashboard.jsx): `client/src/pages/dashboard/Dashboard.jsx`

### Workforce operations

- [Employee records](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/employees/EmployeeList.jsx): `client/src/pages/employees/EmployeeList.jsx`
- [Employee 360](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/employees/Employee360.jsx): `client/src/pages/employees/Employee360.jsx`
- [Attendance](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/attendance/AttendanceList.jsx): `client/src/pages/attendance/AttendanceList.jsx`
- [Time off](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/timeoff/TimeOffDashboard.jsx): `client/src/pages/timeoff/TimeOffDashboard.jsx`
- [Contracts](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/contracts/ContractList.jsx): `client/src/pages/contracts/ContractList.jsx`
- [Schedules](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/schedules/ScheduleList.jsx): `client/src/pages/schedules/ScheduleList.jsx`
- [Employee portal](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/ess/EmployeePortal.jsx): `client/src/pages/ess/EmployeePortal.jsx`
- [Workforce controllers](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/employeeController.js): `server/controllers/employeeController.js`
- [Time-off controller](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/timeOffController.js): `server/controllers/timeOffController.js`

### Payroll

- [Payrun workflow](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payroll/PayrunWizard.jsx): `client/src/pages/payroll/PayrunWizard.jsx`
- [Payroll detail](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payroll/PayrollDetail.jsx): `client/src/pages/payroll/PayrollDetail.jsx`
- [Payroll validation](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payroll/PayrollValidationCenter.jsx): `client/src/pages/payroll/PayrollValidationCenter.jsx`
- [Salary structures](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/salary/SalaryStructures.jsx): `client/src/pages/salary/SalaryStructures.jsx`
- [Payslips](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/client/src/pages/payslips/PayslipList.jsx): `client/src/pages/payslips/PayslipList.jsx`
- [Payrun controller](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/payrunController.js): `server/controllers/payrunController.js`
- [Payroll calculator](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/calculator.js): `server/payroll/calculator.js`
- [Salary rule engine](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/salaryRuleEngine.js): `server/payroll/salaryRuleEngine.js`
- [Payroll validator](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/validator.js): `server/payroll/validator.js`
- [Variance detector](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/payroll/varianceDetector.js): `server/payroll/varianceDetector.js`

### API platform

- [Payrun routes](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/routes/payrunRoutes.js): `server/routes/payrunRoutes.js`
- [API application](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/app.js): `server/app.js`
- [Authentication](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Role authorization](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/middleware/rbac.js): `server/middleware/rbac.js`
- [Admin controller](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/controllers/adminController.js): `server/controllers/adminController.js`

### Shared services

- [Application database](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/database/connection.js): `server/database/connection.js`
- [Audit logging](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/services/auditService.js): `server/services/auditService.js`
- [Notifications](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/services/notificationService.js): `server/services/notificationService.js`
- [Email delivery](https://github.com/rajgohel2908/peoplepay360-hr-payroll/blob/main/server/services/emailService.js): `server/services/emailService.js`

### Other components

- **HR / employee**

## Connections

- HR / employee → Web application: uses
- Web application → Employee records: routes to (evidence: `client/src/App.jsx`)
- Web application → Employee 360: routes to (evidence: `client/src/App.jsx`)
- Web application → Attendance: routes to (evidence: `client/src/App.jsx`)
- Web application → Time off: routes to (evidence: `client/src/App.jsx`)
- Web application → Payrun workflow: routes to (evidence: `client/src/App.jsx`)
- Web application → Payroll detail: routes to (evidence: `client/src/App.jsx`)
- Web application → Payroll validation: routes to (evidence: `client/src/App.jsx`)
- Web application → Salary structures: routes to (evidence: `client/src/App.jsx`)
- Web application → API client: may call
- Employee records → API client: may request data
- Time off → API client: may request data
- Payrun workflow → API client: may request data
- Web application → API application: calls API
- API application → Payrun routes: mounts (evidence: `server/app.js`)
- Payrun routes → Payrun controller: dispatches (evidence: `server/routes/payrunRoutes.js`)
- Payrun routes → Authentication: authenticates (evidence: `server/routes/payrunRoutes.js`)
- Payrun routes → Role authorization: checks roles (evidence: `server/routes/payrunRoutes.js`)
- Payrun controller → Payroll calculator: computes with (evidence: `server/controllers/payrunController.js`)
- Payrun controller → Payroll validator: validates with (evidence: `server/controllers/payrunController.js`)
- Payrun controller → Variance detector: detects variances (evidence: `server/controllers/payrunController.js`)
- Payroll calculator → Salary rule engine: evaluates rules (evidence: `server/payroll/calculator.js`)
- Payroll calculator → Payroll validator: uses (evidence: `server/payroll/calculator.js`)
- Payrun controller → Application database: reads and writes (evidence: `server/controllers/payrunController.js`)
- Workforce controllers → Application database: reads and writes (evidence: `server/controllers/employeeController.js`)
- Time-off controller → Application database: reads and writes (evidence: `server/controllers/timeOffController.js`)
- Time-off controller → Notifications: creates (evidence: `server/controllers/timeOffController.js`)
- Time-off controller → Email delivery: sends (evidence: `server/controllers/timeOffController.js`)
- Time-off controller → Audit logging: records (evidence: `server/controllers/timeOffController.js`)
- Audit logging → Application database: writes logs (evidence: `server/services/auditService.js`)
- Email delivery → Application database: logs delivery (evidence: `server/services/emailService.js`)
- Web application → Reports: routes to (evidence: `client/src/App.jsx`)
- Web application → Administration: routes to (evidence: `client/src/App.jsx`)
- Web application → Dashboard: routes to (evidence: `client/src/App.jsx`)
- API application → Admin controller: mounts admin routes (evidence: `server/app.js`)
- Contracts → API client: may request data
- Schedules → API client: may request data
- Employee portal → API client: may request data
- Payslips → API client: may request data
- Payrun workflow → Payrun routes: uses payrun API
- Salary structures → Application database: configures payroll data
