Arabic-first AI clinic flow system for Riyadh clinics. WhatsApp → AI → Booking → Reminders → CRM → Reports.
Turn WhatsApp conversations into booked appointments and actionable owner visibility — no leads lost in chat threads.
- Demo MVP: Working. Runs without credentials.
- Tests: 93 passing.
- Production: Deployed on Vercel. Production deploy blocked until
VERCEL_TOKENis refreshed. Live URL still responds at current deploy. - Mode: Demo mode by default. Production needs Supabase + Meta WhatsApp Business Account + AI provider key.
npm install
npm run devOpen http://localhost:3000/dashboard
No credentials needed. All features work with mock data.
- صندوق الواتساب — open نورة's conversation, click "استخدام الرد", send
- تأكيد الحجز — click green button, shows confirmed
- تحويل لموظف — switch to خالد's conversation, human handoff
- التذكيرات — queue shows 24h and 2h reminders
- العملاء — lead list from WhatsApp / Instagram / Google
- التقارير — charts, KPIs, bookings vs leads
- Refresh Vercel deploy token
- Verify live Supabase project + RLS
- Register Meta WhatsApp webhook end-to-end
- Wire real Arabic AI provider
- Run first clinic pilot
- n8n reminder sender with production auth
- Setup / onboarding polish
- Tenant / org isolation
- Consent capture + audit trail
- ZATCA invoice hardening
- Multi-branch support
- Role-based access
- Weekly owner reports
- Data retention automation
| Layer | Tech |
|---|---|
| Frontend | Next.js 15.5, React 19, App Router, Tailwind 4, shadcn/ui |
| Database | Supabase Postgres + RLS (adapter pattern) |
| Meta Cloud API (official, no scraping) | |
| AI | Deterministic (demo) → Openai / Gemini (prod) |
| Auth | NextAuth v5 beta, credentials provider |
| Automation | n8n workflows |
| CI/CD | GitHub Actions → Vercel |
Route files stay thin. Feature UI belongs in features/<domain>/. Generic primitives only in components/ui/.
| Command | Purpose |
|---|---|
npm install |
Install dependencies |
npm run dev |
Start dev server (port 3000) |
npm test |
Run 93 tests (Node test runner) |
npm run lint |
ESLint |
npm run build |
Production build (Next.js) |
npm run verify |
Full quality gate: test + lint + build + check-tokens + check-docs |
- AI never gives medical diagnosis or treatment advice — routes to human.
- Patient data kept private. No third-party sharing without consent.
- WhatsApp messages require customer opt-in.
- ZATCA e-invoicing: future phase.
| Doc | What it covers |
|---|---|
| Quick start (full) | Env vars, Supabase setup, WhatsApp config, AI provider, deploy |
| Architecture | Folder ownership, data flow, route thinness |
| Components | UI primitives contract, which component to use when |
| Design tokens | CSS custom properties (source of truth) |
| Contributing | PR workflow, branch rules, quality gate |
| Security | Security policy, reporting |
| Changelog | Release history |
| Agent rules | Rules for AI agents working on the repo |
See .env.example for the full list with explanations.