# elias-phy-ja/semestria architecture

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

- Interactive diagram: https://gitdiagram.com/elias-phy-ja/semestria
- Repository: https://github.com/elias-phy-ja/semestria

## Overview

Semestria is a local-first school companion: it reads a personal Schulnetz iCal feed, parses lessons, exams and appointments, then optionally syncs selected events to Outlook. Its WPF app also manages profiles, calendar entries, tasks and grade calculations, with a tray mode and update/news features. The main sync and persistence links are supported by excerpts or the source index; several UI feature links are documented in the README, since their implementation was not sampled.

Main entry points: [`SchulnetzSync.UI/Services/SyncService.cs`](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Services/SyncService.cs) (Sync service), [`SchulnetzSync.UI/App.xaml.cs`](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/App.xaml.cs) (App startup), [`SchulnetzSync.UI/AppState.cs`](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/AppState.cs) (App state), [`SchulnetzSync.Core/Feed/HttpFeedSource.cs`](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Feed/HttpFeedSource.cs) (iCal fetch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_feed["Feed and events"]
  node_feed_source["iCal fetch<br/>[HttpFeedSource.cs]"]
  node_feed_parser["iCal parser<br/>[FeedParser.cs]"]
  node_event_model["School events<br/>[SchulnetzEvent.cs]"]
end

subgraph group_calendar["Outlook sync"]
  node_sync_service["Sync service<br/>[SyncService.cs]"]
  node_sync_engine["Sync planner<br/>[SyncEngine.cs]"]
  node_sync_plan["Sync actions<br/>[SyncPlan.cs]"]
  node_graph_target["Graph calendar"]
  node_auth["Microsoft sign-in"]
end

subgraph group_app["App and profiles"]
  node_app_entry["App startup<br/>[App.xaml.cs]"]
  node_profile["Profile management<br/>[Profile.cs]"]
  node_profile_paths["Profile paths<br/>[DataPaths.cs]"]
  node_config["Sync configuration<br/>[ConfigManager.cs]"]
  node_local_data[("Local user data<br/>[LocalJsonStore.cs]")]
  node_app_state["App state<br/>[AppState.cs]"]
end

subgraph group_school["School tools"]
  node_calendar_ui["Calendar views<br/>[EventsPage.xaml.cs]"]
  node_tasks["Tasks and reminders<br/>[TasksPage.xaml.cs]"]
  node_grades["Grades and promotion<br/>[PromotionRule.cs]"]
  node_dashboard["Dashboard"]
end

subgraph group_support["App services"]
  node_tray["System tray<br/>[TrayService.cs]"]
  node_news["News<br/>[HttpNewsSource.cs]"]
  node_updates["Update checks<br/>[UpdateGate.cs]"]
  node_help["Guides and help<br/>[HelpPage.xaml.cs]"]
end

node_user(("Student"))
node_outlook[("Outlook calendar")]

node_user -->|"opens"| node_app_entry
node_app_entry -->|"initializes"| node_profile
node_profile -->|"selects paths"| node_profile_paths
node_app_entry -->|"starts"| node_tray
node_app_entry -->|"loads news"| node_news
node_app_entry -.->|"checks updates"| node_updates
node_user -.->|"provides feed"| node_feed_source
node_feed_source -->|"supplies iCal"| node_feed_parser
node_feed_parser -->|"creates events"| node_event_model
node_sync_service -->|"fetches feed"| node_feed_source
node_sync_service -->|"parses feed"| node_feed_parser
node_sync_service -->|"builds plan"| node_sync_engine
node_sync_engine -->|"returns actions"| node_sync_plan
node_sync_service -->|"executes plan"| node_graph_target
node_graph_target -->|"reads and writes"| node_outlook
node_sync_service -->|"acquires token"| node_auth
node_auth -->|"authenticates"| node_outlook
node_app_state -->|"persists data"| node_local_data
node_app_state -->|"loads config"| node_config
node_user -->|"views calendar"| node_calendar_ui
node_user -->|"manages tasks"| node_tasks
node_tasks -->|"uses app state"| node_app_state
node_user -->|"calculates grades"| node_grades
node_user -->|"checks overview"| node_dashboard
node_user -->|"opens guidance"| node_help

click node_app_entry "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/App.xaml.cs"
click node_feed_source "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Feed/HttpFeedSource.cs"
click node_feed_parser "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Feed/FeedParser.cs"
click node_event_model "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Model/SchulnetzEvent.cs"
click node_sync_service "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Services/SyncService.cs"
click node_sync_engine "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Sync/SyncEngine.cs"
click node_sync_plan "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Sync/SyncPlan.cs"
click node_graph_target "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Calendar/GraphCalendarTarget.cs"
click node_auth "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Calendar/MsalAuthProvider.cs"
click node_profile "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Profiles/Profile.cs"
click node_profile_paths "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Profiles/DataPaths.cs"
click node_config "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Configuration/ConfigManager.cs"
click node_local_data "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Storage/LocalJsonStore.cs"
click node_app_state "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/AppState.cs"
click node_calendar_ui "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/EventsPage.xaml.cs"
click node_tasks "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/TasksPage.xaml.cs"
click node_grades "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Grades/PromotionRule.cs"
click node_dashboard "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/DashboardPage.xaml.cs"
click node_tray "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/TrayService.cs"
click node_news "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/News/HttpNewsSource.cs"
click node_updates "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Update/UpdateGate.cs"
click node_help "https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/HelpPage.xaml.cs"

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_feed_source,node_feed_parser,node_event_model toneBlue
class node_sync_service,node_sync_engine,node_sync_plan,node_graph_target,node_auth,node_outlook toneAmber
class node_app_entry,node_profile,node_profile_paths,node_config,node_local_data,node_app_state toneMint
class node_calendar_ui,node_tasks,node_grades,node_dashboard toneRose
class node_tray,node_news,node_updates,node_help,node_user toneIndigo
```

## Components

### Feed and events

- [iCal fetch](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Feed/HttpFeedSource.cs): `SchulnetzSync.Core/Feed/HttpFeedSource.cs`
- [iCal parser](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Feed/FeedParser.cs): `SchulnetzSync.Core/Feed/FeedParser.cs`
- [School events](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Model/SchulnetzEvent.cs): `SchulnetzSync.Core/Model/SchulnetzEvent.cs`

### Outlook sync

- [Sync service](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Services/SyncService.cs): `SchulnetzSync.UI/Services/SyncService.cs`
- [Sync planner](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Sync/SyncEngine.cs): `SchulnetzSync.Core/Sync/SyncEngine.cs`
- [Sync actions](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Sync/SyncPlan.cs): `SchulnetzSync.Core/Sync/SyncPlan.cs`
- [Graph calendar](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Calendar/GraphCalendarTarget.cs): `SchulnetzSync.Core/Calendar/GraphCalendarTarget.cs`
- [Microsoft sign-in](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Calendar/MsalAuthProvider.cs): `SchulnetzSync.Core/Calendar/MsalAuthProvider.cs`

### App and profiles

- [App startup](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/App.xaml.cs): `SchulnetzSync.UI/App.xaml.cs`
- [Profile management](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Profiles/Profile.cs): `SchulnetzSync.Core/Profiles/Profile.cs`
- [Profile paths](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Profiles/DataPaths.cs): `SchulnetzSync.Core/Profiles/DataPaths.cs`
- [Sync configuration](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Configuration/ConfigManager.cs): `SchulnetzSync.Core/Configuration/ConfigManager.cs`
- [Local user data](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Storage/LocalJsonStore.cs): `SchulnetzSync.Core/Storage/LocalJsonStore.cs`
- [App state](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/AppState.cs): `SchulnetzSync.UI/AppState.cs`

### School tools

- [Calendar views](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/EventsPage.xaml.cs): `SchulnetzSync.UI/Pages/EventsPage.xaml.cs`
- [Tasks and reminders](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/TasksPage.xaml.cs): `SchulnetzSync.UI/Pages/TasksPage.xaml.cs`
- [Grades and promotion](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Grades/PromotionRule.cs): `SchulnetzSync.Core/Grades/PromotionRule.cs`
- [Dashboard](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/DashboardPage.xaml.cs): `SchulnetzSync.UI/Pages/DashboardPage.xaml.cs`

### App services

- [System tray](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/TrayService.cs): `SchulnetzSync.UI/TrayService.cs`
- [News](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/News/HttpNewsSource.cs): `SchulnetzSync.Core/News/HttpNewsSource.cs`
- [Update checks](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.Core/Update/UpdateGate.cs): `SchulnetzSync.Core/Update/UpdateGate.cs`
- [Guides and help](https://github.com/elias-phy-ja/semestria/blob/main/SchulnetzSync.UI/Pages/HelpPage.xaml.cs): `SchulnetzSync.UI/Pages/HelpPage.xaml.cs`

### Other components

- **Student**
- **Outlook calendar**

## Connections

- Student → App startup: opens (evidence: `SchulnetzSync.UI/App.xaml.cs`)
- App startup → Profile management: initializes (evidence: `SchulnetzSync.UI/App.xaml.cs`)
- Profile management → Profile paths: selects paths (evidence: `SchulnetzSync.Core/Profiles/DataPaths.cs`)
- App startup → System tray: starts (evidence: `SchulnetzSync.UI/App.xaml.cs`)
- App startup → News: loads news (evidence: `SchulnetzSync.UI/App.xaml.cs`)
- App startup → Update checks: checks updates
- Student → iCal fetch: provides feed
- iCal fetch → iCal parser: supplies iCal (evidence: `SchulnetzSync.UI/Services/SyncService.cs`)
- iCal parser → School events: creates events (evidence: `SchulnetzSync.Core/Feed/FeedParser.cs`)
- Sync service → iCal fetch: fetches feed (evidence: `SchulnetzSync.UI/Services/SyncService.cs`)
- Sync service → iCal parser: parses feed (evidence: `SchulnetzSync.UI/Services/SyncService.cs`)
- Sync service → Sync planner: builds plan (evidence: `SchulnetzSync.UI/Services/SyncService.cs`)
- Sync planner → Sync actions: returns actions (evidence: `SchulnetzSync.Core/Sync/SyncEngine.cs`)
- Sync service → Graph calendar: executes plan (evidence: `SchulnetzSync.UI/Services/SyncService.cs`)
- Graph calendar → Outlook calendar: reads and writes
- Sync service → Microsoft sign-in: acquires token (evidence: `SchulnetzSync.UI/Services/SyncService.cs`)
- Microsoft sign-in → Outlook calendar: authenticates (evidence: `SchulnetzSync.Core/Calendar/MsalAuthProvider.cs`)
- App state → Local user data: persists data (evidence: `SchulnetzSync.UI/AppState.cs`)
- App state → Sync configuration: loads config (evidence: `SchulnetzSync.UI/AppState.cs`)
- Student → Calendar views: views calendar (evidence: `README.md`)
- Student → Tasks and reminders: manages tasks (evidence: `README.md`)
- Tasks and reminders → App state: uses app state (evidence: `SchulnetzSync.UI/Pages/TasksPage.xaml.cs`)
- Student → Grades and promotion: calculates grades (evidence: `README.md`)
- Student → Dashboard: checks overview (evidence: `README.md`)
- Student → Guides and help: opens guidance (evidence: `README.md`)
