# mohammadbalambag26/scheduleboard architecture

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

- Interactive diagram: https://gitdiagram.com/mohammadbalambag26/scheduleboard
- Repository: https://github.com/mohammadbalambag26/scheduleboard

## Overview

ScheduleBoard is a college class-scheduling web application. Department Heads manage course assignments, generate or edit semester/year schedules, validate constraints, print schedules for offline review, then publish approved schedules for public viewing; Admins manage Department Head accounts. The server owns API, authentication, scheduling workflows, and database access. The README documents search, locks, announcements/events, and exports; those capabilities are represented within the server and website components. Some UI-to-API wiring is not shown in the excerpts, so that relationship is marked unverified.

Main entry points: [`server.js`](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js) (Express API), [`public/app.js`](https://github.com/mohammadbalambag26/scheduleboard/blob/main/public/app.js) (Schedule website), [`server/generator-runner.js`](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator-runner.js) (Generation runner), [`server/generator-worker.js`](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator-worker.js) (Generation worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interfaces"]
  node_website["Schedule website<br/>[app.js]"]
  node_standalone["Standalone viewer<br/>[scheduleboard.html]"]
end

subgraph group_server["Server workflows"]
  node_api["Express API<br/>[server.js]"]
  node_access["Login and roles<br/>[server.js]"]
  node_admin["Account management<br/>[server.js]"]
  node_assignments["Subject assignments<br/>[server.js]"]
  node_schedule["Schedule management<br/>[server.js]"]
  node_lifecycle["Draft and publish<br/>[server.js]"]
  node_publicviews["Timetable and exports<br/>[server.js]"]
  node_communications["Announcements and events<br/>[server.js]"]
end

subgraph group_generation["Schedule generation"]
  node_runner["Generation runner"]
  node_worker["Generation worker"]
  node_solver["Schedule solver<br/>[generator.js]"]
end

subgraph group_storage["Persistence"]
  node_mysql[("MySQL database<br/>[schema.sql]")]
  node_pool["Connection pool<br/>[db.js]"]
end

node_visitor(("Public visitor"))
node_staff(("Admin / Head"))

node_visitor -->|"views"| node_website
node_staff -->|"manages"| node_website
node_website -.->|"calls API"| node_api
node_api -->|"authenticates"| node_access
node_api -->|"manages accounts"| node_admin
node_api -->|"manages"| node_assignments
node_api -->|"edits and validates"| node_schedule
node_api -->|"publishes"| node_lifecycle
node_api -->|"serves and exports"| node_publicviews
node_api -->|"manages"| node_communications
node_api -->|"dispatches generation"| node_runner
node_runner -->|"starts worker"| node_worker
node_worker -->|"calls solve"| node_solver
node_api -->|"queries"| node_pool
node_pool -.->|"reads and writes"| node_mysql
node_visitor -->|"opens"| node_standalone

click node_website "https://github.com/mohammadbalambag26/scheduleboard/blob/main/public/app.js"
click node_standalone "https://github.com/mohammadbalambag26/scheduleboard/blob/main/standalone/scheduleboard.html"
click node_api "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_access "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_admin "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_assignments "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_schedule "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_lifecycle "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_publicviews "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_communications "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js"
click node_runner "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator-runner.js"
click node_worker "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator-worker.js"
click node_solver "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator.js"
click node_mysql "https://github.com/mohammadbalambag26/scheduleboard/blob/main/schema.sql"
click node_pool "https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/db.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_website,node_standalone toneBlue
class node_api,node_access,node_admin,node_assignments,node_schedule,node_lifecycle,node_publicviews,node_communications toneAmber
class node_runner,node_worker,node_solver toneMint
class node_mysql,node_pool toneRose
class node_visitor,node_staff toneIndigo
```

## Components

### Web interfaces

- [Schedule website](https://github.com/mohammadbalambag26/scheduleboard/blob/main/public/app.js): `public/app.js`
- [Standalone viewer](https://github.com/mohammadbalambag26/scheduleboard/blob/main/standalone/scheduleboard.html): `standalone/scheduleboard.html`

### Server workflows

- [Express API](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Login and roles](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Account management](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Subject assignments](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Schedule management](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Draft and publish](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Timetable and exports](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`
- [Announcements and events](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server.js): `server.js`

### Schedule generation

- [Generation runner](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator-runner.js): `server/generator-runner.js`
- [Generation worker](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator-worker.js): `server/generator-worker.js`
- [Schedule solver](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/generator.js): `server/generator.js`

### Persistence

- [MySQL database](https://github.com/mohammadbalambag26/scheduleboard/blob/main/schema.sql): `schema.sql`
- [Connection pool](https://github.com/mohammadbalambag26/scheduleboard/blob/main/server/db.js): `server/db.js`

### Other components

- **Public visitor**
- **Admin / Head**

## Connections

- Public visitor → Schedule website: views (evidence: `README.md`)
- Admin / Head → Schedule website: manages (evidence: `README.md`)
- Schedule website → Express API: calls API
- Express API → Login and roles: authenticates (evidence: `server.js`)
- Express API → Account management: manages accounts (evidence: `README.md`)
- Express API → Subject assignments: manages (evidence: `README.md`)
- Express API → Schedule management: edits and validates (evidence: `README.md`)
- Express API → Draft and publish: publishes (evidence: `README.md`)
- Express API → Timetable and exports: serves and exports (evidence: `README.md`)
- Express API → Announcements and events: manages (evidence: `README.md`)
- Express API → Generation runner: dispatches generation (evidence: `server.js`)
- Generation runner → Generation worker: starts worker (evidence: `server/generator-runner.js`)
- Generation worker → Schedule solver: calls solve (evidence: `server/generator-worker.js`)
- Express API → Connection pool: queries (evidence: `server.js`)
- Connection pool → MySQL database: reads and writes
- Public visitor → Standalone viewer: opens (evidence: `README.md`)
