# imamaaa/automated-timetable-generator architecture

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

- Interactive diagram: https://gitdiagram.com/imamaaa/automated-timetable-generator
- Repository: https://github.com/imamaaa/automated-timetable-generator

## Overview

This is a Flask-based university timetable generator. An administrator opens the scheduling interface, generates weekday time slots, assigns courses to rooms by drag and drop, reviews course details and scheduling conflicts, then saves or exports the timetable. The graph separates the interface, scheduling behavior, Flask endpoints, and SQL Server data. README-described capabilities such as student and instructor clash alerts are included, though the relevant implementation was not fully sampled; those links use README evidence.

Main entry points: [`static/script.js`](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js) (Timetable interaction), [`app.py`](https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py) (Flask routes), [`SQL_TimeTable.sql`](https://github.com/imamaaa/automated-timetable-generator/blob/master/SQL_TimeTable.sql) (SQL Server data), [`templates/index.html`](https://github.com/imamaaa/automated-timetable-generator/blob/master/templates/index.html) (Scheduling page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Scheduling interface"]
  node_web_ui["Scheduling page<br/>[index.html]"]
end

subgraph group_logic["Timetable operations"]
  node_browser_logic["Timetable interaction<br/>[script.js]"]
  node_slot_generation["Slot generation<br/>[script.js]"]
  node_course_assignment["Course assignment<br/>[script.js]"]
  node_conflict_checks["Conflict checks<br/>[script.js]"]
  node_course_details["Course details popup<br/>[script.js]"]
  node_pdf_export["PDF export<br/>[script.js]"]
  node_schedule_controls["Save and reset<br/>[script.js]"]
end

subgraph group_backend["Flask services"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_course_api["Course and detail API<br/>[app.py]"]
  node_room_api["Room API<br/>[app.py]"]
  node_student_api["Student data API<br/>[app.py]"]
  node_timetable_api["Timetable save/reset API<br/>[app.py]"]
end

subgraph group_data["Schedule data"]
  node_sql_database[("SQL Server data<br/>[SQL_TimeTable.sql]")]
end

node_admin(("Administrator"))

node_admin -->|"uses"| node_web_ui
node_web_ui -->|"loads page"| node_flask_app
node_web_ui -.->|"uses"| node_browser_logic
node_browser_logic -->|"fetches courses"| node_course_api
node_browser_logic -->|"fetches rooms"| node_room_api
node_browser_logic -->|"fetches student data"| node_student_api
node_browser_logic -->|"generates slots"| node_slot_generation
node_browser_logic -->|"assigns courses"| node_course_assignment
node_course_assignment -->|"checks clashes"| node_conflict_checks
node_browser_logic -->|"requests details"| node_course_details
node_course_details -->|"fetches details"| node_course_api
node_browser_logic -->|"exports timetable"| node_pdf_export
node_browser_logic -->|"saves or resets"| node_schedule_controls
node_schedule_controls -->|"submits changes"| node_timetable_api
node_flask_app -->|"routes to"| node_course_api
node_flask_app -->|"routes to"| node_room_api
node_flask_app -->|"routes to"| node_student_api
node_flask_app -->|"routes to"| node_timetable_api
node_course_api -->|"queries"| node_sql_database
node_room_api -->|"queries"| node_sql_database
node_student_api -->|"queries"| node_sql_database
node_timetable_api -->|"writes schedule"| node_sql_database

click node_web_ui "https://github.com/imamaaa/automated-timetable-generator/blob/master/templates/index.html"
click node_browser_logic "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_slot_generation "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_course_assignment "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_conflict_checks "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_course_details "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_pdf_export "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_schedule_controls "https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js"
click node_flask_app "https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py"
click node_course_api "https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py"
click node_room_api "https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py"
click node_student_api "https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py"
click node_timetable_api "https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py"
click node_sql_database "https://github.com/imamaaa/automated-timetable-generator/blob/master/SQL_TimeTable.sql"

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_ui toneBlue
class node_browser_logic,node_slot_generation,node_course_assignment,node_conflict_checks,node_course_details,node_pdf_export,node_schedule_controls toneAmber
class node_flask_app,node_course_api,node_room_api,node_student_api,node_timetable_api toneMint
class node_sql_database toneRose
class node_admin toneIndigo
```

## Components

### Scheduling interface

- [Scheduling page](https://github.com/imamaaa/automated-timetable-generator/blob/master/templates/index.html): `templates/index.html`

### Timetable operations

- [Timetable interaction](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`
- [Slot generation](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`
- [Course assignment](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`
- [Conflict checks](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`
- [Course details popup](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`
- [PDF export](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`
- [Save and reset](https://github.com/imamaaa/automated-timetable-generator/blob/master/static/script.js): `static/script.js`

### Flask services

- [Flask routes](https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py): `app.py`
- [Course and detail API](https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py): `app.py`
- [Room API](https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py): `app.py`
- [Student data API](https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py): `app.py`
- [Timetable save/reset API](https://github.com/imamaaa/automated-timetable-generator/blob/master/app.py): `app.py`

### Schedule data

- [SQL Server data](https://github.com/imamaaa/automated-timetable-generator/blob/master/SQL_TimeTable.sql): `SQL_TimeTable.sql`

### Other components

- **Administrator**

## Connections

- Administrator → Scheduling page: uses (evidence: `README.md`)
- Scheduling page → Flask routes: loads page (evidence: `app.py`)
- Scheduling page → Timetable interaction: uses
- Timetable interaction → Course and detail API: fetches courses (evidence: `static/script.js`)
- Timetable interaction → Room API: fetches rooms (evidence: `README.md`)
- Timetable interaction → Student data API: fetches student data (evidence: `static/script.js`)
- Timetable interaction → Slot generation: generates slots (evidence: `static/script.js`)
- Timetable interaction → Course assignment: assigns courses (evidence: `README.md`)
- Course assignment → Conflict checks: checks clashes (evidence: `README.md`)
- Timetable interaction → Course details popup: requests details (evidence: `static/script.js`)
- Course details popup → Course and detail API: fetches details (evidence: `static/script.js`)
- Timetable interaction → PDF export: exports timetable (evidence: `static/script.js`)
- Timetable interaction → Save and reset: saves or resets (evidence: `README.md`)
- Save and reset → Timetable save/reset API: submits changes (evidence: `README.md`)
- Flask routes → Course and detail API: routes to (evidence: `app.py`)
- Flask routes → Room API: routes to (evidence: `app.py`)
- Flask routes → Student data API: routes to (evidence: `app.py`)
- Flask routes → Timetable save/reset API: routes to (evidence: `app.py`)
- Course and detail API → SQL Server data: queries (evidence: `app.py`)
- Room API → SQL Server data: queries (evidence: `app.py`)
- Student data API → SQL Server data: queries (evidence: `app.py`)
- Timetable save/reset API → SQL Server data: writes schedule (evidence: `app.py`)
