Appearance
Notifications ​
Purpose: Document realtime and polling notification patterns, timeline event management, and template system. Audience: Product, Developer Prerequisites: Authenticated user; Supabase Realtime enabled.
Global Realtime Hook ​
- Critical-only channel with tight filters per user.
- See
src/hooks/useGlobalRealtimeNotifications.ts:24-45—subscriptionsINSERT for user, UPDATE for user. - See
:65-76— new seller offers trigger email viaemailServiceafter fetching listing and seller profile. - See
:108-118— listing status changes toactivetrigger seller email viasend-emailfunction.
Admin Polling ​
- Non-critical admin notifications use periodic polling to reduce realtime load.
- See
src/hooks/useAdminPollingNotifications.ts:40-81— pending listings batch processing. - See
:86-99— new reports;:165-175— new active subscriptions.
Template Management System ​
Location: /admin/templates
Template Categories ​
- Email Templates - Authentication, business, and marketing emails
- In-App Notifications - Real-time notifications from database
- Edge Functions - Server-side email templates
- Database Templates - Email templates stored in database
- Timeline Events - Deal lifecycle event notifications
Key Features ​
- Inline Editing: All templates support inline editing below tables (no modals)
- Multilingual Support: EN/RO content with fallback indicators
- Role-Based Management: Timeline events support different messages per role
- Testing & Preview: Built-in preview and test functionality
- Consolidated Management: Single interface for all communication templates
Timeline Event Management ​
Event Types: offer_sent, offer_accepted, nda_signed, loi_signed, apa_signed_buyer, apa_signed_seller, assets_delivered, dd_started, dd_completed, dispute_opened, payout_released, deal_completed
Configuration:
- Role-Based: Separate messages for Buyer, Seller, Admin roles
- Channel Control: Toggle email and app notifications independently
- Message Customization: Multilingual content with variable substitution
- Centralized Storage: Configuration stored in
app_settings.timeline_notifications
Edge Functions:
dispatch-timeline-event- Generic dispatcher for deal timeline eventsseller-deliver-assets- Replaces old RPC for asset delivery
Tables ​
public.notifications,public.notification_settings— user notification storagepublic.admin_notification_types— in-app notification templatespublic.app_settings— timeline event configuration (JSON)- Admin signals come from
listings,reports,subscriptionsand email functions
UX ​
- Toasters for confirmation; emails for high-signal events (new offers, approvals)
- Inline editing with auto-focus and scroll-to-section
- Fallback indicators for multilingual content
- Real-time preview and test functionality
Next Steps ​
- See
docs/operations/monitoring.mdto observe notification health - See
docs/features/messaging.mdfor conversation notifications - See
docs/admin/guide.mdfor template management details