Relai

A WhatsApp appointment assistant for medical clinics — patients book, reschedule and cancel over chat, with AI replies, automatic reminders and an admin dashboard.

Bun
Hono
Baileys
Drizzle
SQLite
React
Relai

The idea

Clinics lose appointments to phone tag. Relai moves booking to the channel patients already use: patients book, reschedule and cancel over WhatsApp, and the clinic gets an admin panel over the top of it.

What's in it

  • WhatsApp integration via Baileys multi-device — scan a QR to connect
  • AI replies — OpenAI, Anthropic, or any OpenAI-compatible endpoint
  • Three reply modes — auto (AI replies immediately), semiauto (AI drafts, a human approves), and manual (reply from the admin panel)
  • Admin dashboard — a React SPA covering status, setup, settings, a unified message view, and password management
  • Automatic reminders ahead of appointments
  • Rate limiting on all routes

On handling clinic data

Two choices drove the design. First, the reply mode is per-conversation rather than global — a clinic can let the assistant handle routine booking while a human keeps the thread on anything sensitive, without switching the whole system into manual.

Second, credentials never sit in plaintext: API keys and configuration are encrypted at rest in SQLite, so a copy of the database file isn't a copy of the clinic's provider accounts.

Stack

Bun and Hono on the server, Baileys for the WhatsApp transport, Drizzle over SQLite for storage, Valibot for validation, jose for JWT auth and pino for logging. The admin client is a React SPA built with Vite.

Screenshots

Admin dashboard — connection status, message count, reply mode and AI provider health.
Admin dashboard — connection status, message count, reply mode and AI provider health.
Unified chat view — send messages, approve pending AI replies, handle reactions and voice notes.
Unified chat view — send messages, approve pending AI replies, handle reactions and voice notes.
Three-step setup wizard: WhatsApp → AI → bot.
Three-step setup wizard: WhatsApp → AI → bot.