# nguyenhao1312/unims_studentmanagement architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenhao1312/unims_studentmanagement
- Repository: https://github.com/nguyenhao1312/unims_studentmanagement

## Overview

UniMS is a self-hosted university and student-management SPA backed by Django and SQL Server. Users enter through the review/login experience, authenticate, then use role-specific academic modules; the browser keeps encrypted local data and queues changes for server synchronization. The README documents role-based access, single-session enforcement, grades, registration, tuition, administration, exports, and an AI helpdesk. Source excerpts are partial, so links between individual views and backend endpoints are shown only where documented or directly evidenced.

Main entry points: [`static/js/views/dashboard.js`](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/dashboard.js) (Role dashboards), [`static/js/core/database.js`](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/database.js) (Encrypted local store), [`student_management/models.py`](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/models.py) (University data models), [`static/js/views/review.js`](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/review.js) (Review and login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser application"]
  node_review["Review and login<br/>[review.js]"]
  node_app["SPA router and shell<br/>[app.js]"]
  node_localdb[("Encrypted local store<br/>[database.js]")]
  node_syncqueue["Offline sync queue<br/>[sync-queue.js]"]
end

subgraph group_security["Identity and security"]
  node_auth["Client authentication<br/>[auth.js]"]
  node_middleware["Session enforcement<br/>[middleware.py]"]
  node_authapi["Authentication views<br/>[auth.py]"]
end

subgraph group_academic["Academic workflows"]
  node_dashboard["Role dashboards<br/>[dashboard.js]"]
  node_students["Student management<br/>[students.js]"]
  node_teachers["Teacher management<br/>[teachers.js]"]
  node_classes["Classes and courses<br/>[classes.js]"]
  node_registration["Course registration<br/>[registration.js]"]
  node_grades["Grades and locks<br/>[grades.js]"]
  node_tuition["Tuition tracking<br/>[tuition.js]"]
end

subgraph group_backend["Server and persistence"]
  node_api["REST and sync views<br/>[api.py]"]
  node_sync["Server sync handlers<br/>[sync.py]"]
  node_models[("University data models<br/>[models.py]")]
end

subgraph group_support["Support and operations"]
  node_admin["Admin dashboard<br/>[admin_dashboard.py]"]
  node_export["Data exports<br/>[export.py]"]
  node_helpdesk["AI helpdesk<br/>[helpdesk.js]"]
end

node_user(("Student, teacher, admin"))
node_db[("SQL Server")]

node_user -->|"opens"| node_review
node_review -->|"posts login"| node_authapi
node_review -->|"starts session"| node_auth
node_app -->|"checks session"| node_auth
node_auth -->|"sends token"| node_middleware
node_middleware -->|"guards requests"| node_api
node_app -->|"routes by role"| node_dashboard
node_dashboard -->|"opens module"| node_students
node_dashboard -->|"opens module"| node_teachers
node_dashboard -->|"opens module"| node_classes
node_dashboard -->|"opens module"| node_registration
node_dashboard -->|"opens module"| node_grades
node_dashboard -->|"opens module"| node_tuition
node_students -->|"reads and writes"| node_localdb
node_teachers -->|"reads and writes"| node_localdb
node_classes -->|"reads and writes"| node_localdb
node_registration -->|"reads and writes"| node_localdb
node_grades -->|"reads and writes"| node_localdb
node_tuition -->|"reads and writes"| node_localdb
node_localdb -->|"queues changes"| node_syncqueue
node_syncqueue -->|"sends updates"| node_sync
node_api -->|"reads and writes"| node_models
node_sync -->|"applies changes"| node_models
node_models -->|"persists"| node_db
node_admin -->|"manages records"| node_models
node_export -->|"reads records"| node_models
node_user -->|"asks questions"| node_helpdesk

click node_review "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/review.js"
click node_app "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/app.js"
click node_localdb "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/database.js"
click node_syncqueue "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/sync-queue.js"
click node_auth "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/auth.js"
click node_middleware "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/middleware.py"
click node_authapi "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/auth.py"
click node_dashboard "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/dashboard.js"
click node_students "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/students.js"
click node_teachers "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/teachers.js"
click node_classes "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/classes.js"
click node_registration "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/registration.js"
click node_grades "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/grades.js"
click node_tuition "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/tuition.js"
click node_api "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/api.py"
click node_sync "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/sync.py"
click node_models "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/models.py"
click node_admin "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/admin_dashboard.py"
click node_export "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/export.py"
click node_helpdesk "https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/helpdesk.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_review,node_app,node_localdb,node_syncqueue toneBlue
class node_auth,node_middleware,node_authapi,node_db toneAmber
class node_dashboard,node_students,node_teachers,node_classes,node_registration,node_grades,node_tuition toneMint
class node_api,node_sync,node_models toneRose
class node_admin,node_export,node_helpdesk,node_user toneIndigo
```

## Components

### Browser application

- [Review and login](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/review.js): `static/js/views/review.js`
- [SPA router and shell](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/app.js): `static/js/core/app.js`
- [Encrypted local store](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/database.js): `static/js/core/database.js`
- [Offline sync queue](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/sync-queue.js): `static/js/core/sync-queue.js`

### Identity and security

- [Client authentication](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/core/auth.js): `static/js/core/auth.js`
- [Session enforcement](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/middleware.py): `student_management/middleware.py`
- [Authentication views](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/auth.py): `student_management/views/auth.py`

### Academic workflows

- [Role dashboards](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/dashboard.js): `static/js/views/dashboard.js`
- [Student management](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/students.js): `static/js/views/students.js`
- [Teacher management](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/teachers.js): `static/js/views/teachers.js`
- [Classes and courses](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/classes.js): `static/js/views/classes.js`
- [Course registration](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/registration.js): `static/js/views/registration.js`
- [Grades and locks](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/grades.js): `static/js/views/grades.js`
- [Tuition tracking](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/tuition.js): `static/js/views/tuition.js`

### Server and persistence

- [REST and sync views](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/api.py): `student_management/views/api.py`
- [Server sync handlers](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/sync.py): `student_management/views/sync.py`
- [University data models](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/models.py): `student_management/models.py`

### Support and operations

- [Admin dashboard](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/admin_dashboard.py): `student_management/views/admin_dashboard.py`
- [Data exports](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/student_management/views/export.py): `student_management/views/export.py`
- [AI helpdesk](https://github.com/nguyenhao1312/unims_studentmanagement/blob/master/static/js/views/helpdesk.js): `static/js/views/helpdesk.js`

### Other components

- **Student, teacher, admin**
- **SQL Server**

## Connections

- Student, teacher, admin → Review and login: opens
- Review and login → Authentication views: posts login
- Review and login → Client authentication: starts session
- SPA router and shell → Client authentication: checks session
- Client authentication → Session enforcement: sends token
- Session enforcement → REST and sync views: guards requests
- SPA router and shell → Role dashboards: routes by role
- Role dashboards → Student management: opens module
- Role dashboards → Teacher management: opens module
- Role dashboards → Classes and courses: opens module
- Role dashboards → Course registration: opens module
- Role dashboards → Grades and locks: opens module
- Role dashboards → Tuition tracking: opens module
- Student management → Encrypted local store: reads and writes
- Teacher management → Encrypted local store: reads and writes
- Classes and courses → Encrypted local store: reads and writes
- Course registration → Encrypted local store: reads and writes
- Grades and locks → Encrypted local store: reads and writes
- Tuition tracking → Encrypted local store: reads and writes
- Encrypted local store → Offline sync queue: queues changes
- Offline sync queue → Server sync handlers: sends updates
- REST and sync views → University data models: reads and writes
- Server sync handlers → University data models: applies changes
- University data models → SQL Server: persists
- Admin dashboard → University data models: manages records
- Data exports → University data models: reads records
- Student, teacher, admin → AI helpdesk: asks questions
