diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000..3bea7ad --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "slc-companion", + "runtimeExecutable": "python", + "runtimeArgs": ["-m", "http.server", "8099", "--bind", "127.0.0.1", "--directory", "04_Tablet-Quiz/app"], + "port": 8099 + } + ] +} diff --git a/.gitignore b/.gitignore index 648a11e..c79c37b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ _*.png *.stl *.bak *.tmp +.claude/settings.local.json diff --git a/04_Tablet-Quiz/README.md b/04_Tablet-Quiz/README.md index 71b3a81..4a7170d 100644 --- a/04_Tablet-Quiz/README.md +++ b/04_Tablet-Quiz/README.md @@ -1,6 +1,14 @@ # Tablet-Quiz — Begleit-App (Teilprojekt) -**Status:** Konzept · **Typ:** eigenständiges Software-Teilprojekt des SLC-Workshops +**Status:** App lauffähig (PWA) · Deploy vorbereitet · **Typ:** eigenständiges Software-Teilprojekt des SLC-Workshops + +> **Umsetzungsstand:** Die App liegt unter [`app/`](app/) als statische **PWA** +> (offline-/kioskfähig). Sie führt den kompletten Flow durch (Action Card → +> Startpunkt → optionale Tour → Station: Diskussion/Quiz/Auflösung → Debrief mit +> **Markdown-/JSON-Export**). Inhalte (40 Stationen, 45 Quizfragen, 6 Use-Cases) +> sind derzeit in `app/index.html` eingebettet. **Deployment:** statisch, siehe +> [`app/DEPLOY.md`](app/DEPLOY.md). **Lokal testen:** `python -m http.server 8099 +> --directory 04_Tablet-Quiz/app` (oder Preview-Config `.claude/launch.json`). Das Tablet-Quiz ist der **digitale Begleiter** des Tabletops — kein Ersatz fürs Brett. Es ist der **erklärende Gegenpart** zu den Pucks: Die Pucks tragen nur die @@ -65,12 +73,13 @@ steht, sondern in der App liegt. ## 5. Funktionsumfang (MVP) -- [ ] `questions.json` + Stations-Inhalte aus YAMLs generieren (Build-Skript). -- [ ] Stationsführung: linearer Durchlauf mit „Nächste Station" + Fortschritt/Phasen-Farben. -- [ ] Fragetypen 1–3 (vermittelndes Quiz). -- [ ] „Auflösen"-Mechanik (Antwort erst auf Klick) **+ ausführliche Stationsauflösung** (Erklärung/RACI/Artefakt) nach dem Quiz. -- [ ] „Unklar"-Markierung je Aktivität. -- [ ] Debrief-Export (Markdown/JSON, lokal). +- [x] Stationsführung: linearer Durchlauf mit „Nächste Station" + Fortschritt/Phasen-Farben. +- [x] Fragetypen 1–3 (vermittelndes Quiz). +- [x] „Auflösen"-Mechanik (Antwort erst auf Klick) **+ ausführliche Stationsauflösung** (Erklärung/RACI/Artefakt) nach dem Quiz. +- [x] „Unklar"-Markierung je Aktivität. +- [x] Debrief-Export (Markdown **und** JSON, lokaler Download). +- [x] PWA / offline lauffähig (Manifest + Service Worker). +- [ ] `questions.json` + Stations-Inhalte aus YAMLs generieren (Build-Skript) — Inhalte aktuell in `app/index.html` eingebettet (braucht Blueprint-Repo-Zugriff). ### Später (Ausbau) - Gate-Fragen mit Rollen-Check (Typ 4–5). diff --git a/04_Tablet-Quiz/app/DEPLOY.md b/04_Tablet-Quiz/app/DEPLOY.md new file mode 100644 index 0000000..8fe2f1b --- /dev/null +++ b/04_Tablet-Quiz/app/DEPLOY.md @@ -0,0 +1,66 @@ +# Deployment — SLC-Workshop Companion (App) + +**Auftrag für die Server-Claude / Ops:** Diese App **statisch** ausliefern. Kein +Build-Schritt, kein Backend, keine Secrets, keine Datenbank. + +## Was das ist +- Eine **statische Single-Page-PWA**. Alle Inhalte (Stationen, Quiz, Use-Cases) + sind in `index.html` eingebettet — keine Laufzeit-API nötig. +- Dateien im Ordner `04_Tablet-Quiz/app/`: + - `index.html` — die App + - `manifest.webmanifest` — PWA-Manifest + - `sw.js` — Service Worker (Offline-Cache der App-Shell) + - `icon.svg` — App-Icon + +## Ziel +Den Ordner `04_Tablet-Quiz/app/` als **statisches Web-Root** über den vorhandenen +Webserver bereitstellen, erreichbar per **HTTPS** (oder localhost). + +> **Wichtig:** Der Service Worker (Offline/Installierbar) läuft **nur über HTTPS +> oder localhost**. Über reines `http://` ohne TLS registriert er sich nicht — +> die App funktioniert dann trotzdem, nur ohne Offline-Cache. + +## Schritte +1. Repo auf dem Server bereitstellen/aktualisieren: + `git clone https://git.1789.cloud/patrick/SLC_Game.git` (bzw. `git pull`). +2. Den Ordner `SLC_Game/04_Tablet-Quiz/app/` als statisches Root einbinden. + +### Beispiel nginx +```nginx +server { + listen 443 ssl; + server_name slc.example.intern; # anpassen + # ssl_certificate ... ; ssl_certificate_key ... ; + root /srv/SLC_Game/04_Tablet-Quiz/app; # Pfad anpassen + index index.html; + location = /sw.js { add_header Cache-Control "no-cache"; } # SW immer frisch + location / { try_files $uri $uri/ /index.html; } +} +``` + +### Beispiel Caddy (TLS automatisch) +```caddy +slc.example.intern { + root * /srv/SLC_Game/04_Tablet-Quiz/app + file_server + header /sw.js Cache-Control "no-cache" +} +``` + +## Verifikation nach dem Deploy +1. URL öffnen → Startbildschirm „SLC Companion · Schritt 1 · Action Card". +2. DevTools → Application → **Service Workers**: `sw.js` ist *activated*. +3. Flugmodus/Offline → Seite neu laden → App lädt weiterhin (Offline-Cache). +4. Einen Durchlauf spielen → „Debrief" → **↓ Markdown / ↓ JSON** lädt eine Datei. + +## Updates +- Bei neuem Stand: `git pull`. Wenn sich App-Assets geändert haben, in `sw.js` + die Konstante `CACHE` hochzählen (z. B. `slc-companion-v1` → `-v2`), damit der + Service Worker den Cache erneuert. + +## Noch offen (nicht Teil dieses Deploys) +- **YAML→Inhaltspipeline:** Inhalte sind aktuell in `index.html` eingebettet. + Später aus den Blueprint-`service-lifecycle_*.yaml` generieren (braucht Zugriff + aufs Blueprint-Repo). Bis dahin werden Inhalte direkt in `index.html` gepflegt. +- **Companion-Chatbot** (optionaler Nachschlage-Bot) — siehe `../README.md` §8; + *braucht* ein LLM-Backend und ist daher **nicht** Teil der statischen App. diff --git a/04_Tablet-Quiz/app/icon.svg b/04_Tablet-Quiz/app/icon.svg new file mode 100644 index 0000000..1c77ea5 --- /dev/null +++ b/04_Tablet-Quiz/app/icon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/04_Tablet-Quiz/prototype/index.html b/04_Tablet-Quiz/app/index.html similarity index 97% rename from 04_Tablet-Quiz/prototype/index.html rename to 04_Tablet-Quiz/app/index.html index a7fca02..94058c5 100644 --- a/04_Tablet-Quiz/prototype/index.html +++ b/04_Tablet-Quiz/app/index.html @@ -3,7 +3,12 @@ -SLC-Workshop — Companion-App (Prototyp) +SLC-Workshop — Companion-App + + + + +