Push Notifications — Code Map
API
| File | Role |
|---|---|
apps/api/src/push-notifications/push-notifications.module.ts | Global; BullMQ queue notifications-push; controllers + processor |
apps/api/src/push-notifications/push-notifications.service.ts | Token lifecycle + send + schedule. Constants: PUSH_QUEUE_NAME = 'notifications-push' |
apps/api/src/push-notifications/push-notifications.processor.ts | BullMQ worker; uses expo-server-sdk; chunks; schedules receipt check |
apps/api/src/push-notifications/push-notifications.controller.ts | POST /devices/register, DELETE /devices/:token |
apps/api/src/push-notifications/notification-prefs.controller.ts | GET/PATCH /users/me/notification-preferences |
apps/api/src/push-notifications/dto/register-device.dto.ts | { expoPushToken, platform: 'ios' | 'android' } |
DB
| File | Role |
|---|---|
libs/db/src/lib/schema/device-tokens.ts | device_tokens table |
libs/db/src/lib/schema/notification-prefs.ts | notification_prefs (JSONB) |
Shared
| File | Role |
|---|---|
libs/shared/src/lib/schemas/notification-prefs.ts | NOTIFICATION_CHANNELS, NOTIFICATION_CATEGORIES, NotificationPrefsValue, isChannelOptedOut, isChannelEnabled |
Mobile / web
- Mobile app calls register on boot + revoke on sign-out. Source lives in the mobile repo (not in this monorepo).
- Web has no push surface (PWA shell only via
apps/web/src/components/pwa/).
Config
| Env | Purpose |
|---|---|
EXPO_ACCESS_TOKEN | Optional but recommended for FCM v1 backend; passed to new Expo({ accessToken }) |
| Redis / BullMQ creds | Inherited from app-wide queue config |