Skip to main content

Documentation Index

Fetch the complete documentation index at: https://grantmaster.dev/llms.txt

Use this file to discover all available pages before exploring further.

Engineering reference: For service contracts, EventBus events, and data-layer details see src/features/notifications/notifications.md.

last_updated: 2026-03-14

Notifications System

Overview

GrantMaster uses a custom push notification system built on Firebase Cloud Messaging (FCM). This replaced the previous Novu integration. Notifications are delivered via push (browser/PWA), in-app toast, and email digest.

Architecture

ComponentPathPurpose
PushNotificationManagernotifications/components/PushNotificationManager.tsxFCM token registration, permission handling, browser detection
NotificationPreferencesPanelnotifications/components/NotificationPreferencesPanel.tsxPer-user preference UI with 14 categories across 6 groups
NotificationPermissionPromptnotifications/components/NotificationPermissionPrompt.tsxProgressive permission request component
NotificationHistorynotifications/components/NotificationHistory.tsxHistorical notifications list with read state
SystemNotificationComposernotifications/components/SystemNotificationComposer.tsxAdmin tool: compose and broadcast system-wide notifications
InlineActionsnotifications/components/InlineActions.tsxRenders actionable buttons inside notification cards
NotificationAnalyticsDashboardnotifications/components/pages/NotificationAnalyticsDashboard.tsxDelivery metrics, open rates, channel breakdown

Notification Categories (14)

Categories are defined in NotificationPreferencesPanel.tsx and organized into 6 groups:
GroupKeyLabelDescription
Time TrackingjournalRemindersJournal RemindersReminders to submit your journals
journalApprovalsJournal ApprovalsWhen your journals are approved
journalRejectionsJournal RejectionsWhen your journals are rejected
ExpensesexpenseApprovalsExpense ApprovalsWhen expenses are approved
expenseRejectionsExpense RejectionsWhen expenses are rejected
expenseFlagsExpense FlagsWhen expenses are flagged for audit
ProjectsprojectUpdatesProject UpdatesChanges to projects you work on
projectAssignmentsProject AssignmentsWhen you are assigned to a project
BudgetbudgetAlertsBudget AlertsCritical budget threshold warnings
budgetWarningsBudget WarningsBudget approaching limits
DeadlinesdeadlineRemindersDeadline RemindersUpcoming deadline notifications
deadlineOverdueOverdue DeadlinesWhen deadlines have passed
SystemsystemUpdatesSystem UpdatesPlatform updates and changes
securityAlertsSecurity AlertsSecurity-related notifications
Each category supports independent per-channel configuration (push and email).

Delivery Channels

ChannelMechanismWhen Used
PushFCM browser/PWAReal-time alerts requiring immediate attention
EmailPostmarkDigests, formal notifications, offline users
In-appToast + Notification HistoryNon-urgent status updates

User Preferences

Preferences are stored per user per organization via getNotificationPreferences(uid, orgId) and updateNotificationPreferences(uid, orgId, prefs) from @/features/users/services/userPreferences.

Frequency Options

  • Immediate — delivered as they occur
  • Daily digest — batched and sent at 8:00 AM
  • Weekly digest — batched and sent Monday at 8:00 AM

Quiet Hours

Users can configure a quiet period during which push notifications are suppressed:
  • Configurable start and end time
  • Enable/disable toggle
  • Does not affect email delivery

FCM Token Management

PushNotificationManager handles the full FCM lifecycle via PushNotificationService (@/shared/notifications/pushNotificationService):
MethodPurpose
isSupported()Check browser push notification support
getPermissionStatus()Current permission state (granted / denied / default)
getRegistrationToken(userId)Request permission and register FCM token
hasActiveToken(userId)Check if user has an active device token
refreshToken(userId)Refresh an existing FCM token
deleteRegistrationToken(userId)Remove token (disable push)
sendTestNotification()Send a test push to verify setup
Service worker at public/firebase-messaging-sw.js. FCM tokens are stored per device in employees/{uid}/devices/{deviceId} subcollection and refreshed on login.

Admin Features

  • SystemNotificationComposer — allows admins to compose and broadcast system-wide notifications to all users or specific roles
  • NotificationAnalyticsDashboard — provides delivery metrics, open rates, and channel breakdown analytics for monitoring notification effectiveness

Migration from Novu

The previous Novu integration (@novu/react, @novu/js) was fully removed and replaced by:
  • PushNotificationManager + FCM for push delivery
  • Postmark for email delivery
  • Custom NotificationPreferencesPanel for user preferences
  • Custom NotificationHistory for in-app notification list