# shagarchandro/shagar-model-school-college architecture

> Architecture diagram of the GitHub repository shagarchandro/shagar-model-school-college, 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/shagarchandro/shagar-model-school-college
- Repository: https://github.com/shagarchandro/shagar-model-school-college

## Overview

SSMS is a browser-based school ERP whose primary workflow is staff signing in, navigating the hash-routed application, and managing school records stored in browser LocalStorage. Its domain spans admissions and student records, fees, attendance, exams and results, and staff and finance; the README also documents portals, library, transport, routine, homework, and other v2 modules. The sampled serverless API adds AI, messaging, health, and online-payment support. Front-end module internals were not sampled, so links to those capabilities are limited to README evidence.

Main entry points: [`assets/js/app.js`](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/app.js) (App shell and router), [`assets/js/storage.js`](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/storage.js) (LocalStorage database), [`api/_lib.js`](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/_lib.js) (API request helpers), [`assets/js`](https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js) (Student and parent portals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Web application"]
  node_login["Login interface<br/>[login.html]"]
  node_auth["Demo authentication<br/>[auth.js]"]
  node_shell["App shell and router<br/>[app.js]"]
  node_database[("LocalStorage database<br/>[storage.js]")]
end

subgraph group_school["School operations"]
  node_dashboard["Dashboard<br/>[dashboard.js]"]
  node_admissions_students["Admissions and students<br/>[students.js]"]
  node_fees["Fees and collection<br/>[fees.js]"]
  node_attendance["Attendance<br/>[attendance.js]"]
  node_exams_results["Exams and results<br/>[results.js]"]
  node_staff_payroll["Staff and payroll<br/>[staff.js]"]
  node_finance_reports["Finance and reports<br/>[reports.js]"]
end

subgraph group_advanced["Advanced ERP"]
  node_portals["Student and parent portals"]
  node_teacher_portal["Teacher portal"]
  node_routine_homework["Routine and homework"]
  node_library_transport["Library and transport"]
  node_customization["System customization"]
end

subgraph group_services["Serverless services"]
  node_api_helpers["API request helpers<br/>[_lib.js]"]
  node_ai["AI chat endpoint<br/>[chat.js]"]
  node_sms["SMS endpoint<br/>[send.js]"]
  node_whatsapp["WhatsApp endpoint<br/>[send.js]"]
  node_health["Service health<br/>[health.js]"]
end

subgraph group_payments["Online payments"]
  node_payment_init["Payment initialization<br/>[init.js]"]
  node_payment_gateway["Gateway adapters<br/>[_gw.js]"]
  node_payment_ipn["Gateway return callback<br/>[ipn.js]"]
  node_payment_verify["Payment verification<br/>[verify.js]"]
end

node_staff_actor(("School user"))

node_staff_actor -->|"signs in"| node_login
node_login -->|"authenticates with"| node_auth
node_auth -.->|"enters app"| node_shell
node_staff_actor -->|"navigates pages"| node_shell
node_shell -->|"routes to"| node_dashboard
node_shell -->|"routes to"| node_admissions_students
node_shell -->|"routes to"| node_fees
node_shell -->|"routes to"| node_attendance
node_shell -->|"routes to"| node_exams_results
node_shell -->|"routes to"| node_staff_payroll
node_shell -->|"routes to"| node_finance_reports
node_shell -->|"routes to"| node_portals
node_shell -->|"routes to"| node_teacher_portal
node_shell -->|"routes to"| node_routine_homework
node_shell -->|"routes to"| node_library_transport
node_shell -->|"routes to"| node_customization
node_dashboard -.->|"reads records"| node_database
node_admissions_students -.->|"stores records"| node_database
node_fees -.->|"stores records"| node_database
node_attendance -.->|"stores records"| node_database
node_exams_results -.->|"stores records"| node_database
node_staff_payroll -.->|"stores records"| node_database
node_finance_reports -.->|"reads records"| node_database
node_portals -.->|"reads records"| node_database
node_teacher_portal -.->|"reads records"| node_database
node_routine_homework -.->|"stores records"| node_database
node_library_transport -.->|"stores records"| node_database
node_customization -->|"stores settings"| node_database
node_ai -->|"uses handlers"| node_api_helpers
node_sms -->|"uses handlers"| node_api_helpers
node_whatsapp -->|"uses handlers"| node_api_helpers
node_health -->|"uses handler"| node_api_helpers
node_payment_init -->|"uses handler"| node_api_helpers
node_payment_verify -->|"uses handler"| node_api_helpers
node_payment_init -->|"starts checkout"| node_payment_gateway
node_payment_verify -->|"verifies payment"| node_payment_gateway
node_payment_ipn -->|"redirects to fees"| node_portals
node_portals -.->|"requests checkout"| node_payment_init
node_portals -.->|"requests verification"| node_payment_verify

click node_login "https://github.com/shagarchandro/shagar-model-school-college/blob/main/login.html"
click node_auth "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/auth.js"
click node_shell "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/app.js"
click node_database "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/storage.js"
click node_dashboard "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/dashboard.js"
click node_admissions_students "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/students.js"
click node_fees "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/fees.js"
click node_attendance "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/attendance.js"
click node_exams_results "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/results.js"
click node_staff_payroll "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/staff.js"
click node_finance_reports "https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/reports.js"
click node_portals "https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js"
click node_teacher_portal "https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js"
click node_routine_homework "https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js"
click node_library_transport "https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js"
click node_customization "https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js"
click node_api_helpers "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/_lib.js"
click node_ai "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/ai/chat.js"
click node_sms "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/sms/send.js"
click node_whatsapp "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/whatsapp/send.js"
click node_health "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/health.js"
click node_payment_init "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/init.js"
click node_payment_gateway "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/_gw.js"
click node_payment_ipn "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/ipn.js"
click node_payment_verify "https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/verify.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_login,node_auth,node_shell,node_database,node_staff_actor toneBlue
class node_dashboard,node_admissions_students,node_fees,node_attendance,node_exams_results,node_staff_payroll,node_finance_reports toneAmber
class node_portals,node_teacher_portal,node_routine_homework,node_library_transport,node_customization toneMint
class node_api_helpers,node_ai,node_sms,node_whatsapp,node_health toneRose
class node_payment_init,node_payment_gateway,node_payment_ipn,node_payment_verify toneIndigo
```

## Components

### Web application

- [Login interface](https://github.com/shagarchandro/shagar-model-school-college/blob/main/login.html): `login.html`
- [Demo authentication](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/auth.js): `assets/js/auth.js`
- [App shell and router](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/app.js): `assets/js/app.js`
- [LocalStorage database](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/storage.js): `assets/js/storage.js`

### School operations

- [Dashboard](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/dashboard.js): `assets/js/dashboard.js`
- [Admissions and students](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/students.js): `assets/js/students.js`
- [Fees and collection](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/fees.js): `assets/js/fees.js`
- [Attendance](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/attendance.js): `assets/js/attendance.js`
- [Exams and results](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/results.js): `assets/js/results.js`
- [Staff and payroll](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/staff.js): `assets/js/staff.js`
- [Finance and reports](https://github.com/shagarchandro/shagar-model-school-college/blob/main/assets/js/reports.js): `assets/js/reports.js`

### Advanced ERP

- [Student and parent portals](https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js): `assets/js`
- [Teacher portal](https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js): `assets/js`
- [Routine and homework](https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js): `assets/js`
- [Library and transport](https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js): `assets/js`
- [System customization](https://github.com/shagarchandro/shagar-model-school-college/tree/main/assets/js): `assets/js`

### Serverless services

- [API request helpers](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/_lib.js): `api/_lib.js`
- [AI chat endpoint](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/ai/chat.js): `api/ai/chat.js`
- [SMS endpoint](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/sms/send.js): `api/sms/send.js`
- [WhatsApp endpoint](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/whatsapp/send.js): `api/whatsapp/send.js`
- [Service health](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/health.js): `api/health.js`

### Online payments

- [Payment initialization](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/init.js): `api/payments/init.js`
- [Gateway adapters](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/_gw.js): `api/payments/_gw.js`
- [Gateway return callback](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/ipn.js): `api/payments/ipn.js`
- [Payment verification](https://github.com/shagarchandro/shagar-model-school-college/blob/main/api/payments/verify.js): `api/payments/verify.js`

### Other components

- **School user**

## Connections

- School user → Login interface: signs in (evidence: `README.md`)
- Login interface → Demo authentication: authenticates with (evidence: `README.md`)
- Demo authentication → App shell and router: enters app
- School user → App shell and router: navigates pages (evidence: `README.md`)
- App shell and router → Dashboard: routes to (evidence: `README.md`)
- App shell and router → Admissions and students: routes to (evidence: `README.md`)
- App shell and router → Fees and collection: routes to (evidence: `README.md`)
- App shell and router → Attendance: routes to (evidence: `README.md`)
- App shell and router → Exams and results: routes to (evidence: `README.md`)
- App shell and router → Staff and payroll: routes to (evidence: `README.md`)
- App shell and router → Finance and reports: routes to (evidence: `README.md`)
- App shell and router → Student and parent portals: routes to (evidence: `README.md`)
- App shell and router → Teacher portal: routes to (evidence: `README.md`)
- App shell and router → Routine and homework: routes to (evidence: `README.md`)
- App shell and router → Library and transport: routes to (evidence: `README.md`)
- App shell and router → System customization: routes to (evidence: `README.md`)
- Dashboard → LocalStorage database: reads records
- Admissions and students → LocalStorage database: stores records
- Fees and collection → LocalStorage database: stores records
- Attendance → LocalStorage database: stores records
- Exams and results → LocalStorage database: stores records
- Staff and payroll → LocalStorage database: stores records
- Finance and reports → LocalStorage database: reads records
- Student and parent portals → LocalStorage database: reads records
- Teacher portal → LocalStorage database: reads records
- Routine and homework → LocalStorage database: stores records
- Library and transport → LocalStorage database: stores records
- System customization → LocalStorage database: stores settings (evidence: `README.md`)
- AI chat endpoint → API request helpers: uses handlers (evidence: `api/ai/chat.js`)
- SMS endpoint → API request helpers: uses handlers (evidence: `api/sms/send.js`)
- WhatsApp endpoint → API request helpers: uses handlers (evidence: `api/whatsapp/send.js`)
- Service health → API request helpers: uses handler (evidence: `api/health.js`)
- Payment initialization → API request helpers: uses handler (evidence: `api/payments/init.js`)
- Payment verification → API request helpers: uses handler (evidence: `api/payments/verify.js`)
- Payment initialization → Gateway adapters: starts checkout (evidence: `api/payments/init.js`)
- Payment verification → Gateway adapters: verifies payment (evidence: `api/payments/verify.js`)
- Gateway return callback → Student and parent portals: redirects to fees (evidence: `api/payments/ipn.js`)
- Student and parent portals → Payment initialization: requests checkout
- Student and parent portals → Payment verification: requests verification
