Skip to content

Notifications

Real-time notifications keep your team informed about bookings, payments, check-ins, and other important events as they happen.

Overview

The notification system delivers instant updates to users in your organization via Socket.IO WebSocket connections. When an event occurs (e.g., a new booking is created, a payment is received), all connected users in the organization receive a notification in real-time — no page refresh needed.

How It Works

Key Architecture Points

  • No polling — The frontend does not poll the server for new notifications. All updates arrive via Socket.IO events.
  • Organization-scoped rooms — Users join a Socket.IO room scoped to their organization (org:{orgId}). Events are broadcast to all users in that room.
  • Per-user read tracking — Each notification has a readBy[] array. The unread count is calculated per user, not globally.
  • Automatic query invalidation — Socket events automatically invalidate React Query caches, so lists and counts refresh instantly.

Notification Types

TypeTriggered When
booking_createdA new booking is created
booking_updatedA booking is modified
booking_checked_inA guest checks in
booking_checked_outA guest checks out
payment_receivedA payment is recorded
invoice_createdAn invoice is generated
guest_createdA new guest is registered
reminder_checkinUpcoming check-in reminder (via Apps Script)
reminder_checkoutUpcoming check-out reminder (via Apps Script)
overdue_paymentPayment overdue alert (via Apps Script)
systemSystem-level notifications

Frontend UI

Notification Bell

The notification bell icon in the top navigation bar shows:

  • Unread count badge — Red badge with the number of unread notifications
  • Click to open — Opens a popover with the latest notifications
  • Mark as read — Click a notification to mark it as read
  • Mark all as read — Button to clear all unread notifications
  • View all — Link to the full notifications page

Full Notifications Page

Navigate to Notifications from the sidebar to see the complete notifications interface with two tabs:

TabDescription
NotificationsPaginated list of all notifications with type badges, timestamps, and mark-as-read controls
SettingsConfigure which notification types you want to receive

Real-Time Updates

Notifications update instantly without page refresh:

  1. Socket.IO event arrives (notification:created, notification:read, etc.)
  2. React Query cache is automatically invalidated via the Socket Provider
  3. UI re-renders — bell badge count updates, notification list refreshes

Socket Events

EventDirectionDescription
notification:createdServer → ClientNew notification created
notification:readServer → ClientA notification was marked as read
notification:read_allServer → ClientAll notifications marked as read
notification:deletedServer → ClientA notification was deleted

These events are registered in EVENT_TO_QUERY_KEYS in the Socket Provider, which automatically invalidates the ["notifications"] query key when any notification event arrives.

Configuration

Notification Settings

Each user can configure their notification preferences per organization:

SettingDescription
Enable/Disable by typeToggle specific notification types on/off
Email notificationsFuture: receive email copies of notifications

Settings are managed via the Settings tab on the Notifications page.

Data Retention

  • Notifications are automatically cleaned up after 30 days via a scheduled cleanup endpoint
  • Audit logs (which may reference notifications) are retained for 365 days

Scheduled Notifications (Google Apps Script)

The system includes a Google Apps Script integration that runs on a schedule to generate proactive notifications:

TriggerFrequencyWhat It Does
Check-in remindersEvery 4 hoursAlerts for bookings arriving today/tomorrow
Check-out remindersEvery 4 hoursAlerts for bookings departing today
Overdue payment alertsDaily (9 AM)Flags invoices past their due date
Notification cleanupDaily (2 AM)Removes notifications older than 30 days

Setup

Google Apps Script triggers are configured separately. See the Integrations guide for setup instructions and Script Properties configuration.

Permissions

Notification access is controlled by the Notifications RBAC module:

PermissionAccess
ViewSee and read notifications
CreateTrigger notifications (typically system-only)
UpdateMark notifications as read
DeleteDelete notifications
ManageFull access including configuration

Released under the MIT License.