# rumaraenggai/erpsys architecture

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

- Interactive diagram: https://gitdiagram.com/rumaraenggai/erpsys
- Repository: https://github.com/rumaraenggai/erpsys

## Overview

MiniERP is a Flask-based internal ERP for employee administration, project planning and execution, time tracking, attendance, leave, and payroll. Users enter through the web app, authenticate, and use role-protected modules that read or update the ERP and timesheet databases; dashboards and reports present operational results. Separate scheduled commands send pending-work digests and project deadline alerts. The README documents biometric-device sync and statutory payroll, while the tree identifies additional reporting, AI, and export modules. Several module excerpts were not sampled, so their documented capabilities are shown without speculative internal call chains.

Main entry points: [`app.py`](https://github.com/rumaraenggai/erpsys/blob/main/app.py) (Flask application), [`data/erp.db`](https://github.com/rumaraenggai/erpsys/blob/main/data/erp.db) (ERP database), [`modules/dashboard.py`](https://github.com/rumaraenggai/erpsys/blob/main/modules/dashboard.py) (Dashboard), [`modules/salary.py`](https://github.com/rumaraenggai/erpsys/blob/main/modules/salary.py) (Payroll and increments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry and access"]
  node_app["Flask application<br/>[app.py]"]
  node_auth["Authentication and roles<br/>[auth.py]"]
end

subgraph group_work["People and work"]
  node_hr["Employee records<br/>[hr.py]"]
  node_projects["Project planning<br/>[projects.py]"]
  node_tasks["Task management<br/>[tasks.py]"]
  node_timesheet["Time logging and imports<br/>[timesheet.py]"]
  node_leave["Leave management<br/>[leave.py]"]
end

subgraph group_payroll["Attendance and payroll"]
  node_salary["Payroll and increments<br/>[salary.py]"]
  node_biometric["Biometric attendance<br/>[biometric.py]"]
  node_holidays["Holidays<br/>[holidays.py]"]
  node_payslip["Payslip PDF<br/>[pdf_payslip.py]"]
  node_payroll_export["Payroll spreadsheet<br/>[excel_payroll.py]"]
end

subgraph group_insight["Insights and notifications"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_reports["Reports<br/>[reports.py]"]
  node_project_insights["Project insights"]
  node_digest["Daily work digest<br/>[daily_digest.py]"]
  node_deadline["Deadline alerts<br/>[deadline_alerts.py]"]
  node_email["Email dispatch<br/>[email_dispatch.py]"]
  node_ai["AI insights and settings<br/>[insight_ai.py]"]
end

subgraph group_state["Persistent state"]
  node_db[("ERP database<br/>[erp.db]")]
  node_timesheet_db[("Timesheet database<br/>[timesheets.db]")]
end

node_employee(("ERP user"))
node_biometric_device["ESSL-compatible device"]
node_smtp["SMTP service"]

node_employee -->|"uses"| node_app
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_hr
node_app -->|"registers"| node_projects
node_app -->|"registers"| node_tasks
node_app -->|"registers"| node_timesheet
node_app -->|"registers"| node_leave
node_app -->|"registers"| node_salary
node_app -->|"registers"| node_biometric
node_app -->|"registers"| node_dashboard
node_app -->|"registers"| node_reports
node_app -->|"registers"| node_holidays
node_app -->|"initializes"| node_db
node_app -->|"invokes command"| node_digest
node_app -->|"invokes command"| node_deadline
node_auth -->|"reads and writes"| node_db
node_hr -->|"reads and writes"| node_db
node_projects -->|"reads and writes"| node_db
node_projects -->|"reads"| node_timesheet_db
node_tasks -->|"reads and writes"| node_db
node_timesheet -->|"reads and writes"| node_db
node_timesheet -->|"imports and logs"| node_timesheet_db
node_leave -->|"reads and writes"| node_db
node_dashboard -->|"reads"| node_db
node_dashboard -->|"reads"| node_timesheet_db
node_dashboard -->|"generates insights"| node_project_insights
node_dashboard -->|"reads increment reviews"| node_db
node_reports -->|"reads"| node_db
node_salary -->|"reads and writes"| node_db
node_biometric -->|"records attendance"| node_db
node_biometric -.->|"pulls punches"| node_biometric_device
node_holidays -->|"reads and writes"| node_db
node_payslip -->|"renders payroll data"| node_salary
node_payroll_export -->|"exports payroll data"| node_salary
node_digest -->|"reads pending work"| node_db
node_digest -->|"dispatches digests"| node_email
node_deadline -->|"reads deadlines"| node_db
node_deadline -->|"dispatches alerts"| node_email
node_email -->|"sends mail"| node_smtp
node_ai -->|"reads configuration"| node_db

click node_app "https://github.com/rumaraenggai/erpsys/blob/main/app.py"
click node_auth "https://github.com/rumaraenggai/erpsys/blob/main/modules/auth.py"
click node_hr "https://github.com/rumaraenggai/erpsys/blob/main/modules/hr.py"
click node_projects "https://github.com/rumaraenggai/erpsys/blob/main/modules/projects.py"
click node_tasks "https://github.com/rumaraenggai/erpsys/blob/main/modules/tasks.py"
click node_timesheet "https://github.com/rumaraenggai/erpsys/blob/main/modules/timesheet.py"
click node_leave "https://github.com/rumaraenggai/erpsys/blob/main/modules/leave.py"
click node_dashboard "https://github.com/rumaraenggai/erpsys/blob/main/modules/dashboard.py"
click node_reports "https://github.com/rumaraenggai/erpsys/blob/main/modules/reports.py"
click node_project_insights "https://github.com/rumaraenggai/erpsys/blob/main/modules/project_insights.py"
click node_salary "https://github.com/rumaraenggai/erpsys/blob/main/modules/salary.py"
click node_biometric "https://github.com/rumaraenggai/erpsys/blob/main/modules/biometric.py"
click node_holidays "https://github.com/rumaraenggai/erpsys/blob/main/modules/holidays.py"
click node_payslip "https://github.com/rumaraenggai/erpsys/blob/main/modules/pdf_payslip.py"
click node_payroll_export "https://github.com/rumaraenggai/erpsys/blob/main/modules/excel_payroll.py"
click node_digest "https://github.com/rumaraenggai/erpsys/blob/main/modules/daily_digest.py"
click node_deadline "https://github.com/rumaraenggai/erpsys/blob/main/modules/deadline_alerts.py"
click node_email "https://github.com/rumaraenggai/erpsys/blob/main/modules/email_dispatch.py"
click node_ai "https://github.com/rumaraenggai/erpsys/blob/main/modules/insight_ai.py"
click node_db "https://github.com/rumaraenggai/erpsys/blob/main/data/erp.db"
click node_timesheet_db "https://github.com/rumaraenggai/erpsys/blob/main/data/timesheets.db"

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_auth,node_employee toneBlue
class node_hr,node_projects,node_tasks,node_timesheet,node_leave toneAmber
class node_salary,node_biometric,node_holidays,node_payslip,node_payroll_export toneMint
class node_dashboard,node_reports,node_project_insights,node_digest,node_deadline,node_email,node_ai toneRose
class node_db,node_timesheet_db,node_biometric_device,node_smtp toneIndigo
```

## Components

### Web entry and access

- [Flask application](https://github.com/rumaraenggai/erpsys/blob/main/app.py): `app.py`
- [Authentication and roles](https://github.com/rumaraenggai/erpsys/blob/main/modules/auth.py): `modules/auth.py`

### People and work

- [Employee records](https://github.com/rumaraenggai/erpsys/blob/main/modules/hr.py): `modules/hr.py`
- [Project planning](https://github.com/rumaraenggai/erpsys/blob/main/modules/projects.py): `modules/projects.py`
- [Task management](https://github.com/rumaraenggai/erpsys/blob/main/modules/tasks.py): `modules/tasks.py`
- [Time logging and imports](https://github.com/rumaraenggai/erpsys/blob/main/modules/timesheet.py): `modules/timesheet.py`
- [Leave management](https://github.com/rumaraenggai/erpsys/blob/main/modules/leave.py): `modules/leave.py`

### Attendance and payroll

- [Payroll and increments](https://github.com/rumaraenggai/erpsys/blob/main/modules/salary.py): `modules/salary.py`
- [Biometric attendance](https://github.com/rumaraenggai/erpsys/blob/main/modules/biometric.py): `modules/biometric.py`
- [Holidays](https://github.com/rumaraenggai/erpsys/blob/main/modules/holidays.py): `modules/holidays.py`
- [Payslip PDF](https://github.com/rumaraenggai/erpsys/blob/main/modules/pdf_payslip.py): `modules/pdf_payslip.py`
- [Payroll spreadsheet](https://github.com/rumaraenggai/erpsys/blob/main/modules/excel_payroll.py): `modules/excel_payroll.py`

### Insights and notifications

- [Dashboard](https://github.com/rumaraenggai/erpsys/blob/main/modules/dashboard.py): `modules/dashboard.py`
- [Reports](https://github.com/rumaraenggai/erpsys/blob/main/modules/reports.py): `modules/reports.py`
- [Project insights](https://github.com/rumaraenggai/erpsys/blob/main/modules/project_insights.py): `modules/project_insights.py`
- [Daily work digest](https://github.com/rumaraenggai/erpsys/blob/main/modules/daily_digest.py): `modules/daily_digest.py`
- [Deadline alerts](https://github.com/rumaraenggai/erpsys/blob/main/modules/deadline_alerts.py): `modules/deadline_alerts.py`
- [Email dispatch](https://github.com/rumaraenggai/erpsys/blob/main/modules/email_dispatch.py): `modules/email_dispatch.py`
- [AI insights and settings](https://github.com/rumaraenggai/erpsys/blob/main/modules/insight_ai.py): `modules/insight_ai.py`

### Persistent state

- [ERP database](https://github.com/rumaraenggai/erpsys/blob/main/data/erp.db): `data/erp.db`
- [Timesheet database](https://github.com/rumaraenggai/erpsys/blob/main/data/timesheets.db): `data/timesheets.db`

### Other components

- **ERP user**
- **ESSL-compatible device**
- **SMTP service**

## Connections

- ERP user → Flask application: uses
- Flask application → Authentication and roles: registers
- Flask application → Employee records: registers
- Flask application → Project planning: registers
- Flask application → Task management: registers
- Flask application → Time logging and imports: registers
- Flask application → Leave management: registers
- Flask application → Payroll and increments: registers
- Flask application → Biometric attendance: registers
- Flask application → Dashboard: registers
- Flask application → Reports: registers
- Flask application → Holidays: registers
- Flask application → ERP database: initializes
- Flask application → Daily work digest: invokes command
- Flask application → Deadline alerts: invokes command
- Authentication and roles → ERP database: reads and writes
- Employee records → ERP database: reads and writes
- Project planning → ERP database: reads and writes
- Project planning → Timesheet database: reads
- Task management → ERP database: reads and writes
- Time logging and imports → ERP database: reads and writes
- Time logging and imports → Timesheet database: imports and logs
- Leave management → ERP database: reads and writes
- Dashboard → ERP database: reads
- Dashboard → Timesheet database: reads
- Dashboard → Project insights: generates insights
- Dashboard → ERP database: reads increment reviews
- Reports → ERP database: reads
- Payroll and increments → ERP database: reads and writes
- Biometric attendance → ERP database: records attendance
- Biometric attendance → ESSL-compatible device: pulls punches
- Holidays → ERP database: reads and writes
- Payslip PDF → Payroll and increments: renders payroll data
- Payroll spreadsheet → Payroll and increments: exports payroll data
- Daily work digest → ERP database: reads pending work
- Daily work digest → Email dispatch: dispatches digests
- Deadline alerts → ERP database: reads deadlines
- Deadline alerts → Email dispatch: dispatches alerts
- Email dispatch → SMTP service: sends mail
- AI insights and settings → ERP database: reads configuration
