Smileline

Build your own Smileline.

Join the community for people building their own practice software. Ask about any implementation detail and get help directly from Smileline's creator.

Join the WhatsApp community

Copies every section below as one prompt

4,806,941 lines of code in Smileline today · 1,838,652 of them tests

74,765,531 counting generated files: migrations, schema snapshots, compiled translations

Twelve things we'd tell you first.

Store first, answer fast
Save every webhook, form and import the moment it is authenticated, and answer in milliseconds. The work runs from a queue, and a healer every few minutes picks up anything stuck.
Never lose a payload
Keep the raw body before you parse it. Anything that can't be processed parks where a person can see it, with Retry and Discard. Nothing is dropped silently, not even malformed data.
Isolate every practice
Scope every query to its practice and check a permission in every handler. When in doubt, refuse.
No arbitrary limits on customer work
A lost lead costs a practice thousands. Timeouts and page sizes bound one wait or one batch, never the work; a batch carries on until everything is handled.
Make loops impossible
On Cloudflare, cost safety means finite, fenced retries and claiming a job before sending it, so nothing can multiply itself. Never cap real traffic to save money.
One repo, one catalog
A Bun workspace with every version in one catalog. Domain logic in a core package, shared Zod contracts in a schemas package, transport kept apart from storage.
Migrations only move forward
Generate each schema change, review it, and let CI apply it. Never edit a migration that has run anywhere.
Let CI do the heavy lifting
Tests, type checks and builds run on CI, and one run lists every failure, so you fix them all in one push. A test that passes on a re-run is a bug in the test.
Keep secrets encrypted
Encrypted vaults live in the repo; one private key, kept outside it, opens them. Never print or commit a decrypted value.
Countries are part of the feature
A country-specific feature, like NHS or US insurance, declares its countries, and every screen, menu and API route filters on them.
Build the least that works
Reuse what exists, prefer the platform and the standard library, and add a dependency only when a few lines can't do the job.
Make it yours
Give your clone its own name, logo and brand. Smileline is ours.

Four flows, end to end.

A WhatsApp message arrives
  1. 01 Signature checked
  2. 02 Raw body stored
  3. 03 Queued
  4. 04 200 sent back in milliseconds
  5. 05 Parsed and written in one transaction
  6. 06 Staff see it live
  7. 07 Anything that fails parks with Retry, and a healer tries again
The AI receptionist answers
  1. 01 The call reaches the phone carrier
  2. 02 Audio streams to a realtime voice model, or a speech-to-text, model and voice chain
  3. 03 The agent books, finds patients and transfers through the same API staff use
  4. 04 The transcript is stored
  5. 05 The after-call analysis is queued
The whole team sees it at once
  1. 01 One Durable Object per practice holds its staff's live connections
  2. 02 The API writes to Postgres, then tells the practice's room
  3. 03 Every open screen updates
EU and US data stay apart
  1. 01 Each region is its own cell: Workers, queues, storage and Postgres
  2. 02 The practice's country picks its cell at sign-up
  3. 03 A practice's data lives only in its cell

The models doing the work.

GPT-6 Luna OpenAI
The everyday model: inbox reply drafts and summaries, website chat answers, live call suggestions, booking drafts and a voice note's live draft.
GPT-6.2 and 6.1 Sol OpenAI
The careful model: the in-app assistant, after-call analysis, voice note drafts, x-ray and photo checks, lab work suggestions and articles.
GPT-6 Astra OpenAI
Social videos: reads the frames and writes the post.
GPT-Live OpenAI
The AI receptionist: speech to speech, with GPT-6 Luna doing the tool work.
gpt-image-2.6 and 2.5 Sunburst and Flare OpenAI
SmileDesign retouches and social images.
text-embedding-3-small OpenAI
Search across the practice's knowledge base and the Shop.
Scribe v3 and Scribe v3 Realtime ElevenLabs
Every speech-to-text path: voice notes, dictation, call and voicemail transcripts, and voice messages up to two hours.
Ink-2 and Sonic 3.6 Cartesia
The receptionist's other pipeline: ears and voice for English calls, with gpt-5.4-mini thinking in between.
Nova-3 Deepgram
Ears for Spanish and Italian calls on that pipeline.
Whisper large v3 turbo Cloudflare Workers AI
Voice messages longer than two hours.
Clef-flash Cloudflare Workers AI
Quick reads: does this message want a call, is a visit already arranged, which outcome does a chat show.
Wan 3.0 fal.ai
SmileDesign's smile videos.

Open models we adapted

