Skip to content

feat: PWA — chatbot installeren als webapp op telefoon, incl. icon (fase 1 op NAS) - #36

Merged
Atrium0804 merged 5 commits into
mainfrom
35-pwa-webapp
Nov 6, 2026
Merged

Atrium0804 merged 5 commits into
mainfrom
35-pwa-webapp

Conversation

@Atrium0804

@Atrium0804 Atrium0804 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Implementeert #35: de chatbot is installeerbaar als webapp (PWA) op de telefoon, inclusief thuis-schermicon.

Wat er verandert

  • app/static/manifest.webmanifest — name "WTC Chatbot", short_name "Wheely", display standalone, relative start_url/scope (VPS-migratie is straks DNS-only), theme-color #033ec2, icons 192/512 + maskable
  • app/static/sw.js — service worker die ALLEEN de app-shell cachet; /chat, /feedback, /healthz gaan altijd via netwerk en worden NOOIT gecached (privacy-belofte)
  • app/static/icons/ — gegenereerd uit wielie.jpg via scripts/make_icons.py (192, 512, maskable 512 op clubblauw, apple-touch-icon 180, favicon 32)
  • index.html — manifest/icon/theme-color/apple-metatags, viewport-fit=cover, SW-registratie
  • CSP in main.py + Caddyfile: worker-src 'self'; manifest-src 'self'
  • ADR-0007: fase 1 op de NAS achter NPM (chat.famstieltjes.nl, Let's Encrypt) — amendeert ADR-0002; VPS blijft einddoel
  • how-to voor leden: docs/how-to/zet-chatbot-op-je-beginscherm.md

Performance (gemeten: pagina 30-250 ms, /chat 25-47 s door de Mistral-agent-chain)

  • wachtbericht "Wheely denkt na…" tijdens /chat
  • achtergrond 1,36 MB PNG -> 104 KB JPEG (sw.js cache v2, A5 uit de shell)
  • Cache-Control: html/manifest/sw.js no-cache, statische assets max-age=3600, API-antwoorden nooit gecachet
  • Mistral-timeout 180s -> 60s met leesbare foutmelding (eval houdt eigen 180s)

Verified

  • pytest app/tests: 20 passed; volledige suite: 95 passed + 43 subtests
  • live op NAS gemeten: container healthy (/healthz ok, mistral reachable), manifest/sw.js/icons 200 met juiste content-types

Deploy (fase 1, NAS)

  1. NPM proxy host: chat.famstieltjes.nl -> http://wtchatbot:8000 (Let's Encrypt, Force SSL, HTTP/2, HSTS) — gedraaid, site is live
  2. .env met MISTRAL_API_KEY + MISTRAL_AGENT_ID op de NAS in /volume1/docker/wtchatbot/
  3. .\scripts\deploy-nas.ps1 -Apply -Up (opnieuw draaien voor deze perf-commit)
  4. Check: curl -s https://chat.famstieltjes.nl/healthz; op telefoon: Android Chrome toont installatieprompt, iPhone Safari -> deelblad -> "Zet op beginscherm"

Let op: webapp-installatie werkt alleen via HTTPS — op LAN-HTTP registreert de service worker niet (chat zelf wel).

Closes #35

Ivo Stieltjes and others added 5 commits November 5, 2026 23:26
…ker-src/manifest-src (#35)

- app/static/manifest.webmanifest: name 'WTC Chatbot', short_name 'Wheely',
  display standalone, relative start_url/scope, theme-color #033ec2,
  icons 192/512 + maskable 512
- app/static/sw.js: cachet alleen de app-shell; /chat, /feedback, /healthz
  worden NOOIT gecached (privacy); navigaties network-first
- app/static/icons/: gegenereerd uit wielie.jpg via scripts/make_icons.py
  (192, 512, maskable 512 op clubblauw, apple-touch-icon 180, favicon 32)
- index.html: manifest/icon/theme-color/apple-metatags, viewport-fit=cover,
  serviceWorker.register('/sw.js')
- CSP in main.py + Caddyfile: worker-src 'self'; manifest-src 'self'
- tests: manifest content-type, sw.js content-type + no-cache-API, iconen,
  head-tags, CSP — 17 app-tests groen

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
…stname chat.famstieltjes.nl (#35)

- ADR-0007 amendeert ADR-0002 voor fase 1: NAS achter NPM + Let's Encrypt,
  API-key in fase 1 op de NAS, exit naar VPS is DNS-only
- how-to 'Zet de chatbot op je beginscherm' (Android Chrome + iPhone Safari)
- GLOSSARY: term Webapp (PWA); operations.md: key-locatie + monitoring fase 1
- NAS-referenties in deploy-nas.ps1 / docker-compose.nas.yml / app/README.md
  omgezet naar chat.famstieltjes.nl (VPS-domein wtchat.famstieltjes.nl blijft)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
)

- index.html: wachtbericht 'Wheely denkt na…' tijdens /chat
- Achtergrond 16-9.png (1,36 MB) vervangen door JPEG q80 (104 KB);
  sw.js shell cachet de jpg (cache-versie v2); A5 uit de shell (nergens
  gerefereerd)
- main.py: Cache-Control — html/manifest/sw.js no-cache, statische
  assets public max-age=3600, API-antwoorden nooit gecachet
- mistral_client.py: DEFAULT_TIMEOUT 180 -> 60s met leesbare
  RuntimeError bij timeout (eval gebruikt eigen timeout, ongewijzigd)
- tests: cache-headers, timeout-default, wachtbericht — 20 app-tests groen

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
…r bericht

- Router: licenties, verzekeringen, NK's, leeftijdscategorie, verzet en
  Titel 20 / Nationale Besluiten direct naar de knwu-agent; routeringsvraag
  alleen met de drie vaste vraagtypes.
- Content-agents: eerst bronnen, dan één vraag per bericht (de vraag die de
  meeste antwoorden uitsluit), stoppen zodra het antwoord vastligt.
- knwu-agent: licentiecategorie volgt alleen uit het geboortejaar.
- club-agent: handoff naar knwu-agent voor licentievragen.
- Eval: optionele velden `via: router` en `niet_in_antwoord`; nieuwe
  licentievraag end-to-end via de router.
- Glossary: Licentie, Licentiecategorie, KNWU-lidmaatschap.

Closes #38

Co-authored-by: Copilot <[email protected]>
Use a secure UUID fallback, guard failed startup, and add opt-in privacy-safe diagnostics with regression coverage. Verified chat recovery on the affected iPhone. Fixes #39.

Co-authored-by: Copilot <[email protected]>
@Atrium0804
Atrium0804 merged commit 2e8e11a into main Nov 6, 2026
2 checks passed
@Atrium0804
Atrium0804 deleted the 35-pwa-webapp branch November 13, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: chatbot installeren als webapp (PWA) op telefoon, incl. icon — fase 1 op NAS

1 participant