Infrastructure high complexity backend
0
Dependencies
3
Dependents
4
Entities
0
Integrations

Description

Backend-side infrastructure responsible for dispatching push notifications via the FCM server SDK triggered by database events (new assignments, approval outcomes, activity reminders) and scheduled jobs. Manages FCM server credentials, device token registration endpoints, notification payload construction, accessibility-compliant content formatting, and delivery error handling including token invalidation cleanup.

Feature: Push Notifications

notification-infrastructure

Responsibilities

  • Send push notifications via FCM server SDK from Next.js backend
  • Provide REST API endpoints for device token registration and deregistration
  • Construct accessible, screen-reader-compatible notification payloads
  • Handle FCM delivery errors and remove invalidated tokens
  • Trigger notifications from database events and scheduled jobs

Interfaces

sendPushNotification(userId, payload)
sendBulkNotifications(userIds, payload)
registerDeviceToken(userId, token, platform)
deregisterDeviceToken(userId, token)
buildNotificationPayload(type, data)
handleFcmDeliveryError(error, token)
scheduleNotification(userId, payload, scheduledAt)
cancelScheduledNotification(notificationId)