# haoyueliew/aptime-apu-timetable-checker architecture

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

- Interactive diagram: https://gitdiagram.com/haoyueliew/aptime-apu-timetable-checker
- Repository: https://github.com/haoyueliew/aptime-apu-timetable-checker

## Overview

APTime is a Flask-backed timetable comparison web app. Students enter multiple intake codes, optionally choose groups and a week, then request common free slots; the backend fetches APSpace data, filters and combines class intervals, and returns results for a timetable and free-time summary. The README also documents elective discovery and exclusion. Backend behavior is supported by app.py excerpts; UI behavior and some endpoint interactions are documented in the README, since the template source was not sampled.

Main entry points: [`templates/index.html`](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/templates/index.html) (Search and dashboard), [`app.py`](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py) (Slot request), [`static/style.css`](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/static/style.css) (Timetable styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Student interface"]
  node_dashboard["Search and dashboard<br/>[index.html]"]
  node_styling["Timetable styling<br/>[style.css]"]
end

subgraph group_backend["Timetable workflows"]
  node_flask["Flask routes<br/>[app.py]"]
  node_week_options["Week options<br/>[app.py]"]
  node_elective_discovery["Elective discovery<br/>[app.py]"]
  node_slot_request["Slot request<br/>[app.py]"]
  node_timetable_fetch["Timetable fetch<br/>[app.py]"]
  node_intake_filter["Intake filters<br/>[app.py]"]
  node_interval_logic["Interval calculation<br/>[app.py]"]
  node_slot_results["Slot results<br/>[app.py]"]
end

subgraph group_external["External data"]
  node_apspace[("APSpace timetable API")]
end

node_student(("Student"))

node_student -->|"uses"| node_dashboard
node_dashboard -->|"submits requests"| node_flask
node_dashboard -.->|"uses styles"| node_styling
node_flask -->|"collects weeks"| node_week_options
node_flask -->|"routes request"| node_elective_discovery
node_flask -->|"routes request"| node_slot_request
node_elective_discovery -->|"fetches data"| node_timetable_fetch
node_slot_request -->|"fetches data"| node_timetable_fetch
node_timetable_fetch -->|"requests timetable"| node_apspace
node_slot_request -->|"filters intervals"| node_intake_filter
node_intake_filter -->|"supplies busy times"| node_interval_logic
node_slot_request -->|"returns results"| node_slot_results
node_slot_results -->|"renders grid and summary"| node_dashboard
node_dashboard -->|"requests electives"| node_elective_discovery
node_dashboard -->|"recomputes slots"| node_slot_request

click node_dashboard "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/templates/index.html"
click node_styling "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/static/style.css"
click node_flask "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_week_options "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_elective_discovery "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_slot_request "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_timetable_fetch "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_intake_filter "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_interval_logic "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"
click node_slot_results "https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py"

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_dashboard,node_styling toneBlue
class node_flask,node_week_options,node_elective_discovery,node_slot_request,node_timetable_fetch,node_intake_filter,node_interval_logic,node_slot_results toneAmber
class node_apspace toneMint
class node_student toneIndigo
```

## Components

### Student interface

- [Search and dashboard](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/templates/index.html): `templates/index.html`
- [Timetable styling](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/static/style.css): `static/style.css`

### Timetable workflows

- [Flask routes](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Week options](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Elective discovery](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Slot request](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Timetable fetch](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Intake filters](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Interval calculation](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`
- [Slot results](https://github.com/haoyueliew/aptime-apu-timetable-checker/blob/main/app.py): `app.py`

### External data

- **APSpace timetable API**

### Other components

- **Student**

## Connections

- Student → Search and dashboard: uses (evidence: `README.md`)
- Search and dashboard → Flask routes: submits requests (evidence: `README.md`)
- Search and dashboard → Timetable styling: uses styles
- Flask routes → Week options: collects weeks (evidence: `app.py`)
- Flask routes → Elective discovery: routes request (evidence: `README.md`)
- Flask routes → Slot request: routes request (evidence: `app.py`)
- Elective discovery → Timetable fetch: fetches data (evidence: `app.py`)
- Slot request → Timetable fetch: fetches data (evidence: `app.py`)
- Timetable fetch → APSpace timetable API: requests timetable (evidence: `app.py`)
- Slot request → Intake filters: filters intervals (evidence: `app.py`)
- Intake filters → Interval calculation: supplies busy times (evidence: `app.py`)
- Slot request → Slot results: returns results (evidence: `app.py`)
- Slot results → Search and dashboard: renders grid and summary (evidence: `README.md`)
- Search and dashboard → Elective discovery: requests electives (evidence: `README.md`)
- Search and dashboard → Slot request: recomputes slots (evidence: `README.md`)
