# dreamybriary/biringan-employee-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/dreamybriary/biringan-employee-management-system
- Repository: https://github.com/dreamybriary/biringan-employee-management-system

## Overview

Biri-Go is a Flask employee-management system with role-specific browser portals backed by shared MySQL records; it can also run in a native desktop window. The principal workflow is staff sign-in, role-authorized portal actions, and database-backed results such as employee records, attendance, leave decisions, payroll, and reports. HR, admin, owner, and employee capabilities are distinct. The README documents several major features whose detailed implementation was not sampled; those are represented at their documented route or subsystem level. Edges are limited to documented relationships or sampled caller behavior.

Main entry points: [`system/backend/routes/admin.py`](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py) (Admin portal), [`system/backend/routes/employee.py`](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/employee.py) (Employee portal), [`system/backend/routes/hr.py`](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py) (HR portal), [`system/backend/main.py`](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/main.py) (Sign-in and activity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and portals"]
  node_login["Sign-in and activity<br/>[main.py]"]
  node_admin["Admin portal<br/>[admin.py]"]
  node_hr["HR portal<br/>[hr.py]"]
  node_owner["Owner portal<br/>[owner.py]"]
  node_employee["Employee portal<br/>[employee.py]"]
  node_portal_ui["Portal pages and scripts"]
end

subgraph group_people["People operations"]
  node_accounts["Employee accounts<br/>[main.py]"]
  node_org["Departments and positions<br/>[admin.py]"]
  node_attendance["Attendance<br/>[employee.py]"]
  node_leave["Leave management<br/>[admin.py]"]
  node_hr_tools["HR tools and reports<br/>[hr.py]"]
end

subgraph group_payroll["Pay and records"]
  node_payroll_ops["Payroll processing<br/>[hr.py]"]
  node_self_pay["Payslips and acknowledgment<br/>[my_pay.py]"]
  node_documents["Employee documents"]
end

subgraph group_platform["Shared platform"]
  node_backup["Backup and restore<br/>[backup_restore.py]"]
  node_profile["Profile pictures"]
  node_auth["Role authorization<br/>[auth.py]"]
  node_shared["Database access and rules<br/>[db.py]"]
  node_mysql[("MySQL database")]
  node_desktop["Desktop wrapper<br/>[desktop.py]"]
end

node_staff(("Staff user"))

node_staff -->|"signs in"| node_login
node_login -->|"role routes"| node_admin
node_login -->|"role routes"| node_hr
node_login -->|"role routes"| node_owner
node_login -->|"role routes"| node_employee
node_admin -->|"serves portal"| node_portal_ui
node_hr -->|"serves portal"| node_portal_ui
node_owner -->|"serves portal"| node_portal_ui
node_employee -->|"serves portal"| node_portal_ui
node_admin -->|"manages"| node_accounts
node_admin -->|"manages"| node_org
node_hr -->|"records"| node_attendance
node_employee -->|"checks in"| node_attendance
node_employee -->|"requests leave"| node_leave
node_admin -->|"reviews"| node_leave
node_hr -->|"manages"| node_hr_tools
node_hr -->|"generates"| node_payroll_ops
node_employee -->|"views pay"| node_self_pay
node_self_pay -->|"reads payroll"| node_payroll_ops
node_employee -.->|"manages files"| node_documents
node_admin -->|"runs backups"| node_backup
node_staff -->|"updates profile"| node_profile
node_admin -->|"guards actions"| node_auth
node_hr -->|"guards actions"| node_auth
node_owner -->|"guards actions"| node_auth
node_employee -->|"guards actions"| node_auth
node_admin -->|"queries"| node_shared
node_hr -->|"queries"| node_shared
node_owner -->|"queries"| node_shared
node_employee -->|"queries"| node_shared
node_shared -->|"reads and writes"| node_mysql
node_backup -->|"exports and restores"| node_mysql
node_desktop -->|"wraps app"| node_login

click node_login "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/main.py"
click node_admin "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py"
click node_hr "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py"
click node_owner "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/owner.py"
click node_employee "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/employee.py"
click node_portal_ui "https://github.com/dreamybriary/biringan-employee-management-system/tree/main/system/template"
click node_accounts "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/main.py"
click node_org "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py"
click node_attendance "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/employee.py"
click node_leave "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py"
click node_hr_tools "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py"
click node_payroll_ops "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py"
click node_self_pay "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/my_pay.py"
click node_documents "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/employee_documents.py"
click node_backup "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/backup_restore.py"
click node_profile "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/profile_pictures.py"
click node_auth "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/auth.py"
click node_shared "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/db.py"
click node_desktop "https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/desktop.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_login,node_admin,node_hr,node_owner,node_employee,node_portal_ui,node_staff toneBlue
class node_accounts,node_org,node_attendance,node_leave,node_hr_tools toneAmber
class node_payroll_ops,node_self_pay,node_documents toneMint
class node_backup,node_profile,node_auth,node_shared,node_mysql,node_desktop toneRose
```

## Components

### Access and portals

- [Sign-in and activity](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/main.py): `system/backend/main.py`
- [Admin portal](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py): `system/backend/routes/admin.py`
- [HR portal](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py): `system/backend/routes/hr.py`
- [Owner portal](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/owner.py): `system/backend/routes/owner.py`
- [Employee portal](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/employee.py): `system/backend/routes/employee.py`
- [Portal pages and scripts](https://github.com/dreamybriary/biringan-employee-management-system/tree/main/system/template): `system/template`

### People operations

- [Employee accounts](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/main.py): `system/backend/main.py`
- [Departments and positions](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py): `system/backend/routes/admin.py`
- [Attendance](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/employee.py): `system/backend/routes/employee.py`
- [Leave management](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/admin.py): `system/backend/routes/admin.py`
- [HR tools and reports](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py): `system/backend/routes/hr.py`

### Pay and records

- [Payroll processing](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/hr.py): `system/backend/routes/hr.py`
- [Payslips and acknowledgment](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/routes/my_pay.py): `system/backend/routes/my_pay.py`
- [Employee documents](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/employee_documents.py): `system/backend/employee_documents.py`

### Shared platform

- [Backup and restore](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/backup_restore.py): `system/backend/backup_restore.py`
- [Profile pictures](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/profile_pictures.py): `system/backend/profile_pictures.py`
- [Role authorization](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/auth.py): `system/backend/auth.py`
- [Database access and rules](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/db.py): `system/backend/db.py`
- **MySQL database**
- [Desktop wrapper](https://github.com/dreamybriary/biringan-employee-management-system/blob/main/system/backend/desktop.py): `system/backend/desktop.py`

### Other components

- **Staff user**

## Connections

- Staff user → Sign-in and activity: signs in (evidence: `README.md`)
- Sign-in and activity → Admin portal: role routes (evidence: `README.md`)
- Sign-in and activity → HR portal: role routes (evidence: `README.md`)
- Sign-in and activity → Owner portal: role routes (evidence: `README.md`)
- Sign-in and activity → Employee portal: role routes (evidence: `README.md`)
- Admin portal → Portal pages and scripts: serves portal (evidence: `README.md`)
- HR portal → Portal pages and scripts: serves portal (evidence: `README.md`)
- Owner portal → Portal pages and scripts: serves portal (evidence: `README.md`)
- Employee portal → Portal pages and scripts: serves portal (evidence: `README.md`)
- Admin portal → Employee accounts: manages (evidence: `README.md`)
- Admin portal → Departments and positions: manages (evidence: `system/backend/routes/admin.py`)
- HR portal → Attendance: records (evidence: `README.md`)
- Employee portal → Attendance: checks in (evidence: `system/backend/routes/employee.py`)
- Employee portal → Leave management: requests leave (evidence: `system/backend/routes/employee.py`)
- Admin portal → Leave management: reviews (evidence: `system/backend/routes/admin.py`)
- HR portal → HR tools and reports: manages (evidence: `README.md`)
- HR portal → Payroll processing: generates (evidence: `README.md`)
- Employee portal → Payslips and acknowledgment: views pay (evidence: `README.md`)
- Payslips and acknowledgment → Payroll processing: reads payroll (evidence: `system/backend/routes/my_pay.py`)
- Employee portal → Employee documents: manages files (evidence: `README.md`)
- Admin portal → Backup and restore: runs backups (evidence: `README.md`)
- Staff user → Profile pictures: updates profile (evidence: `README.md`)
- Admin portal → Role authorization: guards actions (evidence: `system/backend/routes/admin.py`)
- HR portal → Role authorization: guards actions (evidence: `system/backend/routes/hr.py`)
- Owner portal → Role authorization: guards actions (evidence: `system/backend/routes/owner.py`)
- Employee portal → Role authorization: guards actions (evidence: `system/backend/routes/employee.py`)
- Admin portal → Database access and rules: queries (evidence: `system/backend/routes/admin.py`)
- HR portal → Database access and rules: queries (evidence: `system/backend/routes/hr.py`)
- Owner portal → Database access and rules: queries (evidence: `system/backend/routes/owner.py`)
- Employee portal → Database access and rules: queries (evidence: `system/backend/routes/employee.py`)
- Database access and rules → MySQL database: reads and writes (evidence: `system/backend/db.py`)
- Backup and restore → MySQL database: exports and restores (evidence: `system/backend/backup_restore.py`)
- Desktop wrapper → Sign-in and activity: wraps app (evidence: `system/backend/desktop.py`)
