# kirafkra-bit/cpprog---with-backend-flash-rest-api architecture

> Architecture diagram of the GitHub repository kirafkra-bit/cpprog---with-backend-flash-rest-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kirafkra-bit/cpprog---with-backend-flash-rest-api
- Repository: https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api

## Overview

This is a browser-based HR management application served by Flask. Users register or log in, then view a dashboard and navigate employee management, attendance, leave, payroll, and performance features. The browser fetches Flask API endpoints; the server reads and writes JSON files in data/. The main data-backed modules are explicit in the sampled code. Leave tracking instead uses hard-coded sample entries and browser localStorage. Several listed modules were not sampled, so their internal behavior and page-to-script wiring are not asserted.

Main entry points: [`server.py`](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/server.py) (Flask API & serving), [`Auth`](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/tree/main/Auth) (Login & registration), [`Js/auth-guard.js`](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/auth-guard.js) (Admin authorization), [`data/Attendance.json`](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/Attendance.json) (Attendance records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Navigation"]
  node_auth_forms["Login &amp; registration"]
  node_auth_guard["Admin authorization<br/>[auth-guard.js]"]
  node_navigation["Sidebar navigation<br/>[sidebar.js]"]
end

subgraph group_people["People Operations"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_employee_mgmt["Employee management<br/>[manage.js]"]
end

subgraph group_workforce["Workforce Tracking"]
  node_attendance["Attendance reports<br/>[attendance.js]"]
  node_leave_tracking["Leave calendar<br/>[leaves.js]"]
end

subgraph group_compensation["Compensation &amp; Reviews"]
  node_payroll["Payroll processing<br/>[payroll.js]"]
  node_performance["Performance reviews<br/>[performance.js]"]
end

subgraph group_backend["API &amp; Persistence"]
  node_middleware["API request helper<br/>[middleware.js]"]
  node_flask_api["Flask API &amp; serving<br/>[server.py]"]
  node_user_store[("User records<br/>[users.json]")]
  node_hr_store[("HR records<br/>[hr.json]")]
  node_attendance_store[("Attendance records<br/>[Attendance.json]")]
  node_payroll_store[("Payroll records<br/>[payroll.json]")]
  node_performance_store[("Performance records<br/>[performance.json]")]
  node_leave_store[("Leave data")]
  node_browser_session[("Browser session")]
end

node_user(("HR user"))

node_user -->|"submits credentials"| node_auth_forms
node_auth_forms -->|"posts auth data"| node_flask_api
node_flask_api -->|"reads/writes users"| node_user_store
node_auth_forms -->|"stores login"| node_browser_session
node_user -.->|"uses navigation"| node_navigation
node_navigation -->|"clears session"| node_browser_session
node_employee_mgmt -->|"requests HR"| node_flask_api
node_flask_api -->|"reads/writes HR"| node_hr_store
node_employee_mgmt -->|"checks admin"| node_auth_guard
node_attendance -->|"requests attendance"| node_flask_api
node_flask_api -->|"reads/writes attendance"| node_attendance_store
node_leave_tracking -->|"stores leaves"| node_leave_store
node_dashboard -->|"requests dashboard data"| node_flask_api
node_flask_api -->|"reads/writes attendance"| node_attendance_store
node_flask_api -->|"reads/writes reviews"| node_performance_store
node_dashboard -->|"reads leave data"| node_leave_store
node_payroll -->|"requests payroll"| node_flask_api
node_flask_api -->|"reads/writes payroll"| node_payroll_store
node_payroll -->|"checks admin"| node_auth_guard
node_performance -->|"requests reviews"| node_flask_api
node_performance -->|"checks admin"| node_auth_guard
node_middleware -->|"sends API requests"| node_flask_api
node_flask_api -->|"reads/writes users"| node_user_store
node_flask_api -->|"reads/writes HR"| node_hr_store
node_flask_api -->|"reads/writes attendance"| node_attendance_store
node_flask_api -->|"reads/writes payroll"| node_payroll_store
node_flask_api -->|"reads/writes reviews"| node_performance_store

click node_auth_forms "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/tree/main/Auth"
click node_auth_guard "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/auth-guard.js"
click node_navigation "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/sidebar.js"
click node_dashboard "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/dashboard.js"
click node_employee_mgmt "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/manage.js"
click node_attendance "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/attendance.js"
click node_leave_tracking "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/leaves.js"
click node_payroll "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/payroll.js"
click node_performance "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/performance.js"
click node_middleware "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/middleware.js"
click node_flask_api "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/server.py"
click node_user_store "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/users.json"
click node_hr_store "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/hr.json"
click node_attendance_store "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/Attendance.json"
click node_payroll_store "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/payroll.json"
click node_performance_store "https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/performance.json"

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_auth_forms,node_auth_guard,node_navigation,node_user toneBlue
class node_dashboard,node_employee_mgmt toneAmber
class node_attendance,node_leave_tracking toneMint
class node_payroll,node_performance toneRose
class node_middleware,node_flask_api,node_user_store,node_hr_store,node_attendance_store,node_payroll_store,node_performance_store,node_leave_store,node_browser_session toneIndigo
```

## Components

### Access & Navigation

- [Login & registration](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/tree/main/Auth): `Auth`
- [Admin authorization](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/auth-guard.js): `Js/auth-guard.js`
- [Sidebar navigation](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/sidebar.js): `Js/sidebar.js`

### People Operations

- [Dashboard](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/dashboard.js): `Js/dashboard.js`
- [Employee management](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/manage.js): `Js/manage.js`

### Workforce Tracking

- [Attendance reports](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/attendance.js): `Js/attendance.js`
- [Leave calendar](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/leaves.js): `Js/leaves.js`

### Compensation & Reviews

- [Payroll processing](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/payroll.js): `Js/payroll.js`
- [Performance reviews](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/performance.js): `Js/performance.js`

### API & Persistence

- [API request helper](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/Js/middleware.js): `Js/middleware.js`
- [Flask API & serving](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/server.py): `server.py`
- [User records](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/users.json): `data/users.json`
- [HR records](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/hr.json): `data/hr.json`
- [Attendance records](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/Attendance.json): `data/Attendance.json`
- [Payroll records](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/payroll.json): `data/payroll.json`
- [Performance records](https://github.com/kirafkra-bit/cpprog---with-backend-flash-rest-api/blob/main/data/performance.json): `data/performance.json`
- **Leave data**
- **Browser session**

### Other components

- **HR user**

## Connections

- HR user → Login & registration: submits credentials (evidence: `Auth/login.js`)
- Login & registration → Flask API & serving: posts auth data (evidence: `Auth/login.js`)
- Flask API & serving → User records: reads/writes users (evidence: `server.py`)
- Login & registration → Browser session: stores login (evidence: `Auth/login.js`)
- HR user → Sidebar navigation: uses navigation
- Sidebar navigation → Browser session: clears session (evidence: `Js/sidebar.js`)
- Employee management → Flask API & serving: requests HR (evidence: `Js/manage.js`)
- Flask API & serving → HR records: reads/writes HR (evidence: `server.py`)
- Employee management → Admin authorization: checks admin (evidence: `Js/manage.js`)
- Attendance reports → Flask API & serving: requests attendance (evidence: `Js/attendance.js`)
- Flask API & serving → Attendance records: reads/writes attendance (evidence: `server.py`)
- Leave calendar → Leave data: stores leaves (evidence: `Js/leaves.js`)
- Dashboard → Flask API & serving: requests dashboard data (evidence: `Js/dashboard.js`)
- Flask API & serving → Attendance records: reads/writes attendance (evidence: `server.py`)
- Flask API & serving → Performance records: reads/writes reviews (evidence: `server.py`)
- Dashboard → Leave data: reads leave data (evidence: `Js/dashboard.js`)
- Payroll processing → Flask API & serving: requests payroll (evidence: `Js/payroll.js`)
- Flask API & serving → Payroll records: reads/writes payroll (evidence: `server.py`)
- Payroll processing → Admin authorization: checks admin (evidence: `Js/payroll.js`)
- Performance reviews → Flask API & serving: requests reviews (evidence: `Js/performance.js`)
- Performance reviews → Admin authorization: checks admin (evidence: `Js/performance.js`)
- API request helper → Flask API & serving: sends API requests (evidence: `Js/middleware.js`)
- Flask API & serving → User records: reads/writes users (evidence: `server.py`)
- Flask API & serving → HR records: reads/writes HR (evidence: `server.py`)
- Flask API & serving → Attendance records: reads/writes attendance (evidence: `server.py`)
- Flask API & serving → Payroll records: reads/writes payroll (evidence: `server.py`)
- Flask API & serving → Performance records: reads/writes reviews (evidence: `server.py`)
