- 04_Tablet-Quiz/prototype -> app/ (deploybarer Stand). - PWA: manifest.webmanifest + sw.js (Offline-App-Shell) + icon.svg, im <head> eingebunden, Service-Worker-Registrierung. - Debrief-Export als Datei-Download (Markdown UND JSON) ergaenzt. - DEPLOY.md: Anleitung fuer statisches Hosting (nginx/Caddy, HTTPS, Verifikation). - README: Umsetzungsstand + MVP-Haken aktualisiert. - .claude/launch.json (lokale Preview), settings.local.json ge-gitignored. Verifiziert: 40 Stationen / 3 Gates / 45 Quizfragen, JS+SW-Syntax + Manifest valide, alle Assets via http 200. (Inhalte noch in index.html eingebettet; YAML-Pipeline = naechster Schritt.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
66 lines
2.7 KiB
Markdown
66 lines
2.7 KiB
Markdown
# 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.
|