DentalSegmentator (nnU-Net) Dot et al., converted by us
Jaws, teeth and nerve canals in a CBCT. We converted it to ONNX with fp16 weights so it runs on SmileGuide's own WebGPU network on the computer, and on Modal GPUs in the cloud.
TAPSeg Open research model, on Modal GPUs
Separates every tooth in a CBCT. Our own recipe numbers them 11 to 48 and checks the numbering with a second rule.
SAM 2.1 hiera tiny Meta, fp16 ONNX build
Outlines each upper tooth on a smile photo for SmileDesign, in the browser with WebGPU or WebAssembly. The photo never leaves the device.
Face Landmarker Google MediaPipe
Face landmarks for SmileDesign's smile analysis, in the browser.

Everyone we run on.

Hosting

Cloudflare: Workers, Durable Objects, Queues, R2, Hyperdrive, Workers AI, Browser Rendering, Containers and DNS for practice websites.

OVHcloud: Servers in the EU and US running PostgreSQL.

AI

OpenAI: GPT-6 Luna, Sol and Astra, GPT-Live, images and embeddings.

ElevenLabs: Scribe speech-to-text.

Cartesia: Speech-to-text and voices for the receptionist's other pipeline.

Deepgram: Spanish and Italian calls on that pipeline, and live call transcription through Telnyx.

fal.ai: SmileDesign videos.

Modal: GPUs for SmileGuide's CBCT segmentation.

Phone

Telnyx: Numbers, calls, SMS, recordings and live transcription.

LiveKit Cloud: Realtime media for the receptionist's other pipeline.

Messaging

Meta: WhatsApp Business Platform, Messenger and Instagram messaging.

Resend: Transactional email and practices' sending domains.

Payments

Stripe: Subscriptions, usage billing and Connect for patient deposits.

Data

Google Maps Platform: Maps and travel times.

DataForSEO: Search rankings for the SEO tools.

Pexels: Stock photos for articles.

Stedi: US dental insurance eligibility.

EasyPost: Shipping for Shop orders.

UK TPS: Do-not-call screening for UK calls.

Analytics

PostHog: Product analytics and masked session replay for staff, never patients.

Apps

Expo: Phone app builds, over-the-air updates and push.

App Store, Google Play, Microsoft Store, Chrome Web Store: Where the apps ship.

Building

GitHub: Code, CI and the public roadmap.

Renovate: Dependency updates.

dotenvx: Encrypted secret vaults.

Claude Code and OpenAI Codex: Claude writes, Codex reviews.

Sales

Google Calendar: Demo bookings.

The stack, package by package.

Bun
Workspace, scripts and tests.
TypeScript
Strict, everywhere.
Cloudflare Workers + Wrangler
The API, queues and realtime at the edge.
Hono
The API router.
Zod
Every contract, at every boundary.
Drizzle + postgres.js
Schema, migrations and queries on PostgreSQL.
Better Auth
Sign-in, sessions, OAuth and API keys.
React + React Router
The web app.
Tailwind CSS + Radix UI
Styling and accessible building blocks.
TanStack Table
Every list and report.
Tiptap
Rich-text editors: notes, emails, articles.
Paraglide
Translations.
Expo + React Native
The staff and patient phone apps.
Tauri
The desktop apps.
Astro
This website.
Fumadocs
The help centre.
Stripe
Billing, on the web and in the apps.
LiveKit Agents
The AI receptionist's voice pipeline.
Telnyx WebRTC
Calling from the browser and the phone app.
PostHog
Product analytics.
three.js
3D: charts, scans and this site's hero.
WXT
The Chrome extension.
Biome
Lint and format.
Playwright
Browser checks.
dotenvx
Encrypted secrets.
All 225 packages
Show the prompt
# Build my own Smileline

You're helping me build my own dental practice software, modelled on Smileline (https://smileline.io): a CRM for leads and patients, a practice system with diary and charting, an AI receptionist and messaging, and staff and patient apps. Below is how Smileline is built: tips, architecture, AI models, suppliers and software. Use it as a starting point, not a spec, and give my product its own name and brand.

Before anything else, ask me one multiple-choice question (use your question tool if you have one, otherwise a numbered list): "Choose your difficulty."
1. Easy: just use Smileline
2. Normal: build it with Claude
3. Hard: build it with Codex
4. Nightmare: build it by hand
Answer my pick with one line:
- Easy: "Wise. Start here: https://app.smileline.io/sign-up. I'll be here if you change your mind."
- Normal: "Good choice. Let's go."
- Hard: "Brave."
- Nightmare: "Respect. I'll put the kettle on."
Unless I picked Easy, carry on.

