Scrum4Me/docs
Janpeter Visser 7ae8a24372
Sprint: pbi-55 (#156)
* ST-cmovs79lt: Schema + migratie PushSubscription model

Voeg PushSubscription model toe aan prisma/schema.prisma met
snake_case-conventie, relation field op User, en bijbehorende
migratie (push_subscriptions tabel, FK + index op user_id).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs7e3o: web-push dependency + VAPID env vars feature-gated

Voeg web-push + @types/web-push toe aan package.json.
Registreer NEXT_PUBLIC_VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY,
VAPID_SUBJECT en INTERNAL_PUSH_SECRET als .optional() in lib/env.ts.
Documenteer alle vier in .env.example en README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs7jgr: lib/push-server.ts met sendPushToUser + stale-cleanup

Server-only push-lib met VAPID feature-gate, send naar alle
subscriptions van een user, en automatische cleanup bij 404/410.
Unit tests: success-pad, 410 verwijdert sub, 404 verwijdert sub,
andere errors loggen zonder delete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs7ouz: lib/push-client.ts client-side push helpers + stub actions/push.ts

Client-side helpers: isPushSupported, isIOSSafari, isStandalonePWA,
urlBase64ToUint8Array, subscribeToPush, unsubscribeFromPush.
Stub actions/push.ts zodat imports resolven (implementatie volgt
in volgende taak). Unit tests voor urlBase64ToUint8Array.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs7ut4: actions/push.ts subscribeToPushAction + unsubscribeFromPushAction

Vervangt stub met volledige implementatie: requireUser via getSession,
demo-block, Zod-validatie, upsert met user_id-scoping en user-scoped
deleteMany. Tests (8): idempotentie, demo-block, unauthenticated, invalid input.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs80c1: POST /api/internal/push/send met constant-time Bearer check

Route: 503 als INTERNAL_PUSH_SECRET uitstaat, 401 bij verkeerd secret
(timingSafeEqual), 400 bij invalid JSON, 422 bij Zod-fout, 204 bij succes.
push-server.ts: env-import vervangen door process.env om SESSION_SECRET
validatie tijdens build te omzeilen. Tests aangepast.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs862j: Admin test-send route + public/sw.js service worker

POST /api/internal/push/test-send: requireAdmin check (redirect bij
niet-admin), optioneel body met defaults, roept sendPushToUser aan, 204.
public/sw.js: push-handler met showNotification, notificationclick met
same-origin guard, focus bestaand venster of openWindow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs8jvq: PushToggle component met 3 states + iOS-banner

Client component met states loading/unsupported/ios-needs-install/
denied/subscribed/unsubscribed. useEffect detecteert initial status,
permission-prompt alleen via user-click. iOS-banner NL, denied-uitleg,
subscribe/unsubscribe knoppen met sonner-toasts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs8psg: notifications-sheet + iOS meta-tags in layout

notifications-sheet.tsx: PushToggle onderin met sectie
'Notificatie-instellingen' en visuele scheidslijn.
app/layout.tsx: appleWebApp.capable, statusBarStyle en
mobile-web-app-capable meta-tags toegevoegd via Next.js Metadata API.
manifest.json had al display: standalone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* ST-cmovs8vxj: docs/patterns/web-push.md pattern-documentatie

Architectuur-diagram, payload-shape, foutcodes, VAPID-config,
iOS-quirks, demo-users blokkade, trigger-voorbeelden (server +
HTTP) en admin-testroute curl-voorbeeld.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-07 21:46:01 +02:00
..
adr docs(adr): ADR-0010 — één product = één repo, cross-product planning later via Initiative-laag 2026-05-03 14:44:14 +02:00
api ST-1239: Atomische database-migratie — todos naar ideas + droppen todos-tabel (#132) 2026-05-06 12:25:37 +02:00
architecture docs: fix broken cross-repo links in sprint-execution-modes (PBI-51) (#141) 2026-05-07 13:44:44 +02:00
assets docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
backlog docs: M12 backlog entry + mcp-integration runbook for idea-jobs (M12 T-517) 2026-05-04 21:45:54 +02:00
decisions docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
design docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
diagrams Landing v3: van idee tot pull request + 6 nieuwe screenshots (#127) 2026-05-06 09:05:22 +02:00
docker-smoke Phase 1 — Junk cleanup + front-matter on every doc (#62) 2026-05-03 12:50:35 +02:00
manual PBI-58: Developer manual + in-app /manual page (#148) 2026-05-07 18:00:10 +02:00
patterns Sprint: pbi-55 (#156) 2026-05-07 21:46:01 +02:00
plans docs: archiveer sprint-pr-worktree state-machines advies (#140) 2026-05-07 13:32:30 +02:00
qa docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
runbooks chore(ci): gate auto-deploy behind AUTO_DEPLOY_ENABLED repo-variable (#154) 2026-05-07 20:17:15 +02:00
specs docs: idea-dialog profile (M12 T-513) 2026-05-04 21:41:00 +02:00
api.md ST-1239: Atomische database-migratie — todos naar ideas + droppen todos-tabel (#132) 2026-05-06 12:25:37 +02:00
architecture.md PBI-50: SPRINT_IMPLEMENTATION single-session sprint runner (Scrum4Me-side) (#139) 2026-05-07 13:05:02 +02:00
backlog.md docs(links): fix broken cross-references after restructure (#63) 2026-05-03 12:52:59 +02:00
erd.svg feat(PBI-59): Sprint.code (SP-N sequentieel per product) (#153) 2026-05-07 20:10:16 +02:00
functional.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
glossary.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
INDEX.md Sprint: pbi-55 (#156) 2026-05-07 21:46:01 +02:00
md3-color-scheme.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
obsidian-authoring.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
pbi-dialog.md Phase 1 — Junk cleanup + front-matter on every doc (#62) 2026-05-03 12:50:35 +02:00
personas.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
product-backlog.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
realtime-smoke.md Phase 1 — Junk cleanup + front-matter on every doc (#62) 2026-05-03 12:50:35 +02:00
story-dialog.md Phase 1 — Junk cleanup + front-matter on every doc (#62) 2026-05-03 12:50:35 +02:00
task-dialog.md Phase 1 — Junk cleanup + front-matter on every doc (#62) 2026-05-03 12:50:35 +02:00
test-plan.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00