Notifications (web push now, Android FCM ready, iOS prepared): - device_tokens / notification_settings / conversation_mutes (migration 006) - REST: register/list/unregister devices, get/update settings (quiet hours, timezone, enable), mute/unmute conversation, VAPID public key - BullMQ queue: backend enqueues a job per new message; a dedicated stateless `notifications` worker service drains it - Delivery gating: skip sender, muted chats, disabled users, quiet hours, and ONLINE users (they get the message live + an in-app toast) — offline → push - Providers behind one interface: Web Push (VAPID/web-push) + FCM (firebase-admin, HTTP v1; Android + iOS via the same path). Dead tokens (404/410/unregistered) auto-retired; transient failures recorded - Web: service worker (push display + tap-to-open the originating chat), push registration/unregistration, in-app toast stack, deep-link via ?conversation= In-app voice & video messages: MediaRecorder capture in the composer (mic/video), live preview + timer, upload via the existing presigned-media path. No emojis anywhere: replaced all glyphs with inline SVG icons (shared/ui) so the UI renders identically across web/desktop/mobile; notification text is plain. Chores: dedupe ioredis (BullMQ) + pin uuid>=11.1.1 (audit clean) via pnpm overrides; reusable Centrifugo client factory for the worker. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFRyKxkKEjfAgpXygzoNiD
16 lines
686 B
Markdown
16 lines
686 B
Markdown
# Secrets (git-ignored)
|
|
|
|
Drop credential files here. This directory is mounted read-only into the
|
|
`notifications` worker at `/app/secrets`.
|
|
|
|
## Firebase Cloud Messaging (Android push, and iOS later)
|
|
|
|
1. Firebase Console → ⚙ Project settings → **Service accounts** →
|
|
**Generate new private key** → download the JSON.
|
|
2. Save it here as `fcm-service-account.json`.
|
|
3. In `.env`, set:
|
|
`FCM_SERVICE_ACCOUNT_FILE=/app/secrets/fcm-service-account.json`
|
|
4. Recreate the worker: `docker compose up -d --force-recreate notifications`
|
|
|
|
Until this is set, native (FCM) push is disabled and the worker logs
|
|
"fcm disabled (no service account configured)". Web Push works without it.
|