From f12bb51f3eafbeb314c090b0f6f90c6d452e779e Mon Sep 17 00:00:00 2001 From: linus Date: Thu, 10 Sep 2026 11:46:39 +0200 Subject: [PATCH] docs: push notifications module + FCM client wiring Co-Authored-By: Claude Sonnet 5 --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a81bbe0..e196818 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,13 @@ client's host - no separate web server is needed. `MailService.sendTeamerInvite()` composes the personal-invite email with a link built from `APP_BASE_URL`. Delivery is best-effort — failures are logged and swallowed, never blocking the invite. +- `push/` — global `PushProvider` abstraction; default `log`, `PUSH_PROVIDER=fcm` + uses FCM HTTP v1 (service-account JWT → OAuth token, no extra dep; + `FCM_PROJECT_ID`, `GOOGLE_APPLICATION_CREDENTIALS`). `DeviceToken` rows + (bound to a `User` or `GuestAccount`) via `POST /push/register` + + `/unregister`. `PushService.notifyChannel()` resolves a channel's readable + audience → their tokens (minus the sender) → send, pruning invalid ones; + `ChatService.sendMessage()` fires it best-effort. - `wahl/` — Wahl/Workshop administration (Leitungsteam-only), guest Teilnehmer submission, Force-Zuteilung overrides, and `ZuteilungService`: a faithful port of the WP plugin's `kc_run_zuteilung` (force-assignments → @@ -119,11 +126,11 @@ client's host - no separate web server is needed. - `common/` — `Role` enum, `@Roles()` decorator, `RolesGuard` (KC-scoped, Leitungsteam roles are global across all KCs). -All planned backend phases are implemented. `npm test` runs Jest unit tests -(`ZuteilungService`, `TeamAuthService`, `TeamerService`, `OnboardingService`, +All planned backend features are implemented (`prisma/migrations/` holds the +schema history). `npm test` runs Jest unit tests (`ZuteilungService`, +`TeamAuthService`, `TeamerService`, `OnboardingService`, `resolveOrProvisionAuthentikUser` / `toAuthenticatedUser`; Prisma mocked). -Remaining work: the Flutter clients (see repo root README), push -notifications, and the first real Prisma migration (only `schema.prisma` -exists so far). Ops notes: the Authentik provider must emit a `groups` claim -for the LT check, and `MAIL_PROVIDER=smtp` + `SMTP_*` must be set for invite -emails to actually leave the box. +Ops notes to go live: the Authentik provider must emit a `groups` claim for +the LT check; `MAIL_PROVIDER=smtp` + `SMTP_*` for invite emails; +`PUSH_PROVIDER=fcm` + a Firebase service-account JSON for push; and real +Nextcloud/S3 credentials for file storage.