# shahbazahmadbalti/employees-_management architecture

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

- Interactive diagram: https://gitdiagram.com/shahbazahmadbalti/employees-_management
- Repository: https://github.com/shahbazahmadbalti/employees-_management

## Overview

This is a browser-based employee management system. Users authenticate, then the application loads role-appropriate employee and business data and presents dashboard and management views; domain modules handle attendance, scheduling, leave, performance, payroll, communication, and reporting. Firebase Realtime Database and Firebase Authentication provide the visible persistence and identity layer. The README also documents department administration, exports, settings, and backups. Some modules are indexed but not excerpted, so their capabilities are represented without speculative internal call paths.

Main entry points: [`js/main.js`](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/main.js) (Application startup), [`js/core.js`](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/core.js) (Shared state and API), [`js/dashboard.js`](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/dashboard.js) (Dashboard), [`js/attendance.js`](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/attendance.js) (Attendance tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_main["Application startup<br/>[main.js]"]
  node_preferences["User preferences<br/>[prefs.js]"]
  node_navigation["Navigation configuration<br/>[navconfig.js]"]
  node_tables["Live table updates<br/>[tables.js]"]
end

subgraph group_people["People operations"]
  node_employees["Employees and departments<br/>[employees.js]"]
  node_leaders["Leadership views<br/>[leaders.js]"]
end

subgraph group_work["Workforce operations"]
  node_attendance["Attendance tracking<br/>[attendance.js]"]
  node_attendance_builder["Attendance builder<br/>[attmaker.js]"]
  node_schedule["Scheduling<br/>[schedule.js]"]
  node_leave["Leave management<br/>[leave.js]"]
  node_payroll["Payroll<br/>[payroll.js]"]
  node_performance["Performance reviews<br/>[performance.js]"]
end

subgraph group_insights["Insights and communication"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_reports["Reports and exports<br/>[reports.js]"]
  node_logs["Audit and logs<br/>[logs.js]"]
  node_chat["Team chat<br/>[chat.js]"]
  node_tasks["Tasks<br/>[tasks.js]"]
  node_files["Task files<br/>[files.js]"]
  node_notices["Notices and events<br/>[notices.js]"]
  node_notifications["Notifications<br/>[notifications.js]"]
end

subgraph group_platform["Shared platform"]
  node_core["Shared state and API<br/>[core.js]"]
  node_firebase_auth["Firebase Authentication"]
  node_firebase_db[("Firebase Realtime Database")]
  node_telegram["Telegram notifications<br/>[telegram-notify.js]"]
end

node_employee(("Employee"))
node_login["Sign-in page<br/>[login.html]"]

node_employee -->|"signs in"| node_login
node_login -->|"opens app"| node_main
node_main -->|"initializes session"| node_firebase_auth
node_main -->|"loads and renders"| node_employees
node_main -->|"renders"| node_leave
node_main -->|"renders"| node_performance
node_main -->|"renders"| node_payroll
node_main -->|"renders"| node_dashboard
node_main -->|"fetches schedule"| node_schedule
node_main -->|"starts watchers"| node_tables
node_main -->|"updates"| node_notifications
node_main -->|"loads shared state"| node_core
node_employees -->|"uses API"| node_core
node_employees -->|"creates employee login"| node_firebase_auth
node_attendance -->|"reads and writes logs"| node_firebase_db
node_attendance -->|"uses shared helpers"| node_core
node_attendance_builder -->|"uses shared helpers"| node_core
node_schedule -->|"reads and writes schedules"| node_firebase_db
node_schedule -->|"uses shared helpers"| node_core
node_dashboard -->|"uses attendance metrics"| node_attendance
node_dashboard -->|"looks up shifts"| node_schedule
node_dashboard -->|"reads attendance"| node_firebase_db
node_payroll -->|"reads schedule data"| node_firebase_db
node_payroll -->|"uses API"| node_core
node_reports -->|"uses attendance calculations"| node_attendance
node_reports -->|"uses shared helpers"| node_core
node_chat -->|"reads and writes chat"| node_firebase_db
node_chat -->|"uses shared helpers"| node_core
node_tasks -->|"uploads and opens files"| node_files
node_tasks -->|"uses shared helpers"| node_core
node_core -->|"wraps database access"| node_firebase_db
node_core -->|"initializes auth client"| node_firebase_auth

click node_login "https://github.com/shahbazahmadbalti/employees-_management/blob/main/login.html"
click node_main "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/main.js"
click node_employees "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/employees.js"
click node_leaders "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/leaders.js"
click node_attendance "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/attendance.js"
click node_attendance_builder "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/attmaker.js"
click node_schedule "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/schedule.js"
click node_leave "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/leave.js"
click node_payroll "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/payroll.js"
click node_performance "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/performance.js"
click node_dashboard "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/dashboard.js"
click node_reports "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/reports.js"
click node_logs "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/logs.js"
click node_chat "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/chat.js"
click node_tasks "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/tasks.js"
click node_files "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/files.js"
click node_notices "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/notices.js"
click node_notifications "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/notifications.js"
click node_preferences "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/prefs.js"
click node_navigation "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/navconfig.js"
click node_tables "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/tables.js"
click node_core "https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/core.js"
click node_telegram "https://github.com/shahbazahmadbalti/employees-_management/blob/main/api/telegram-notify.js"

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_main,node_preferences,node_navigation,node_tables toneBlue
class node_employees,node_leaders toneAmber
class node_attendance,node_attendance_builder,node_schedule,node_leave,node_payroll,node_performance toneMint
class node_dashboard,node_reports,node_logs,node_chat,node_tasks,node_files,node_notices,node_notifications toneRose
class node_core,node_firebase_auth,node_firebase_db,node_telegram,node_employee toneIndigo
class node_login toneTeal
```

## Components

### Application shell

- [Application startup](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/main.js): `js/main.js`
- [User preferences](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/prefs.js): `js/prefs.js`
- [Navigation configuration](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/navconfig.js): `js/navconfig.js`
- [Live table updates](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/tables.js): `js/tables.js`

### People operations

- [Employees and departments](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/employees.js): `js/employees.js`
- [Leadership views](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/leaders.js): `js/leaders.js`

### Workforce operations

- [Attendance tracking](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/attendance.js): `js/attendance.js`
- [Attendance builder](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/attmaker.js): `js/attmaker.js`
- [Scheduling](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/schedule.js): `js/schedule.js`
- [Leave management](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/leave.js): `js/leave.js`
- [Payroll](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/payroll.js): `js/payroll.js`
- [Performance reviews](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/performance.js): `js/performance.js`

### Insights and communication

- [Dashboard](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/dashboard.js): `js/dashboard.js`
- [Reports and exports](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/reports.js): `js/reports.js`
- [Audit and logs](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/logs.js): `js/logs.js`
- [Team chat](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/chat.js): `js/chat.js`
- [Tasks](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/tasks.js): `js/tasks.js`
- [Task files](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/files.js): `js/files.js`
- [Notices and events](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/notices.js): `js/notices.js`
- [Notifications](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/notifications.js): `js/notifications.js`

### Shared platform

- [Shared state and API](https://github.com/shahbazahmadbalti/employees-_management/blob/main/js/core.js): `js/core.js`
- **Firebase Authentication**
- **Firebase Realtime Database**
- [Telegram notifications](https://github.com/shahbazahmadbalti/employees-_management/blob/main/api/telegram-notify.js): `api/telegram-notify.js`

### Other components

- **Employee**
- [Sign-in page](https://github.com/shahbazahmadbalti/employees-_management/blob/main/login.html): `login.html`

## Connections

- Employee → Sign-in page: signs in (evidence: `README.md`)
- Sign-in page → Application startup: opens app (evidence: `js/main.js`)
- Application startup → Firebase Authentication: initializes session (evidence: `js/main.js`)
- Application startup → Employees and departments: loads and renders (evidence: `js/main.js`)
- Application startup → Leave management: renders (evidence: `js/main.js`)
- Application startup → Performance reviews: renders (evidence: `js/main.js`)
- Application startup → Payroll: renders (evidence: `js/main.js`)
- Application startup → Dashboard: renders (evidence: `js/main.js`)
- Application startup → Scheduling: fetches schedule (evidence: `js/main.js`)
- Application startup → Live table updates: starts watchers (evidence: `js/main.js`)
- Application startup → Notifications: updates (evidence: `js/main.js`)
- Application startup → Shared state and API: loads shared state (evidence: `js/main.js`)
- Employees and departments → Shared state and API: uses API (evidence: `js/employees.js`)
- Employees and departments → Firebase Authentication: creates employee login (evidence: `js/employees.js`)
- Attendance tracking → Firebase Realtime Database: reads and writes logs (evidence: `js/attendance.js`)
- Attendance tracking → Shared state and API: uses shared helpers (evidence: `js/attendance.js`)
- Attendance builder → Shared state and API: uses shared helpers (evidence: `js/attmaker.js`)
- Scheduling → Firebase Realtime Database: reads and writes schedules (evidence: `js/schedule.js`)
- Scheduling → Shared state and API: uses shared helpers (evidence: `js/schedule.js`)
- Dashboard → Attendance tracking: uses attendance metrics (evidence: `js/dashboard.js`)
- Dashboard → Scheduling: looks up shifts (evidence: `js/dashboard.js`)
- Dashboard → Firebase Realtime Database: reads attendance (evidence: `js/dashboard.js`)
- Payroll → Firebase Realtime Database: reads schedule data (evidence: `js/payroll.js`)
- Payroll → Shared state and API: uses API (evidence: `js/payroll.js`)
- Reports and exports → Attendance tracking: uses attendance calculations (evidence: `js/reports.js`)
- Reports and exports → Shared state and API: uses shared helpers (evidence: `js/reports.js`)
- Team chat → Firebase Realtime Database: reads and writes chat (evidence: `js/chat.js`)
- Team chat → Shared state and API: uses shared helpers (evidence: `js/chat.js`)
- Tasks → Task files: uploads and opens files (evidence: `js/tasks.js`)
- Tasks → Shared state and API: uses shared helpers (evidence: `js/tasks.js`)
- Shared state and API → Firebase Realtime Database: wraps database access (evidence: `js/core.js`)
- Shared state and API → Firebase Authentication: initializes auth client (evidence: `js/core.js`)
