# flametan/bvi-lernwebsite architecture

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

## Overview

BVI-Lernwebsite is an offline-capable study and exam-preparation PWA for the higher fire-service technical course, with an Android WebView companion. The main learner journey is to choose a topic or training activity, study or answer questions, and retain progress locally; separate branches provide case exercises, schedules, and leisure games. The repository also contains an IdF mission simulator and a sync/ranking service. Several connections are documented by the README or excerpts; unsampled wiring is intentionally left out.

Main entry points: [`js/app.js`](https://github.com/flametan/bvi-lernwebsite/blob/main/js/app.js) (App Navigation), [`android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt`](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt) (Android WebView), [`js/pause.js`](https://github.com/flametan/bvi-lernwebsite/blob/main/js/pause.js) (Break Room), [`android/app/src/main/java/de/bvi/lernwebsite/Schedule.kt`](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Schedule.kt) (Course Schedule)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning App"]
  node_app["App Navigation<br/>[app.js]"]
  node_cards["Study Cards<br/>[brainyoo-data.js]"]
  node_career["Career Training<br/>[laufbahn.js]"]
  node_cases["Legal Cases<br/>[fallbearbeitung.js]"]
  node_scenarios["Decision Scenarios<br/>[scenarios.js]"]
end

subgraph group_course["Course Tools"]
  node_cohorts["Cohort Editor<br/>[jg-ui.js]"]
  node_cohortdata["Cohort Data<br/>[jg.js]"]
  node_schedule["Course Schedule<br/>[Schedule.kt]"]
  node_roomplan["3D Room Plan<br/>[raumplan.js]"]
  node_faq["Location FAQ<br/>[faq.js]"]
end

subgraph group_practice["Practice &amp; Games"]
  node_pause["Break Room<br/>[pause.js]"]
  node_quizdata["Break Quiz Data<br/>[pause-data.js]"]
  node_duel["Driving Duel<br/>[duell.js]"]
  node_wordgames["Mini Games<br/>[game.js]"]
  node_idfgame["IdF Simulator<br/>[app.js]"]
  node_missionmodules["Mission Modules<br/>[m-welt.js]"]
end

subgraph group_platform["App Platforms"]
  node_pwa["Offline PWA<br/>[sw.js]"]
  node_android["Android WebView<br/>[MainActivity.kt]"]
  node_widgets["Home Widgets<br/>[Widgets.kt]"]
  node_reminder["Study Reminders<br/>[Reminder.kt]"]
  node_streak["Streak Icon<br/>[StreakIcon.kt]"]
end

subgraph group_service["Sync Service"]
  node_syncclient["Sync Client<br/>[sync.js]"]
  node_syncserver["Sync API<br/>[server.js]"]
  node_blobstore[("Encrypted Blobs<br/>[server.js]")]
  node_ranking["Ranking &amp; Duels<br/>[rank.js]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_app
node_app -->|"offers study"| node_cards
node_app -->|"navigates to"| node_career
node_app -->|"navigates to"| node_cases
node_app -->|"offers scenarios"| node_scenarios
node_app -->|"offers editing"| node_cohorts
node_cohorts -->|"uses cohort data"| node_cohortdata
node_app -->|"shows schedule"| node_schedule
node_schedule -->|"opens room view"| node_roomplan
node_schedule -->|"links location FAQ"| node_faq
node_app -->|"opens break room"| node_pause
node_pause -->|"uses questions"| node_quizdata
node_pause -->|"offers duel"| node_duel
node_pause -->|"offers games"| node_wordgames
node_learner -->|"starts training"| node_idfgame
node_idfgame -->|"loads mission"| node_missionmodules
node_idfgame -->|"registers worker"| node_pwa
node_app -->|"offline support"| node_pwa
node_learner -->|"uses companion app"| node_android
node_android -->|"uses schedule"| node_schedule
node_android -->|"uses widgets"| node_widgets
node_android -->|"uses reminders"| node_reminder
node_android -->|"uses streak icon"| node_streak
node_syncclient -.->|"syncs data"| node_syncserver
node_syncserver -->|"reads and writes"| node_blobstore
node_syncserver -->|"delegates ranking"| node_ranking

click node_app "https://github.com/flametan/bvi-lernwebsite/blob/main/js/app.js"
click node_cards "https://github.com/flametan/bvi-lernwebsite/blob/main/js/brainyoo-data.js"
click node_career "https://github.com/flametan/bvi-lernwebsite/blob/main/js/laufbahn.js"
click node_cases "https://github.com/flametan/bvi-lernwebsite/blob/main/js/fallbearbeitung.js"
click node_scenarios "https://github.com/flametan/bvi-lernwebsite/blob/main/js/scenarios.js"
click node_cohorts "https://github.com/flametan/bvi-lernwebsite/blob/main/js/jg-ui.js"
click node_cohortdata "https://github.com/flametan/bvi-lernwebsite/blob/main/js/jg.js"
click node_schedule "https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Schedule.kt"
click node_roomplan "https://github.com/flametan/bvi-lernwebsite/blob/main/js/raumplan.js"
click node_faq "https://github.com/flametan/bvi-lernwebsite/blob/main/js/faq.js"
click node_pause "https://github.com/flametan/bvi-lernwebsite/blob/main/js/pause.js"
click node_quizdata "https://github.com/flametan/bvi-lernwebsite/blob/main/js/pause-data.js"
click node_duel "https://github.com/flametan/bvi-lernwebsite/blob/main/js/duell.js"
click node_wordgames "https://github.com/flametan/bvi-lernwebsite/blob/main/js/game.js"
click node_idfgame "https://github.com/flametan/bvi-lernwebsite/blob/main/game/js/app.js"
click node_missionmodules "https://github.com/flametan/bvi-lernwebsite/blob/main/game/js/m-welt.js"
click node_pwa "https://github.com/flametan/bvi-lernwebsite/blob/main/sw.js"
click node_android "https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt"
click node_widgets "https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Widgets.kt"
click node_reminder "https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Reminder.kt"
click node_streak "https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/StreakIcon.kt"
click node_syncclient "https://github.com/flametan/bvi-lernwebsite/blob/main/js/sync.js"
click node_syncserver "https://github.com/flametan/bvi-lernwebsite/blob/main/sync-server/server.js"
click node_blobstore "https://github.com/flametan/bvi-lernwebsite/blob/main/sync-server/server.js"
click node_ranking "https://github.com/flametan/bvi-lernwebsite/blob/main/sync-server/rank.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_app,node_cards,node_career,node_cases,node_scenarios toneBlue
class node_cohorts,node_cohortdata,node_schedule,node_roomplan,node_faq toneAmber
class node_pause,node_quizdata,node_duel,node_wordgames,node_idfgame,node_missionmodules toneMint
class node_pwa,node_android,node_widgets,node_reminder,node_streak toneRose
class node_syncclient,node_syncserver,node_blobstore,node_ranking,node_learner toneIndigo
```

## Components

### Learning App

- [App Navigation](https://github.com/flametan/bvi-lernwebsite/blob/main/js/app.js): `js/app.js`
- [Study Cards](https://github.com/flametan/bvi-lernwebsite/blob/main/js/brainyoo-data.js): `js/brainyoo-data.js`
- [Career Training](https://github.com/flametan/bvi-lernwebsite/blob/main/js/laufbahn.js): `js/laufbahn.js`
- [Legal Cases](https://github.com/flametan/bvi-lernwebsite/blob/main/js/fallbearbeitung.js): `js/fallbearbeitung.js`
- [Decision Scenarios](https://github.com/flametan/bvi-lernwebsite/blob/main/js/scenarios.js): `js/scenarios.js`

### Course Tools

- [Cohort Editor](https://github.com/flametan/bvi-lernwebsite/blob/main/js/jg-ui.js): `js/jg-ui.js`
- [Cohort Data](https://github.com/flametan/bvi-lernwebsite/blob/main/js/jg.js): `js/jg.js`
- [Course Schedule](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Schedule.kt): `android/app/src/main/java/de/bvi/lernwebsite/Schedule.kt`
- [3D Room Plan](https://github.com/flametan/bvi-lernwebsite/blob/main/js/raumplan.js): `js/raumplan.js`
- [Location FAQ](https://github.com/flametan/bvi-lernwebsite/blob/main/js/faq.js): `js/faq.js`

### Practice & Games

- [Break Room](https://github.com/flametan/bvi-lernwebsite/blob/main/js/pause.js): `js/pause.js`
- [Break Quiz Data](https://github.com/flametan/bvi-lernwebsite/blob/main/js/pause-data.js): `js/pause-data.js`
- [Driving Duel](https://github.com/flametan/bvi-lernwebsite/blob/main/js/duell.js): `js/duell.js`
- [Mini Games](https://github.com/flametan/bvi-lernwebsite/blob/main/js/game.js): `js/game.js`
- [IdF Simulator](https://github.com/flametan/bvi-lernwebsite/blob/main/game/js/app.js): `game/js/app.js`
- [Mission Modules](https://github.com/flametan/bvi-lernwebsite/blob/main/game/js/m-welt.js): `game/js/m-welt.js`

### App Platforms

- [Offline PWA](https://github.com/flametan/bvi-lernwebsite/blob/main/sw.js): `sw.js`
- [Android WebView](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt): `android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt`
- [Home Widgets](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Widgets.kt): `android/app/src/main/java/de/bvi/lernwebsite/Widgets.kt`
- [Study Reminders](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/Reminder.kt): `android/app/src/main/java/de/bvi/lernwebsite/Reminder.kt`
- [Streak Icon](https://github.com/flametan/bvi-lernwebsite/blob/main/android/app/src/main/java/de/bvi/lernwebsite/StreakIcon.kt): `android/app/src/main/java/de/bvi/lernwebsite/StreakIcon.kt`

### Sync Service

- [Sync Client](https://github.com/flametan/bvi-lernwebsite/blob/main/js/sync.js): `js/sync.js`
- [Sync API](https://github.com/flametan/bvi-lernwebsite/blob/main/sync-server/server.js): `sync-server/server.js`
- [Encrypted Blobs](https://github.com/flametan/bvi-lernwebsite/blob/main/sync-server/server.js): `sync-server/server.js`
- [Ranking & Duels](https://github.com/flametan/bvi-lernwebsite/blob/main/sync-server/rank.js): `sync-server/rank.js`

### Other components

- **Learner**

## Connections

- Learner → App Navigation: opens
- App Navigation → Study Cards: offers study
- App Navigation → Career Training: navigates to
- App Navigation → Legal Cases: navigates to
- App Navigation → Decision Scenarios: offers scenarios
- App Navigation → Cohort Editor: offers editing
- Cohort Editor → Cohort Data: uses cohort data
- App Navigation → Course Schedule: shows schedule
- Course Schedule → 3D Room Plan: opens room view
- Course Schedule → Location FAQ: links location FAQ
- App Navigation → Break Room: opens break room
- Break Room → Break Quiz Data: uses questions
- Break Room → Driving Duel: offers duel
- Break Room → Mini Games: offers games
- Learner → IdF Simulator: starts training (evidence: `game/js/app.js`)
- IdF Simulator → Mission Modules: loads mission (evidence: `game/js/app.js`)
- IdF Simulator → Offline PWA: registers worker (evidence: `game/js/app.js`)
- App Navigation → Offline PWA: offline support
- Learner → Android WebView: uses companion app
- Android WebView → Course Schedule: uses schedule (evidence: `android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt`)
- Android WebView → Home Widgets: uses widgets (evidence: `android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt`)
- Android WebView → Study Reminders: uses reminders (evidence: `android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt`)
- Android WebView → Streak Icon: uses streak icon (evidence: `android/app/src/main/java/de/bvi/lernwebsite/MainActivity.kt`)
- Sync Client → Sync API: syncs data
- Sync API → Encrypted Blobs: reads and writes (evidence: `sync-server/server.js`)
- Sync API → Ranking & Duels: delegates ranking (evidence: `sync-server/server.js`)