Questions about any implementation detail go to the Clone Smileline WhatsApp community, where Smileline's creator answers: https://chat.whatsapp.com/HxsoPdCQ1qr9BhOWmKwcPt

## Tips
- **Store first, answer fast.** Save every webhook, form and import the moment it is authenticated, and answer in milliseconds. The work runs from a queue, and a healer every few minutes picks up anything stuck.
- **Never lose a payload.** Keep the raw body before you parse it. Anything that can't be processed parks where a person can see it, with Retry and Discard. Nothing is dropped silently, not even malformed data.
- **Isolate every practice.** Scope every query to its practice and check a permission in every handler. When in doubt, refuse.
- **No arbitrary limits on customer work.** A lost lead costs a practice thousands. Timeouts and page sizes bound one wait or one batch, never the work; a batch carries on until everything is handled.
- **Make loops impossible.** On Cloudflare, cost safety means finite, fenced retries and claiming a job before sending it, so nothing can multiply itself. Never cap real traffic to save money.
- **One repo, one catalog.** A Bun workspace with every version in one catalog. Domain logic in a core package, shared Zod contracts in a schemas package, transport kept apart from storage.
- **Migrations only move forward.** Generate each schema change, review it, and let CI apply it. Never edit a migration that has run anywhere.
- **Let CI do the heavy lifting.** Tests, type checks and builds run on CI, and one run lists every failure, so you fix them all in one push. A test that passes on a re-run is a bug in the test.
- **Keep secrets encrypted.** Encrypted vaults live in the repo; one private key, kept outside it, opens them. Never print or commit a decrypted value.
- **Countries are part of the feature.** A country-specific feature, like NHS or US insurance, declares its countries, and every screen, menu and API route filters on them.
- **Build the least that works.** Reuse what exists, prefer the platform and the standard library, and add a dependency only when a few lines can't do the job.
- **Make it yours.** Give your clone its own name, logo and brand. Smileline is ours.

## Architecture examples
### A WhatsApp message arrives
1. Signature checked
2. Raw body stored
3. Queued
4. 200 sent back in milliseconds
5. Parsed and written in one transaction
6. Staff see it live
7. Anything that fails parks with Retry, and a healer tries again

### The AI receptionist answers
1. The call reaches the phone carrier
2. Audio streams to a realtime voice model, or a speech-to-text, model and voice chain
3. The agent books, finds patients and transfers through the same API staff use
4. The transcript is stored
5. The after-call analysis is queued

### The whole team sees it at once
1. One Durable Object per practice holds its staff's live connections
2. The API writes to Postgres, then tells the practice's room
3. Every open screen updates

### EU and US data stay apart
1. Each region is its own cell: Workers, queues, storage and Postgres
2. The practice's country picks its cell at sign-up
3. A practice's data lives only in its cell

## AI models
- **GPT-6 Luna** (OpenAI): The everyday model: inbox reply drafts and summaries, website chat answers, live call suggestions, booking drafts and a voice note's live draft.
- **GPT-6.2 and 6.1 Sol** (OpenAI): The careful model: the in-app assistant, after-call analysis, voice note drafts, x-ray and photo checks, lab work suggestions and articles.
- **GPT-6 Astra** (OpenAI): Social videos: reads the frames and writes the post.
- **GPT-Live** (OpenAI): The AI receptionist: speech to speech, with GPT-6 Luna doing the tool work.
- **gpt-image-2.6 and 2.5 Sunburst and Flare** (OpenAI): SmileDesign retouches and social images.
- **text-embedding-3-small** (OpenAI): Search across the practice's knowledge base and the Shop.
- **Scribe v3 and Scribe v3 Realtime** (ElevenLabs): Every speech-to-text path: voice notes, dictation, call and voicemail transcripts, and voice messages up to two hours.
- **Ink-2 and Sonic 3.6** (Cartesia): The receptionist's other pipeline: ears and voice for English calls, with gpt-5.4-mini thinking in between.
- **Nova-3** (Deepgram): Ears for Spanish and Italian calls on that pipeline.
- **Whisper large v3 turbo** (Cloudflare Workers AI): Voice messages longer than two hours.
- **Clef-flash** (Cloudflare Workers AI): Quick reads: does this message want a call, is a visit already arranged, which outcome does a chat show.
- **Wan 3.0** (fal.ai): SmileDesign's smile videos.

