# manastg/emptyclassroomfinder architecture

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

- Interactive diagram: https://gitdiagram.com/manastg/emptyclassroomfinder
- Repository: https://github.com/manastg/emptyclassroomfinder

## Overview

Empty Classroom Finder scrapes IILM timetable data, stores it as JSON, and serves available classrooms for a selected day and period. The main request path is browser interface → Flask endpoint → availability calculation, which reads the timetable and classroom catalogue. A separate scraper and catalogue-generation step maintain those inputs; browser code can cache today’s results. The graph reflects README-described capabilities and shown calls; the HTML and JSON data contents were not sampled, so their detailed structure and wiring are not inferred.

Main entry points: [`app.py`](https://github.com/manastg/emptyclassroomfinder/blob/main/app.py) (Flask app), [`src/emptyClassroom.py`](https://github.com/manastg/emptyclassroomfinder/blob/main/src/emptyClassroom.py) (Availability finder), [`frontend/script.js`](https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/script.js) (Search interface), [`timetable.json`](https://github.com/manastg/emptyclassroomfinder/blob/main/timetable.json) (Timetable JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Timetable collection"]
  node_scraper["Timetable scraper<br/>[scraper.py]"]
end

subgraph group_data["Timetable data"]
  node_timetable[("Timetable JSON<br/>[timetable.json]")]
  node_catalogue_builder["Catalogue generator<br/>[allClassroom.py]"]
  node_catalogue[("Classroom catalogue<br/>[allClassroom.json]")]
end

subgraph group_service["Availability service"]
  node_app["Flask app<br/>[app.py]"]
  node_finder["Availability finder<br/>[emptyClassroom.py]"]
end

subgraph group_browser["Browser interface"]
  node_page["Web page<br/>[index.html]"]
  node_client["Search interface<br/>[script.js]"]
  node_cache_job["Today cache loader<br/>[cache.js]"]
  node_local_storage[("Browser local storage")]
end

node_visitor(("User"))
node_university["IILM timetable"]

node_scraper -->|"loads timetable"| node_university
node_scraper -->|"writes JSON"| node_timetable
node_catalogue_builder -->|"reads JSON"| node_timetable
node_catalogue_builder -->|"writes JSON"| node_catalogue
node_visitor -.->|"opens interface"| node_page
node_app -->|"serves page"| node_page
node_client -->|"fetches results"| node_app
node_cache_job -->|"fetches periods"| node_app
node_app -->|"calls finder"| node_finder
node_finder -->|"reads schedule"| node_timetable
node_finder -->|"reads rooms"| node_catalogue
node_app -->|"returns room list"| node_client
node_client -->|"reads and writes"| node_local_storage
node_cache_job -->|"stores results"| node_local_storage

click node_scraper "https://github.com/manastg/emptyclassroomfinder/blob/main/scraper/scraper.py"
click node_timetable "https://github.com/manastg/emptyclassroomfinder/blob/main/timetable.json"
click node_catalogue_builder "https://github.com/manastg/emptyclassroomfinder/blob/main/src/allClassroom.py"
click node_catalogue "https://github.com/manastg/emptyclassroomfinder/blob/main/src/allClassroom.json"
click node_app "https://github.com/manastg/emptyclassroomfinder/blob/main/app.py"
click node_finder "https://github.com/manastg/emptyclassroomfinder/blob/main/src/emptyClassroom.py"
click node_page "https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/index.html"
click node_client "https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/script.js"
click node_cache_job "https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/cache.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_scraper,node_visitor toneBlue
class node_timetable,node_catalogue_builder,node_catalogue toneAmber
class node_app,node_finder toneMint
class node_page,node_client,node_cache_job,node_local_storage toneRose
class node_university toneIndigo
```

## Components

### Timetable collection

- [Timetable scraper](https://github.com/manastg/emptyclassroomfinder/blob/main/scraper/scraper.py): `scraper/scraper.py`

### Timetable data

- [Timetable JSON](https://github.com/manastg/emptyclassroomfinder/blob/main/timetable.json): `timetable.json`
- [Catalogue generator](https://github.com/manastg/emptyclassroomfinder/blob/main/src/allClassroom.py): `src/allClassroom.py`
- [Classroom catalogue](https://github.com/manastg/emptyclassroomfinder/blob/main/src/allClassroom.json): `src/allClassroom.json`

### Availability service

- [Flask app](https://github.com/manastg/emptyclassroomfinder/blob/main/app.py): `app.py`
- [Availability finder](https://github.com/manastg/emptyclassroomfinder/blob/main/src/emptyClassroom.py): `src/emptyClassroom.py`

### Browser interface

- [Web page](https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/index.html): `frontend/index.html`
- [Search interface](https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/script.js): `frontend/script.js`
- [Today cache loader](https://github.com/manastg/emptyclassroomfinder/blob/main/frontend/cache.js): `frontend/cache.js`
- **Browser local storage**

### Other components

- **User**
- **IILM timetable**

## Connections

- Timetable scraper → IILM timetable: loads timetable (evidence: `scraper/scraper.py`)
- Timetable scraper → Timetable JSON: writes JSON (evidence: `scraper/scraper.py`)
- Catalogue generator → Timetable JSON: reads JSON (evidence: `src/allClassroom.py`)
- Catalogue generator → Classroom catalogue: writes JSON (evidence: `src/allClassroom.py`)
- User → Web page: opens interface (evidence: `README.md`)
- Flask app → Web page: serves page (evidence: `app.py`)
- Search interface → Flask app: fetches results (evidence: `frontend/script.js`)
- Today cache loader → Flask app: fetches periods (evidence: `frontend/cache.js`)
- Flask app → Availability finder: calls finder (evidence: `app.py`)
- Availability finder → Timetable JSON: reads schedule (evidence: `src/emptyClassroom.py`)
- Availability finder → Classroom catalogue: reads rooms (evidence: `src/emptyClassroom.py`)
- Flask app → Search interface: returns room list (evidence: `app.py`)
- Search interface → Browser local storage: reads and writes (evidence: `frontend/script.js`)
- Today cache loader → Browser local storage: stores results (evidence: `frontend/cache.js`)
