cjg/2026
Programming code on screen

Full Stack & AI Developer

Carlos
Gonzalez

← Back to case studies

Twilio | React | Cloudflare | PostgreSQL | SquareAPI | Webhooks

Multi-Tenant Restaurant Waitlist

Live: Sbeeqo →

The Challenge

Walk-in restaurants lose guests at the door. Paper lists, vague answers like "about 30 minutes", and calling names across a crowded lobby lead to walk-aways and frustrated hosts. Restaurant owners needed a waitlist that guests can join on their own, gives a realistic wait based on what is actually happening in the dining room, and tells guests when their table is ready.

The Solution

A multi-tenant SaaS where each restaurant gets its own waitlist, QR join page and a widget for its website. Guests can join from either one.

  • Host dashboard: live queue with Notify, Seat and Remove, a configurable hold timer, history, and real-time counts across restaurants.
  • Guest experience: a QR page and a status page showing their place in line and an estimated wait range.
  • Embeddable widget: one script tag shows the live party count, an inline join form and a "tables available now" banner on any website.
  • Opening hours: registration opens and closes on a schedule by day and time, including time ranges that run past midnight.

Wait-Time Engine (Square POS)

The estimate is calculated from the restaurant's Square point-of-sale data instead of guesses.

  • Open checks for today: are compared with the restaurant's table count. If a table is free for the next guest, the wait is zero.
  • Typical table time: is the median of the last 14 days of completed checks, clamped to 20–150 minutes (default 60).
  • Dine-in only: online, pickup, delivery and third-party orders (DoorDash, Uber Eats and others) are filtered out.
  • Guest-friendly output: estimates are rounded to 5-minute ranges based on which table should free up first for that guest's place in line.

Real-Time Updates

Square order.created and order.updated webhooks refresh the estimate as soon as a check opens or closes. Each restaurant has its own webhook address and signature key. Requests are verified with HMAC-SHA256 and the location is checked, so one tenant can never affect another.

Voice Notifications

When a table is ready, Twilio calls the guest and reads the restaurant name, the guest's name and an optional note from the host. Phone numbers are converted to E.164 format before dialing, and invalid numbers are rejected instead of being dialed.

Security & Multi-Tenancy

  • Per-restaurant Square credentials: are encrypted with AES-GCM in a server-only table, can't be read back after saving, and only the last 4 characters are shown.
  • Row-level security: on every table, plus a separate admin role table.
  • Trial model: one restaurant per account, a 30-day trial and a 20-guest limit enforced by a database trigger. Only the admin can raise the limit or extend the trial.

Results & Learnings

  • Wait estimates come from real POS activity instead of guesses by the host.
  • A webhook-driven cache keeps estimates fresh without polling Square constantly.
  • Unit tests cover the business rules (wait math, order filtering, schedules, credentials), so changes ship safely.
  • Built quickly with Lovable as an AI pair-programmer, with architecture and security decisions kept under my control.
TanStack StartReact 19TypeScriptTailwind CSSCloudflare WorkersPostgreSQL + RLSSquare APIWebhooksTwilio VoiceAES-GCMVitestLovable
Seated slide 1
Click to Enlarge
Seated slide 2
Click to Enlarge
Seated slide 3
Click to Enlarge