### Open models we adapted
- **DentalSegmentator (nnU-Net)** (Dot et al., converted by us): Jaws, teeth and nerve canals in a CBCT. We converted it to ONNX with fp16 weights so it runs on SmileGuide's own WebGPU network on the computer, and on Modal GPUs in the cloud.
- **TAPSeg** (Open research model, on Modal GPUs): Separates every tooth in a CBCT. Our own recipe numbers them 11 to 48 and checks the numbering with a second rule.
- **SAM 2.1 hiera tiny** (Meta, fp16 ONNX build): Outlines each upper tooth on a smile photo for SmileDesign, in the browser with WebGPU or WebAssembly. The photo never leaves the device.
- **Face Landmarker** (Google MediaPipe): Face landmarks for SmileDesign's smile analysis, in the browser.

Smileline today: 4,806,941 lines of hand-written code, 1,838,652 of them tests; 74,765,531 counting generated files.

## Suppliers
### Hosting
- **Cloudflare**: Workers, Durable Objects, Queues, R2, Hyperdrive, Workers AI, Browser Rendering, Containers and DNS for practice websites.
- **OVHcloud**: Servers in the EU and US running PostgreSQL.

### AI
- **OpenAI**: GPT-6 Luna, Sol and Astra, GPT-Live, images and embeddings.
- **ElevenLabs**: Scribe speech-to-text.
- **Cartesia**: Speech-to-text and voices for the receptionist's other pipeline.
- **Deepgram**: Spanish and Italian calls on that pipeline, and live call transcription through Telnyx.
- **fal.ai**: SmileDesign videos.
- **Modal**: GPUs for SmileGuide's CBCT segmentation.

### Phone
- **Telnyx**: Numbers, calls, SMS, recordings and live transcription.
- **LiveKit Cloud**: Realtime media for the receptionist's other pipeline.

### Messaging
- **Meta**: WhatsApp Business Platform, Messenger and Instagram messaging.
- **Resend**: Transactional email and practices' sending domains.

### Payments
- **Stripe**: Subscriptions, usage billing and Connect for patient deposits.

### Data
- **Google Maps Platform**: Maps and travel times.
- **DataForSEO**: Search rankings for the SEO tools.
- **Pexels**: Stock photos for articles.
- **Stedi**: US dental insurance eligibility.
- **EasyPost**: Shipping for Shop orders.
- **UK TPS**: Do-not-call screening for UK calls.

### Analytics
- **PostHog**: Product analytics and masked session replay for staff, never patients.

### Apps
- **Expo**: Phone app builds, over-the-air updates and push.
- **App Store, Google Play, Microsoft Store, Chrome Web Store**: Where the apps ship.

### Building
- **GitHub**: Code, CI and the public roadmap.
- **Renovate**: Dependency updates.
- **dotenvx**: Encrypted secret vaults.
- **Claude Code and OpenAI Codex**: Claude writes, Codex reviews.

### Sales
- **Google Calendar**: Demo bookings.

## Software
### Core stack
- **Bun**: Workspace, scripts and tests.
- **TypeScript**: Strict, everywhere.
- **Cloudflare Workers + Wrangler**: The API, queues and realtime at the edge.
- **Hono**: The API router.
- **Zod**: Every contract, at every boundary.
- **Drizzle + postgres.js**: Schema, migrations and queries on PostgreSQL.
- **Better Auth**: Sign-in, sessions, OAuth and API keys.
- **React + React Router**: The web app.
- **Tailwind CSS + Radix UI**: Styling and accessible building blocks.
- **TanStack Table**: Every list and report.
- **Tiptap**: Rich-text editors: notes, emails, articles.
- **Paraglide**: Translations.
- **Expo + React Native**: The staff and patient phone apps.
- **Tauri**: The desktop apps.
- **Astro**: This website.
- **Fumadocs**: The help centre.
- **Stripe**: Billing, on the web and in the apps.
- **LiveKit Agents**: The AI receptionist's voice pipeline.
- **Telnyx WebRTC**: Calling from the browser and the phone app.
- **PostHog**: Product analytics.
- **three.js**: 3D: charts, scans and this site's hero.
- **WXT**: The Chrome extension.
- **Biome**: Lint and format.
- **Playwright**: Browser checks.
- **dotenvx**: Encrypted secrets.

