Notifications & Alerts
Real-time in-app notifications grouped by category, bell badge, per-item read, and WhatsApp/email delivery channels.
Notification categories and types
Clinit groups all notifications into three categories:
CLINICAL
- Lab result ready (LabOrder.status = READY)
- Prescription issued or refill due
- Treatment plan milestone reached
- Vaccine due (pediatrics)
- Growth alert (Z-score crossing flag)
- High-risk patient alert (cardiology)
- Isotretinoin monthly monitoring due
BILLING
- Invoice overdue (past due date, unpaid)
- Instalment payment due (3-day advance warning)
- Payment received confirmation
- Overdue balance exceeds EGP 1,000
SYSTEM
- New self-booked appointment received
- Doctor invitation accepted
- WhatsApp connection status change
- Subscription renewal reminder
- Audit log security alert (multiple failed logins)
Each category is collapsible in the notification panel. The bell badge in the header shows the total unread count across all categories.
Real-time delivery and channels
Notifications are delivered through two mechanisms:
IN-APP (real-time):
Clinit uses Supabase Realtime WebSockets to push notifications to the open browser tab instantly. A 15-second polling fallback activates if the WebSocket connection drops.
When a new notification arrives:
- The bell badge count increments immediately.
- A brief toast appears at the bottom of the screen (3 seconds, dismissible).
- The notification panel refreshes its list.
WHATSAPP:
Critical notifications are also sent to the relevant staff member via WhatsApp:
- Lab result ready → doctor
- Instalment due → receptionist
- New self-booking → receptionist
EMAIL (via Resend):
- Invoice issued (to patient email if set)
- Doctor invitation
- Password reset
- Subscription renewal
Configuring channels:
Settings > Notifications > per-event toggles. Clinic Owners can enable or disable WhatsApp and email delivery per event type.