# cataragamihai/orar architecture

> Architecture diagram of the GitHub repository cataragamihai/orar, 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/cataragamihai/orar
- Repository: https://github.com/cataragamihai/orar

## Overview

Orar turns the faculty’s published eOra timetable into group-specific schedules: students choose a group and electives, then view classes adjusted for week parity, holidays and one-off sessions. A scraper refreshes the static JSON data; the browser app uses shared scheduling logic to render the timetable and offer calendar and notification features. The app shell also supports offline use. The README documents scraping and offline behavior; calendar and morning-push components are supported by the sampled source. Some wiring for calendar delivery and push subscription is not shown, so those links are marked unverified.

Main entry points: [`public/app.js`](https://github.com/cataragamihai/orar/blob/main/public/app.js) (Browser app), [`public/data`](https://github.com/cataragamihai/orar/tree/main/public/data) (Published timetable data), [`public/core.js`](https://github.com/cataragamihai/orar/blob/main/public/core.js) (Schedule logic), [`public/sw.js`](https://github.com/cataragamihai/orar/blob/main/public/sw.js) (Service worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_scraper["eOra scraper<br/>[scrape.mjs]"]
  node_data[("Published timetable data")]
  node_year["Academic year calendar<br/>[academic-year.json]"]
end

subgraph group_web["Timetable app"]
  node_app["Browser app<br/>[app.js]"]
  node_schedule["Schedule logic<br/>[core.js]"]
end

subgraph group_notify["Calendar and alerts"]
  node_calendar["Calendar files<br/>[build-cal.mjs]"]
  node_morning["Morning summaries<br/>[morning.mjs]"]
end

subgraph group_offline["Offline delivery"]
  node_sw["Service worker<br/>[sw.js]"]
  node_browsercache[("Browser cache")]
end

node_student(("Student"))
node_faculty["Faculty eOra"]
node_calendarclient(("Calendar client"))
node_push["Push service"]

node_student -->|"chooses group"| node_app
node_app -->|"loads timetable"| node_data
node_app -->|"uses scheduling"| node_schedule
node_schedule -->|"returns lessons"| node_app
node_faculty -->|"provides pages"| node_scraper
node_scraper -->|"writes JSON"| node_data
node_year -->|"adds term dates"| node_data
node_data -->|"builds calendars"| node_calendar
node_schedule -->|"formats events"| node_calendar
node_calendarclient -.->|"subscribes"| node_calendar
node_data -->|"reads group data"| node_morning
node_schedule -->|"selects classes"| node_morning
node_morning -->|"sends alerts"| node_push
node_app -.->|"registers subscription"| node_push
node_app -->|"registers worker"| node_sw
node_sw -->|"caches responses"| node_browsercache
node_sw -->|"serves offline"| node_app

click node_scraper "https://github.com/cataragamihai/orar/blob/main/scripts/scrape.mjs"
click node_data "https://github.com/cataragamihai/orar/tree/main/public/data"
click node_year "https://github.com/cataragamihai/orar/blob/main/academic-year.json"
click node_app "https://github.com/cataragamihai/orar/blob/main/public/app.js"
click node_schedule "https://github.com/cataragamihai/orar/blob/main/public/core.js"
click node_calendar "https://github.com/cataragamihai/orar/blob/main/scripts/build-cal.mjs"
click node_morning "https://github.com/cataragamihai/orar/blob/main/scripts/morning.mjs"
click node_sw "https://github.com/cataragamihai/orar/blob/main/public/sw.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_data,node_year,node_calendarclient toneBlue
class node_app,node_schedule toneAmber
class node_calendar,node_morning toneMint
class node_sw,node_browsercache toneRose
class node_student,node_faculty,node_push toneIndigo
```

## Components

### Data ingestion

- [eOra scraper](https://github.com/cataragamihai/orar/blob/main/scripts/scrape.mjs): `scripts/scrape.mjs`
- [Published timetable data](https://github.com/cataragamihai/orar/tree/main/public/data): `public/data`
- [Academic year calendar](https://github.com/cataragamihai/orar/blob/main/academic-year.json): `academic-year.json`

### Timetable app

- [Browser app](https://github.com/cataragamihai/orar/blob/main/public/app.js): `public/app.js`
- [Schedule logic](https://github.com/cataragamihai/orar/blob/main/public/core.js): `public/core.js`

### Calendar and alerts

- [Calendar files](https://github.com/cataragamihai/orar/blob/main/scripts/build-cal.mjs): `scripts/build-cal.mjs`
- [Morning summaries](https://github.com/cataragamihai/orar/blob/main/scripts/morning.mjs): `scripts/morning.mjs`

### Offline delivery

- [Service worker](https://github.com/cataragamihai/orar/blob/main/public/sw.js): `public/sw.js`
- **Browser cache**

### Other components

- **Student**
- **Faculty eOra**
- **Calendar client**
- **Push service**

## Connections

- Student → Browser app: chooses group (evidence: `public/app.js`)
- Browser app → Published timetable data: loads timetable (evidence: `public/app.js`)
- Browser app → Schedule logic: uses scheduling (evidence: `public/app.js`)
- Schedule logic → Browser app: returns lessons (evidence: `public/core.js`)
- Faculty eOra → eOra scraper: provides pages (evidence: `scripts/scrape.mjs`)
- eOra scraper → Published timetable data: writes JSON (evidence: `scripts/scrape.mjs`)
- Academic year calendar → Published timetable data: adds term dates
- Published timetable data → Calendar files: builds calendars (evidence: `scripts/build-cal.mjs`)
- Schedule logic → Calendar files: formats events (evidence: `scripts/build-cal.mjs`)
- Calendar client → Calendar files: subscribes
- Published timetable data → Morning summaries: reads group data (evidence: `scripts/morning.mjs`)
- Schedule logic → Morning summaries: selects classes (evidence: `scripts/morning.mjs`)
- Morning summaries → Push service: sends alerts (evidence: `scripts/morning.mjs`)
- Browser app → Push service: registers subscription
- Browser app → Service worker: registers worker (evidence: `public/app.js`)
- Service worker → Browser cache: caches responses (evidence: `public/sw.js`)
- Service worker → Browser app: serves offline (evidence: `public/sw.js`)