### Every package we use (225)
@astrojs/cloudflare, @astrojs/markdoc, @astrojs/react, @better-auth/api-key, @better-auth/oauth-provider, @better-auth/passkey, @biomejs/biome, @cloudflare/vite-plugin, @cloudflare/workers-types, @codemirror/lang-html, @config-plugins/react-native-callkeep, @config-plugins/react-native-webrtc, @dicebear/core, @dicebear/styles, @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities, @dotenvx/dotenvx, @dotenvx/dotenvx-armor, @expo-google-fonts/barlow-condensed, @expo-google-fonts/geist, @expo-google-fonts/geist-mono, @expo/ui, @expo/vector-icons, @fontsource-variable/dm-sans, @fontsource-variable/fraunces, @fontsource-variable/geist, @fontsource-variable/geist-mono, @fontsource-variable/inter, @fontsource-variable/manrope, @fontsource/dm-serif-display, @gltf-transform/core, @gltf-transform/extensions, @gltf-transform/functions, @googlemaps/js-api-loader, @happy-dom/global-registrator, @hono/zod-validator, @hugeicons/core-free-icons, @hugeicons/react, @hugeicons/react-native, @inlang/paraglide-js, @kenjiuno/msgreader, @kingstinct/react-native-healthkit, @livekit/agents, @livekit/agents-plugin-cartesia, @livekit/agents-plugin-deepgram, @livekit/agents-plugin-openai, @livekit/agents-plugin-silero, @livekit/noise-cancellation-node, @livekit/rtc-node, @mediapipe/tasks-vision, @modelcontextprotocol/server, @noble/hashes, @posthog/core, @posthog/rollup-plugin, @puckeditor/core, @radix-ui/react-checkbox, @radix-ui/react-dialog, @radix-ui/react-dropdown-menu, @radix-ui/react-label, @radix-ui/react-popover, @radix-ui/react-scroll-area, @radix-ui/react-select, @radix-ui/react-separator, @radix-ui/react-slot, @radix-ui/react-switch, @radix-ui/react-tabs, @radix-ui/react-toggle-group, @radix-ui/react-tooltip, @react-email/body, @react-email/button, @react-email/container, @react-email/editor, @react-email/head, @react-email/hr, @react-email/html, @react-email/img, @react-email/preview, @react-email/render, @react-email/text, @react-native-async-storage/async-storage, @react-native-community/datetimepicker, @react-native-community/netinfo, @react-router/dev, @simplewebauthn/server, @siteed/audio-studio, @stripe/stripe-react-native, @tailwindcss/vite, @tanstack/react-table, @tauri-apps/api, @tauri-apps/cli, @telnyx/react-native-voice-sdk, @telnyx/webrtc, @tiptap/core, @tiptap/extension-image, @tiptap/extension-placeholder, @tiptap/extension-table, @tiptap/pm, @tiptap/react, @tiptap/starter-kit, @tiptap/suggestion, @types/bun, @types/google.maps, @types/mdx, @types/node, @types/pg, @types/react, @types/react-dom, @types/three, @uiw/react-codemirror, @wxt-dev/module-react, @xyflow/react, asn1js, astro, better-auth, clarity-decode, clarity-js, clarity-visualize, class-variance-authority, clsx, cmdk, diff, dotenv-cli, driver.js, drizzle-kit, drizzle-orm, esbuild, expo, expo-alternate-app-icons, expo-apple-authentication, expo-application, expo-asset, expo-auth-session, expo-background-task, expo-blur, expo-build-properties, expo-camera, expo-constants, expo-crypto, expo-device, expo-file-system, expo-font, expo-glass-effect, expo-haptics, expo-image-manipulator, expo-image-picker, expo-keep-awake, expo-linear-gradient, expo-linking, expo-location, expo-navigation-bar, expo-notifications, expo-router, expo-secure-store, expo-share-intent, expo-sharing, expo-splash-screen, expo-status-bar, expo-task-manager, expo-updates, expo-video, expo-web-browser, expo-widgets, fflate, fumadocs-core, fumadocs-mdx, fumadocs-openapi, fumadocs-ui, gsap, hono, isbot, jsonc-parser, jsqr, libarchive-wasm, libphonenumber-js, lucide-react, lucide-react-native, mediabunny, meshoptimizer, onnxruntime-web, pdfjs-dist, pg, pkijs, playwright-core, postal-mime, postgres, posthog-js, preact, react, react-dom, react-native, react-native-actions-sheet, react-native-callkeep, react-native-gesture-handler, react-native-gifted-charts, react-native-nitro-modules, react-native-quick-base64, react-native-quick-crypto, react-native-reanimated, react-native-safe-area-context, react-native-screens, react-native-svg, react-native-voip-push-notification, react-native-webrtc, react-native-webview, react-native-worklets, react-qr-code, react-router, recharts, sonner, stripe, tailwind-merge, tailwindcss, three, tldts, tw-animate-css, typescript, uniwind, unpdf, uqr, vite, wrangler, wxt, yaml, zod

Build it with us, not alone.

Ask anything about how Smileline is built, and get answers from the person who built it.

Join the WhatsApp community