# nguyenbaohuit23-beep/giaoly-server architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenbaohuit23-beep/giaoly-server
- Repository: https://github.com/nguyenbaohuit23-beep/giaoly-server

## Overview

Đây là ứng dụng web quản lý nhiều lớp Giáo lý. Nhân sự đăng nhập, chọn lớp và năm học, rồi quản lý hồ sơ thiếu nhi, điểm, điểm danh và điểm cộng; sysadmin còn quản lý tài khoản, lớp và quy tắc tính điểm. Server.js tập trung xử lý xác thực, API, nghiệp vụ và lưu trữ. README mô tả thêm các khả năng quản trị và nâng cấp dữ liệu; các quan hệ đó được ghi nhận ở mức tài liệu vì phần mã tương ứng không có trong trích đoạn.

Main entry points: [`server.js`](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js) (Ứng dụng Express), [`public/index.html`](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/public/index.html) (Giao diện web)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Truy cập và xác thực"]
  node_web["Giao diện web<br/>[index.html]"]
  node_server["Ứng dụng Express<br/>[server.js]"]
  node_auth["Đăng nhập và phân quyền<br/>[server.js]"]
end

subgraph group_classwork["Nghiệp vụ lớp học"]
  node_classyear["Lớp và năm học<br/>[server.js]"]
  node_students["Hồ sơ thiếu nhi<br/>[server.js]"]
  node_attendance["Điểm danh<br/>[server.js]"]
  node_grades["Điểm và điểm cộng<br/>[server.js]"]
  node_backup["Sao lưu và khôi phục<br/>[server.js]"]
end

subgraph group_admin["Quản trị và theo dõi"]
  node_settings["Quy tắc tính điểm<br/>[server.js]"]
  node_accounts["Tài khoản và vai trò<br/>[server.js]"]
  node_audit["Nhật ký hoạt động<br/>[server.js]"]
end

subgraph group_storage["Lưu trữ"]
  node_db[("Cơ sở dữ liệu")]
end

node_staff(("Nhân sự trường"))

node_staff -->|"sử dụng"| node_web
node_web -.->|"gửi yêu cầu"| node_server
node_server -->|"phục vụ tĩnh"| node_web
node_server -->|"xử lý API"| node_auth
node_auth -->|"đọc tài khoản"| node_db
node_auth -->|"chọn ngữ cảnh"| node_classyear
node_classyear -->|"kiểm tra lớp"| node_db
node_staff -->|"quản lý hồ sơ"| node_students
node_staff -->|"điểm danh"| node_attendance
node_staff -->|"nhập điểm"| node_grades
node_staff -->|"khôi phục dữ liệu"| node_backup
node_server -->|"đọc và cập nhật"| node_students
node_server -->|"cập nhật"| node_attendance
node_server -->|"cộng điểm"| node_grades
node_server -->|"khôi phục"| node_backup
node_staff -->|"đặt quy tắc"| node_settings
node_staff -->|"quản lý tài khoản"| node_accounts
node_server -->|"quản lý sysadmin"| node_accounts
node_server -->|"đọc nhật ký"| node_audit
node_server -->|"đọc và ghi"| node_db
node_settings -.->|"lưu cấu hình"| node_db
node_backup -.->|"lưu dữ liệu"| node_db

click node_web "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/public/index.html"
click node_server "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_auth "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_classyear "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_students "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_attendance "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_grades "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_backup "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_settings "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_accounts "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js"
click node_audit "https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.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_web,node_server,node_auth toneBlue
class node_classyear,node_students,node_attendance,node_grades,node_backup toneAmber
class node_settings,node_accounts,node_audit toneMint
class node_db toneRose
class node_staff toneIndigo
```

## Components

### Truy cập và xác thực

- [Giao diện web](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/public/index.html): `public/index.html`
- [Ứng dụng Express](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Đăng nhập và phân quyền](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`

### Nghiệp vụ lớp học

- [Lớp và năm học](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Hồ sơ thiếu nhi](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Điểm danh](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Điểm và điểm cộng](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Sao lưu và khôi phục](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`

### Quản trị và theo dõi

- [Quy tắc tính điểm](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Tài khoản và vai trò](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`
- [Nhật ký hoạt động](https://github.com/nguyenbaohuit23-beep/giaoly-server/blob/main/server.js): `server.js`

### Lưu trữ

- **Cơ sở dữ liệu**

### Other components

- **Nhân sự trường**

## Connections

- Nhân sự trường → Giao diện web: sử dụng (evidence: `README.md`)
- Giao diện web → Ứng dụng Express: gửi yêu cầu
- Ứng dụng Express → Giao diện web: phục vụ tĩnh (evidence: `server.js`)
- Ứng dụng Express → Đăng nhập và phân quyền: xử lý API (evidence: `server.js`)
- Đăng nhập và phân quyền → Cơ sở dữ liệu: đọc tài khoản (evidence: `server.js`)
- Đăng nhập và phân quyền → Lớp và năm học: chọn ngữ cảnh (evidence: `server.js`)
- Lớp và năm học → Cơ sở dữ liệu: kiểm tra lớp (evidence: `server.js`)
- Nhân sự trường → Hồ sơ thiếu nhi: quản lý hồ sơ (evidence: `README.md`)
- Nhân sự trường → Điểm danh: điểm danh (evidence: `README.md`)
- Nhân sự trường → Điểm và điểm cộng: nhập điểm (evidence: `README.md`)
- Nhân sự trường → Sao lưu và khôi phục: khôi phục dữ liệu (evidence: `server.js`)
- Ứng dụng Express → Hồ sơ thiếu nhi: đọc và cập nhật (evidence: `server.js`)
- Ứng dụng Express → Điểm danh: cập nhật (evidence: `server.js`)
- Ứng dụng Express → Điểm và điểm cộng: cộng điểm (evidence: `server.js`)
- Ứng dụng Express → Sao lưu và khôi phục: khôi phục (evidence: `server.js`)
- Nhân sự trường → Quy tắc tính điểm: đặt quy tắc (evidence: `README.md`)
- Nhân sự trường → Tài khoản và vai trò: quản lý tài khoản (evidence: `README.md`)
- Ứng dụng Express → Tài khoản và vai trò: quản lý sysadmin (evidence: `server.js`)
- Ứng dụng Express → Nhật ký hoạt động: đọc nhật ký (evidence: `server.js`)
- Ứng dụng Express → Cơ sở dữ liệu: đọc và ghi (evidence: `server.js`)
- Quy tắc tính điểm → Cơ sở dữ liệu: lưu cấu hình (evidence: `README.md`)
- Sao lưu và khôi phục → Cơ sở dữ liệu: lưu dữ liệu
