# lnconcinnity/paywise-is101-mp-final_project architecture

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

- Interactive diagram: https://gitdiagram.com/lnconcinnity/paywise-is101-mp-final_project
- Repository: https://github.com/lnconcinnity/paywise-is101-mp-final_project

## Overview

This is a terminal-based HR and payroll application. The principal workflow is to maintain employee records, log attendance, compute salary and statutory deductions, then preview and generate individual or departmental payslips; separate screens support reports and pay-period locking. The terminal UI provides input, layout, and rendering for those workflows. Several page and domain modules are represented from the source index rather than inspected excerpts, so those relationships are included only where the index or shown code supports them.

Main entry points: [`app/modules/Salary.py`](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Salary.py) (Salary computation), [`app/modules/Persistence.py`](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Persistence.py) (Persistence), [`app/modules/Employees.py`](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Employees.py) (Employee management), [`app/layout.py`](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/layout.py) (Page layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["Application entry<br/>[main.py]"]
  node_bootstrap["Bootstrap<br/>[__init__.py]"]
  node_layout["Page layout<br/>[layout.py]"]
  node_login["Login screen<br/>[LoginPage.py]"]
  node_employee_page["Employee records screen"]
  node_payroll_page["Payroll generation screen"]
  node_reports_page["Reports and locking screen"]
end

subgraph group_ui["Terminal UI"]
  node_forms["Form panel<br/>[FormPanel.py]"]
  node_actions["Action page<br/>[ActionPage.py]"]
  node_preview["Live preview<br/>[LivePreview.py]"]
  node_terminal_runtime["Terminal scheduler<br/>[__init__.py]"]
  node_input["Input handling<br/>[InputHandler.py]"]
  node_renderer["Terminal renderer<br/>[Renderer.py]"]
  node_drawable["Drawable base<br/>[Drawable.py]"]
end

subgraph group_people["Employee Records"]
  node_employees["Employee management<br/>[Employees.py]"]
  node_user_record["User records<br/>[UserRecord.py]"]
end

subgraph group_payroll["Payroll Operations"]
  node_attendance["Attendance tracking<br/>[Attendance.py]"]
  node_salary["Salary computation<br/>[Salary.py]"]
  node_payslips["Payslip generation<br/>[Payslips.py]"]
  node_reports["Payroll reports<br/>[Reports.py]"]
end

subgraph group_state["State and Persistence"]
  node_periods["Pay periods<br/>[Periods.py]"]
  node_persistence["Persistence<br/>[Persistence.py]"]
  node_global_store["Global application state<br/>[GlobalStore.py]"]
  node_database[("User database<br/>[Databases.py]")]
  node_mockdb[("Table storage<br/>[mockdb.py]")]
  node_change_events["Change notifications<br/>[changes.py]"]
end

node_operator(("HR operator"))

node_operator -->|"uses"| node_terminal_runtime
node_entry -->|"starts"| node_bootstrap
node_bootstrap -->|"loads"| node_layout
node_bootstrap -->|"initializes"| node_persistence
node_layout -->|"selects pages"| node_login
node_layout -.->|"loads pages"| node_employee_page
node_layout -.->|"loads pages"| node_payroll_page
node_layout -.->|"loads pages"| node_reports_page
node_payroll_page -->|"uses"| node_actions
node_payroll_page -->|"uses"| node_forms
node_payroll_page -->|"uses"| node_preview
node_reports_page -->|"uses"| node_actions
node_reports_page -->|"uses"| node_forms
node_payroll_page -->|"requests generation"| node_payslips
node_reports_page -->|"requests reports"| node_reports
node_reports_page -->|"requests locking"| node_persistence
node_employee_page -.->|"uses"| node_employees
node_terminal_runtime -->|"polls"| node_input
node_terminal_runtime -->|"renders with"| node_renderer
node_terminal_runtime -->|"arranges and draws"| node_drawable
node_employees -->|"creates and queries"| node_user_record
node_employees -->|"queries"| node_database
node_user_record -->|"reads and writes"| node_database
node_database -->|"creates table"| node_mockdb
node_attendance -->|"uses records"| node_database
node_attendance -->|"checks period"| node_periods
node_salary -->|"finds employees"| node_employees
node_salary -->|"reads attendance"| node_attendance
node_salary -->|"checks period"| node_periods
node_salary -->|"stores payroll"| node_global_store
node_salary -->|"notifies changes"| node_change_events
node_payslips -->|"reads computed pay"| node_salary
node_payslips -->|"resolves staff"| node_employees
node_payslips -->|"checks period"| node_periods
node_payslips -->|"reads employee data"| node_user_record
node_persistence -->|"persists period"| node_periods
node_persistence -->|"loads state"| node_global_store
node_persistence -->|"persists salary data"| node_salary
node_persistence -->|"persists user data"| node_user_record
node_reports -->|"queries employees"| node_employees
node_reports -->|"reads period"| node_periods
node_reports -->|"reads salary data"| node_salary
node_global_store -.->|"uses database"| node_database

click node_entry "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/main.py"
click node_bootstrap "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/__init__.py"
click node_layout "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/layout.py"
click node_login "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/LoginPage.py"
click node_employee_page "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/EmployeeRecordsPage.py"
click node_payroll_page "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/PayrollGenerationPage.py"
click node_reports_page "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/ReportsPeriodLockingPage.py"
click node_forms "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/components/FormPanel.py"
click node_actions "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/components/ActionPage.py"
click node_preview "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/components/LivePreview.py"
click node_terminal_runtime "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/__init__.py"
click node_input "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/InputHandler.py"
click node_renderer "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/Renderer.py"
click node_drawable "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/tui/Drawable.py"
click node_employees "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Employees.py"
click node_user_record "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/UserRecord.py"
click node_attendance "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Attendance.py"
click node_salary "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Salary.py"
click node_payslips "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Payslips.py"
click node_reports "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Reports.py"
click node_periods "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Periods.py"
click node_persistence "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Persistence.py"
click node_global_store "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/GlobalStore.py"
click node_database "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Databases.py"
click node_mockdb "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/lib/mockdb.py"
click node_change_events "https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/lib/changes.py"

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_entry,node_bootstrap,node_layout,node_login,node_employee_page,node_payroll_page,node_reports_page toneBlue
class node_forms,node_actions,node_preview,node_terminal_runtime,node_input,node_renderer,node_drawable toneAmber
class node_employees,node_user_record toneMint
class node_attendance,node_salary,node_payslips,node_reports toneRose
class node_periods,node_persistence,node_global_store,node_database,node_mockdb,node_change_events,node_operator toneIndigo
```

## Components

### Application

- [Application entry](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/main.py): `main.py`
- [Bootstrap](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/__init__.py): `app/__init__.py`
- [Page layout](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/layout.py): `app/layout.py`
- [Login screen](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/LoginPage.py): `app/pages/LoginPage.py`
- [Employee records screen](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/EmployeeRecordsPage.py): `app/pages/EmployeeRecordsPage.py`
- [Payroll generation screen](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/PayrollGenerationPage.py): `app/pages/PayrollGenerationPage.py`
- [Reports and locking screen](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/pages/ReportsPeriodLockingPage.py): `app/pages/ReportsPeriodLockingPage.py`

### Terminal UI

- [Form panel](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/components/FormPanel.py): `app/components/FormPanel.py`
- [Action page](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/components/ActionPage.py): `app/components/ActionPage.py`
- [Live preview](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/components/LivePreview.py): `app/components/LivePreview.py`
- [Terminal scheduler](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/__init__.py): `terminal/__init__.py`
- [Input handling](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/InputHandler.py): `terminal/InputHandler.py`
- [Terminal renderer](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/Renderer.py): `terminal/Renderer.py`
- [Drawable base](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/terminal/tui/Drawable.py): `terminal/tui/Drawable.py`

### Employee Records

- [Employee management](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Employees.py): `app/modules/Employees.py`
- [User records](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/UserRecord.py): `app/modules/UserRecord.py`

### Payroll Operations

- [Attendance tracking](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Attendance.py): `app/modules/Attendance.py`
- [Salary computation](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Salary.py): `app/modules/Salary.py`
- [Payslip generation](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Payslips.py): `app/modules/Payslips.py`
- [Payroll reports](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Reports.py): `app/modules/Reports.py`

### State and Persistence

- [Pay periods](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Periods.py): `app/modules/Periods.py`
- [Persistence](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Persistence.py): `app/modules/Persistence.py`
- [Global application state](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/GlobalStore.py): `app/modules/GlobalStore.py`
- [User database](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/modules/Databases.py): `app/modules/Databases.py`
- [Table storage](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/lib/mockdb.py): `app/lib/mockdb.py`
- [Change notifications](https://github.com/lnconcinnity/paywise-is101-mp-final_project/blob/main/app/lib/changes.py): `app/lib/changes.py`

### Other components

- **HR operator**

## Connections

- HR operator → Terminal scheduler: uses (evidence: `terminal/__init__.py`)
- Application entry → Bootstrap: starts (evidence: `main.py`)
- Bootstrap → Page layout: loads (evidence: `app/__init__.py`)
- Bootstrap → Persistence: initializes (evidence: `app/__init__.py`)
- Page layout → Login screen: selects pages (evidence: `app/layout.py`)
- Page layout → Employee records screen: loads pages
- Page layout → Payroll generation screen: loads pages (evidence: `app/layout.py`)
- Page layout → Reports and locking screen: loads pages (evidence: `app/layout.py`)
- Payroll generation screen → Action page: uses (evidence: `app/pages/PayrollGenerationPage.py`)
- Payroll generation screen → Form panel: uses (evidence: `app/pages/PayrollGenerationPage.py`)
- Payroll generation screen → Live preview: uses (evidence: `app/pages/PayrollGenerationPage.py`)
- Reports and locking screen → Action page: uses (evidence: `app/pages/ReportsPeriodLockingPage.py`)
- Reports and locking screen → Form panel: uses (evidence: `app/pages/ReportsPeriodLockingPage.py`)
- Payroll generation screen → Payslip generation: requests generation (evidence: `app/pages/PayrollGenerationPage.py`)
- Reports and locking screen → Payroll reports: requests reports (evidence: `app/pages/ReportsPeriodLockingPage.py`)
- Reports and locking screen → Persistence: requests locking (evidence: `app/pages/ReportsPeriodLockingPage.py`)
- Employee records screen → Employee management: uses
- Terminal scheduler → Input handling: polls (evidence: `terminal/__init__.py`)
- Terminal scheduler → Terminal renderer: renders with (evidence: `terminal/__init__.py`)
- Terminal scheduler → Drawable base: arranges and draws (evidence: `terminal/__init__.py`)
- Employee management → User records: creates and queries (evidence: `app/modules/Employees.py`)
- Employee management → User database: queries (evidence: `app/modules/Employees.py`)
- User records → User database: reads and writes (evidence: `app/modules/UserRecord.py`)
- User database → Table storage: creates table (evidence: `app/modules/Databases.py`)
- Attendance tracking → User database: uses records (evidence: `app/modules/Attendance.py`)
- Attendance tracking → Pay periods: checks period (evidence: `app/modules/Attendance.py`)
- Salary computation → Employee management: finds employees (evidence: `app/modules/Salary.py`)
- Salary computation → Attendance tracking: reads attendance (evidence: `app/modules/Salary.py`)
- Salary computation → Pay periods: checks period (evidence: `app/modules/Salary.py`)
- Salary computation → Global application state: stores payroll (evidence: `app/modules/Salary.py`)
- Salary computation → Change notifications: notifies changes (evidence: `app/modules/Salary.py`)
- Payslip generation → Salary computation: reads computed pay (evidence: `app/modules/Payslips.py`)
- Payslip generation → Employee management: resolves staff (evidence: `app/modules/Payslips.py`)
- Payslip generation → Pay periods: checks period (evidence: `app/modules/Payslips.py`)
- Payslip generation → User records: reads employee data (evidence: `app/modules/Payslips.py`)
- Persistence → Pay periods: persists period (evidence: `app/modules/Persistence.py`)
- Persistence → Global application state: loads state (evidence: `app/modules/Persistence.py`)
- Persistence → Salary computation: persists salary data (evidence: `app/modules/Persistence.py`)
- Persistence → User records: persists user data (evidence: `app/modules/Persistence.py`)
- Payroll reports → Employee management: queries employees (evidence: `app/modules/Reports.py`)
- Payroll reports → Pay periods: reads period (evidence: `app/modules/Reports.py`)
- Payroll reports → Salary computation: reads salary data (evidence: `app/modules/Reports.py`)
- Global application state → User database: uses database
