Multi-location clinical staff scheduling with a rules engine that guarantees valid rosters, a chat assistant that drafts schedules from plain-language requests, and WhatsApp shift cover.
- Built at
- RaftWorks
- Client
- Clinical Stack
- Role
- Full-stack developer
- Platform
- Web app · Staff mobile web
- Year
- 2026
Clinics lose hours every week building rotas in spreadsheets, chasing staff for cover over text, and manually checking that nobody is double-booked or over their hours.
The first version ran on Bubble.io and had hit its ceiling: the scheduling rules, messaging retries and per-practice data isolation needed a real database and real code, without taking the live product offline.
- Migrated the product from Bubble.io to Next.js and Supabase while it stayed live
- Designed the Postgres schema: around 30 tables, 49 SQL migrations, row-level security per practice
- Built the deterministic scheduling and validation engine
- Built the chat assistant's tool layer and the WhatsApp Cloud API integration
- Wired Stripe billing for two products from one codebase
Every assignment runs through a hard/soft rule engine: hard rules (credentials, double-booking, maximum hours) block, soft rules (preferences, fairness) warn. Coverage gaps surface directly on the weekly and monthly planning views, so the admin sees the problem before staff do.
The assistant uses roughly 40 typed tools that read and write real schedule data in a multi-round tool-use loop. The core design decision: the model handles conversation and intent, while the same deterministic engine does the schedule building and validation; the model never publishes a schedule directly.
Destructive actions (deleting staff, bulk deletes) require an explicit confirmation step, and every tool call runs inside the caller's organisation, with row-level security blocking any cross-practice access.
Built directly on the WhatsApp Business Cloud API. When a shift needs cover, the system ranks eligible replacements and sends an interactive message with three reply buttons; a tap applies to the schedule immediately. If nobody answers, a scheduled job escalates: notified → reminded → call offered → admin alerted.
Every inbound webhook is HMAC-verified, and every Meta message ID is claimed in the database before any work happens, because Meta's own retries could otherwise replay a destructive action twice.
Staff directory, profiles with availability and credentials, departments and multiple locations, plus per-person reporting that drills down to individual shifts for payroll exports.
A chat-first Assistant serves solo providers and small practices (name-only staff, no logins; $25 or $50 a month). The full Scheduling Platform serves larger groups with staff logins, automated multi-channel coordination and payroll-ready hour exports ($99 or $199 a month, custom above 50 staff). Each practice is routed to the right experience at login, and Stripe bills both.
See it liveSee pricing (opens in a new tab)Start a 14-day trial (opens in a new tab)
The public site explains the two products, shows them working in short demo videos, lists pricing, and carries an about page, a contact route and a privacy policy written against the real stack. It works on any device.
See it liveclinicalstack.ai (opens in a new tab)About (opens in a new tab)Contact (opens in a new tab)Privacy policy (opens in a new tab)




- Frontend
- Next.jsReactTypeScript
- Backend & data
- SupabasePostgresRow-level securityScheduled jobs
- Integrations
- WhatsApp Cloud APIStripeAnthropic SDKSMSEmail
Live at clinicalstack.ai with both products on one codebase, migrated off Bubble without downtime.
- SQL migrations
- 49
- database tables
- ~30
- automatic escalation ladder
- 4-step
- external integrations
- 8
Scroll the grid · click any screen to open it larger · ← → to browse