# sampathvulli7/paypulsepayrollsystem architecture

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

- Interactive diagram: https://gitdiagram.com/sampathvulli7/paypulsepayrollsystem
- Repository: https://github.com/sampathvulli7/paypulsepayrollsystem

## Overview

PayPulse is a Java payroll-management CLI. Users enter through the role-selection portal: managers authenticate to administer staff, configure perks and attendance, run payroll, and import or export records; employees can access only their own payslip, benefits, and attendance. Payroll uses polymorphic employee models, then produces payslips and file-based exports. The README documents the wider feature set; some connections to unsampled modules are therefore documented rather than source-verified.

Main entry points: [`src/edu/gitam/oop/payroll/ui/PayrollRouter.java`](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/PayrollRouter.java) (Role portals), [`src/edu/gitam/oop/payroll/service/FileStorageService.java`](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/FileStorageService.java) (File import/export), [`src/edu/gitam/oop/payroll/model/Employee.java`](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/model/Employee.java) (Employee models), [`src/edu/gitam/oop/payroll/model/PaySlip.java`](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/model/PaySlip.java) (Payslip model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application and portals"]
  node_app["Application entry<br/>[MainApp.java]"]
  node_router["Role portals<br/>[PayrollRouter.java]"]
  node_input["Input handling<br/>[InputHelper.java]"]
  node_theme["Terminal theme<br/>[PayrollTheme.java]"]
end

subgraph group_domain["Payroll domain"]
  node_employees["Employee models<br/>[Employee.java]"]
  node_roles["Role pay models"]
  node_slip["Payslip model<br/>[PaySlip.java]"]
  node_contracts["Payroll contracts"]
  node_exceptions["Payroll exceptions"]
  node_constants["Payroll constants"]
  node_perks["Perk bitmasks"]
end

subgraph group_operations["Payroll operations"]
  node_attendance["Attendance tracking"]
  node_calculator["Payroll calculations"]
  node_batch["Batch workers"]
end

subgraph group_records["Payroll records"]
  node_formatter["Payslip formatting"]
  node_storage["File import/export"]
  node_csv["CSV export<br/>[payroll_export.csv]"]
  node_archive["Payslip archive"]
  node_dashboard["HTML audit ledger"]
end

node_user(("CLI user"))

node_user -->|"starts"| node_app
node_app -->|"launches"| node_router
node_router -->|"reads input"| node_input
node_router -->|"prints portal"| node_theme
node_router -->|"authenticates staff"| node_employees
node_roles -->|"extends"| node_employees
node_employees -->|"implements"| node_contracts
node_employees -->|"calculates perks"| node_perks
node_perks -->|"uses masks"| node_constants
node_router -->|"configures perks"| node_perks
node_router -->|"logs overtime"| node_attendance
node_attendance -->|"updates attendance"| node_employees
node_router -->|"awards bonuses"| node_calculator
node_router -->|"starts workers"| node_batch
node_batch -->|"creates slips"| node_slip
node_slip -->|"calculates breakdown"| node_employees
node_router -->|"imports roster"| node_storage
node_router -->|"exports payroll"| node_storage
node_storage -->|"reconstructs roster"| node_employees
node_storage -->|"generates missing slips"| node_slip
node_storage -->|"formats archive"| node_formatter
node_formatter -->|"renders slip"| node_slip
node_storage -->|"writes CSV"| node_csv
node_storage -->|"writes archive"| node_archive
node_storage -->|"syncs ledger"| node_dashboard

click node_app "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/MainApp.java"
click node_router "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/PayrollRouter.java"
click node_input "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/InputHelper.java"
click node_theme "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/PayrollTheme.java"
click node_employees "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/model/Employee.java"
click node_roles "https://github.com/sampathvulli7/paypulsepayrollsystem/tree/main/src/edu/gitam/oop/payroll/model"
click node_slip "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/model/PaySlip.java"
click node_contracts "https://github.com/sampathvulli7/paypulsepayrollsystem/tree/main/src/edu/gitam/oop/payroll/contract"
click node_exceptions "https://github.com/sampathvulli7/paypulsepayrollsystem/tree/main/src/edu/gitam/oop/payroll/exception"
click node_constants "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/util/PayrollConstants.java"
click node_perks "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/util/PerkBitmaskUtil.java"
click node_attendance "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/AttendanceTracker.java"
click node_calculator "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/PayrollCalculator.java"
click node_batch "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/PayrollBatchWorker.java"
click node_formatter "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/PayslipFormatter.java"
click node_storage "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/FileStorageService.java"
click node_csv "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/data/payroll_export.csv"
click node_archive "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/data/payslips_archive.txt"
click node_dashboard "https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/data/payroll_dashboard.html"

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_router,node_input,node_theme,node_user toneBlue
class node_employees,node_roles,node_slip,node_contracts,node_exceptions,node_constants,node_perks toneAmber
class node_attendance,node_calculator,node_batch toneMint
class node_formatter,node_storage,node_csv,node_archive,node_dashboard toneRose
```

## Components

### Application and portals

- [Application entry](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/MainApp.java): `src/edu/gitam/oop/payroll/MainApp.java`
- [Role portals](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/PayrollRouter.java): `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`
- [Input handling](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/InputHelper.java): `src/edu/gitam/oop/payroll/ui/InputHelper.java`
- [Terminal theme](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/ui/PayrollTheme.java): `src/edu/gitam/oop/payroll/ui/PayrollTheme.java`

### Payroll domain

- [Employee models](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/model/Employee.java): `src/edu/gitam/oop/payroll/model/Employee.java`
- [Role pay models](https://github.com/sampathvulli7/paypulsepayrollsystem/tree/main/src/edu/gitam/oop/payroll/model): `src/edu/gitam/oop/payroll/model`
- [Payslip model](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/model/PaySlip.java): `src/edu/gitam/oop/payroll/model/PaySlip.java`
- [Payroll contracts](https://github.com/sampathvulli7/paypulsepayrollsystem/tree/main/src/edu/gitam/oop/payroll/contract): `src/edu/gitam/oop/payroll/contract`
- [Payroll exceptions](https://github.com/sampathvulli7/paypulsepayrollsystem/tree/main/src/edu/gitam/oop/payroll/exception): `src/edu/gitam/oop/payroll/exception`
- [Payroll constants](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/util/PayrollConstants.java): `src/edu/gitam/oop/payroll/util/PayrollConstants.java`
- [Perk bitmasks](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/util/PerkBitmaskUtil.java): `src/edu/gitam/oop/payroll/util/PerkBitmaskUtil.java`

### Payroll operations

- [Attendance tracking](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/AttendanceTracker.java): `src/edu/gitam/oop/payroll/service/AttendanceTracker.java`
- [Payroll calculations](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/PayrollCalculator.java): `src/edu/gitam/oop/payroll/service/PayrollCalculator.java`
- [Batch workers](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/PayrollBatchWorker.java): `src/edu/gitam/oop/payroll/service/PayrollBatchWorker.java`

### Payroll records

- [Payslip formatting](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/PayslipFormatter.java): `src/edu/gitam/oop/payroll/service/PayslipFormatter.java`
- [File import/export](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/src/edu/gitam/oop/payroll/service/FileStorageService.java): `src/edu/gitam/oop/payroll/service/FileStorageService.java`
- [CSV export](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/data/payroll_export.csv): `data/payroll_export.csv`
- [Payslip archive](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/data/payslips_archive.txt): `data/payslips_archive.txt`
- [HTML audit ledger](https://github.com/sampathvulli7/paypulsepayrollsystem/blob/main/data/payroll_dashboard.html): `data/payroll_dashboard.html`

### Other components

- **CLI user**

## Connections

- CLI user → Application entry: starts (evidence: `README.md`)
- Application entry → Role portals: launches (evidence: `src/edu/gitam/oop/payroll/MainApp.java`)
- Role portals → Input handling: reads input (evidence: `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`)
- Role portals → Terminal theme: prints portal (evidence: `src/edu/gitam/oop/payroll/MainApp.java`)
- Role portals → Employee models: authenticates staff (evidence: `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`)
- Role pay models → Employee models: extends (evidence: `src/edu/gitam/oop/payroll/model/Manager.java`)
- Employee models → Payroll contracts: implements (evidence: `src/edu/gitam/oop/payroll/model/Employee.java`)
- Employee models → Perk bitmasks: calculates perks (evidence: `src/edu/gitam/oop/payroll/model/Employee.java`)
- Perk bitmasks → Payroll constants: uses masks (evidence: `src/edu/gitam/oop/payroll/util/PerkBitmaskUtil.java`)
- Role portals → Perk bitmasks: configures perks (evidence: `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`)
- Role portals → Attendance tracking: logs overtime (evidence: `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`)
- Attendance tracking → Employee models: updates attendance (evidence: `src/edu/gitam/oop/payroll/service/AttendanceTracker.java`)
- Role portals → Payroll calculations: awards bonuses (evidence: `README.md`)
- Role portals → Batch workers: starts workers (evidence: `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`)
- Batch workers → Payslip model: creates slips (evidence: `src/edu/gitam/oop/payroll/service/PayrollBatchWorker.java`)
- Payslip model → Employee models: calculates breakdown (evidence: `src/edu/gitam/oop/payroll/model/PaySlip.java`)
- Role portals → File import/export: imports roster (evidence: `src/edu/gitam/oop/payroll/ui/PayrollRouter.java`)
- Role portals → File import/export: exports payroll (evidence: `README.md`)
- File import/export → Employee models: reconstructs roster (evidence: `src/edu/gitam/oop/payroll/service/FileStorageService.java`)
- File import/export → Payslip model: generates missing slips (evidence: `src/edu/gitam/oop/payroll/service/FileStorageService.java`)
- File import/export → Payslip formatting: formats archive (evidence: `src/edu/gitam/oop/payroll/service/FileStorageService.java`)
- Payslip formatting → Payslip model: renders slip (evidence: `src/edu/gitam/oop/payroll/service/PayslipFormatter.java`)
- File import/export → CSV export: writes CSV (evidence: `src/edu/gitam/oop/payroll/service/FileStorageService.java`)
- File import/export → Payslip archive: writes archive (evidence: `src/edu/gitam/oop/payroll/service/FileStorageService.java`)
- File import/export → HTML audit ledger: syncs ledger (evidence: `src/edu/gitam/oop/payroll/service/FileStorageService.java`)
