# viovyx/ap-webuntistoics-node architecture

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

- Interactive diagram: https://gitdiagram.com/viovyx/ap-webuntistoics-node
- Repository: https://github.com/viovyx/ap-webuntistoics-node

## Overview

This is a WebUntis-to-calendar application: users select classes and hide courses in the built-in calendar, or copy an ICS URL to sync with an external calendar client. The browser store builds event sources and calls the server, which fetches WebUntis data, maps timetable entries, and returns calendar data. The server API and its cache are represented together because the sampled implementation combines them. Some client-to-server and external-client links are based on README documentation; unsampled endpoint details are not expanded.

Main entry points: [`server/server.ts`](https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/server.ts) (HTTP service), [`client/src/app/calendar-store.ts`](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar-store.ts) (Calendar store), [`client/src/app/app.ts`](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/app.ts) (App shell), [`client/src/app/calendar/calendar.ts`](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar/calendar.ts) (Built-in calendar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser application"]
  node_client_app["App shell<br/>[app.ts]"]
  node_client_calendar["Built-in calendar<br/>[calendar.ts]"]
  node_client_event["Calendar event view<br/>[calendar-event.ts]"]
  node_client_details["Event details<br/>[event-details.ts]"]
  node_client_settings["Settings menu<br/>[settings-menu.ts]"]
  node_client_popover["Popover<br/>[popover.ts]"]
  node_client_button["Action button<br/>[action-button.ts]"]
  node_client_store["Calendar store<br/>[calendar-store.ts]"]
  node_client_api["HTTP client<br/>[api.ts]"]
end

subgraph group_server["Calendar service"]
  node_server["HTTP service<br/>[server.ts]"]
  node_server_api["WebUntis API access<br/>[api.ts]"]
  node_mappers["Timetable mappers<br/>[mappers.ts]"]
end

subgraph group_untis["WebUntis data"]
  node_webuntis{{"WebUntis API"}}
end

node_user(("Calendar user"))
node_calendar_client(("External calendar client"))

node_user -->|"uses"| node_client_app
node_client_app -->|"seeds state"| node_client_store
node_client_app -->|"renders"| node_client_calendar
node_client_app -->|"renders"| node_client_settings
node_client_calendar -->|"reads event sources"| node_client_store
node_client_calendar -->|"renders"| node_client_event
node_client_calendar -->|"renders"| node_client_details
node_client_settings -->|"updates selections"| node_client_store
node_client_settings -->|"renders"| node_client_popover
node_client_settings -->|"uses"| node_client_button
node_client_details -->|"reads event state"| node_client_store
node_client_details -->|"uses"| node_client_popover
node_client_details -->|"uses"| node_client_button
node_client_store -->|"loads classes"| node_client_api
node_client_store -->|"loads schoolyears"| node_client_api
node_client_store -->|"creates event sources"| node_client_api
node_client_api -->|"requests calendar data"| node_server
node_server -->|"requests classes"| node_server_api
node_server -->|"requests schoolyears"| node_server_api
node_server -->|"requests timetable"| node_server_api
node_server -->|"maps API results"| node_mappers
node_server_api -->|"fetches and caches"| node_webuntis
node_server -->|"serves ICS sync"| node_calendar_client
node_calendar_client -->|"syncs by URL"| node_server

click node_client_app "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/app.ts"
click node_client_calendar "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar/calendar.ts"
click node_client_event "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar/calendar-event/calendar-event.ts"
click node_client_details "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/event-details/event-details.ts"
click node_client_settings "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/settings-menu/settings-menu.ts"
click node_client_popover "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/components/popover/popover.ts"
click node_client_button "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/components/action-button/action-button.ts"
click node_client_store "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar-store.ts"
click node_client_api "https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/api.ts"
click node_server "https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/server.ts"
click node_server_api "https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/src/api.ts"
click node_mappers "https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/src/mappers.ts"

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_client_app,node_client_calendar,node_client_event,node_client_details,node_client_settings,node_client_popover,node_client_button,node_client_store,node_client_api,node_user,node_calendar_client toneBlue
class node_server,node_server_api,node_mappers toneAmber
class node_webuntis toneMint
```

## Components

### Browser application

- [App shell](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/app.ts): `client/src/app/app.ts`
- [Built-in calendar](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar/calendar.ts): `client/src/app/calendar/calendar.ts`
- [Calendar event view](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar/calendar-event/calendar-event.ts): `client/src/app/calendar/calendar-event/calendar-event.ts`
- [Event details](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/event-details/event-details.ts): `client/src/app/event-details/event-details.ts`
- [Settings menu](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/settings-menu/settings-menu.ts): `client/src/app/settings-menu/settings-menu.ts`
- [Popover](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/components/popover/popover.ts): `client/src/app/components/popover/popover.ts`
- [Action button](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/components/action-button/action-button.ts): `client/src/app/components/action-button/action-button.ts`
- [Calendar store](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/app/calendar-store.ts): `client/src/app/calendar-store.ts`
- [HTTP client](https://github.com/viovyx/ap-webuntistoics-node/blob/main/client/src/api.ts): `client/src/api.ts`

### Calendar service

- [HTTP service](https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/server.ts): `server/server.ts`
- [WebUntis API access](https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/src/api.ts): `server/src/api.ts`
- [Timetable mappers](https://github.com/viovyx/ap-webuntistoics-node/blob/main/server/src/mappers.ts): `server/src/mappers.ts`

### WebUntis data

- **WebUntis API**

### Other components

- **Calendar user**
- **External calendar client**

## Connections

- Calendar user → App shell: uses (evidence: `README.md`)
- App shell → Calendar store: seeds state (evidence: `client/src/app/app.ts`)
- App shell → Built-in calendar: renders (evidence: `client/src/app/app.ts`)
- App shell → Settings menu: renders (evidence: `client/src/app/app.ts`)
- Built-in calendar → Calendar store: reads event sources (evidence: `client/src/app/calendar/calendar.ts`)
- Built-in calendar → Calendar event view: renders (evidence: `client/src/app/calendar/calendar.ts`)
- Built-in calendar → Event details: renders (evidence: `client/src/app/calendar/calendar.ts`)
- Settings menu → Calendar store: updates selections (evidence: `client/src/app/settings-menu/settings-menu.ts`)
- Settings menu → Popover: renders (evidence: `client/src/app/settings-menu/settings-menu.ts`)
- Settings menu → Action button: uses (evidence: `client/src/app/settings-menu/settings-menu.ts`)
- Event details → Calendar store: reads event state (evidence: `client/src/app/event-details/event-details.ts`)
- Event details → Popover: uses (evidence: `client/src/app/event-details/event-details.ts`)
- Event details → Action button: uses (evidence: `client/src/app/event-details/event-details.ts`)
- Calendar store → HTTP client: loads classes (evidence: `client/src/app/calendar-store.ts`)
- Calendar store → HTTP client: loads schoolyears (evidence: `client/src/app/calendar-store.ts`)
- Calendar store → HTTP client: creates event sources (evidence: `client/src/app/calendar-store.ts`)
- HTTP client → HTTP service: requests calendar data (evidence: `README.md`)
- HTTP service → WebUntis API access: requests classes (evidence: `server/server.ts`)
- HTTP service → WebUntis API access: requests schoolyears (evidence: `server/server.ts`)
- HTTP service → WebUntis API access: requests timetable (evidence: `server/server.ts`)
- HTTP service → Timetable mappers: maps API results (evidence: `server/server.ts`)
- WebUntis API access → WebUntis API: fetches and caches (evidence: `server/src/api.ts`)
- HTTP service → External calendar client: serves ICS sync (evidence: `README.md`)
- External calendar client → HTTP service: syncs by URL (evidence: `README.md`)
