Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ResoVoice — AI Voice Reservation System for Restaurants

Bolna Full Stack Engineer Assignment Submission

A production-ready voice AI system that automates restaurant reservations through phone calls. Customers (or staff) trigger an outbound voice call, an AI agent collects booking details over the phone, and reservations are auto-synced to a live dashboard.


📋 Assignment Objectives Covered

# Objective Implementation
1 Enterprise Use Case Restaurant Reservation Automation — reduces no-shows, eliminates manual booking calls, captures structured data
2 Voice AI on Bolna Structured prompt + outbound call API + webhook for post-call data
3 Web App Next.js 14 + Supabase + Tailwind — fully functional booking dashboard
4 Full Flow User submits form → API triggers Bolna call → Agent talks to customer → Webhook updates Supabase → Dashboard reflects state in real-time
5 Deliverables GitHub repo + Vercel deploy + screen recording

🎯 The Problem

Restaurants lose 15–30% of reservations to no-shows and miss bookings during peak hours when staff can't answer phones. Manual booking is also error-prone — wrong dates, party sizes, dietary restrictions get lost.

The Workflow

Staff/Customer enters request → ResoVoice triggers Bolna voice call →
AI agent confirms booking details over the phone →
Bolna webhook posts structured data → Supabase stores reservation →
Dashboard shows live status (calling / confirmed / failed)

Outcome Metrics

  • No-show rate (target: drop from 25% to <10% via confirmation calls)
  • Booking capture rate (target: 95%+ even outside business hours)
  • Average time per reservation (target: <90 seconds vs ~4 min manual)
  • Cost per booking (target: <₹5 vs ~₹40 staff cost)

🏗️ Architecture

┌──────────────┐    ┌──────────────────┐    ┌──────────────┐
│  Next.js UI  │───▶│  /api/call       │───▶│  Bolna API   │
│  (Dashboard) │    │  (route handler) │    │  (Voice AI)  │
└──────────────┘    └──────────────────┘    └──────┬───────┘
       ▲                     │                      │
       │                     ▼                      ▼
       │            ┌──────────────────┐    ┌──────────────┐
       │            │  Supabase DB     │◀───│  /api/webhook│
       └────────────│  reservations    │    │ (Bolna calls)│
       Realtime     └──────────────────┘    └──────────────┘

🚀 Quick Start

1. Clone & install

git clone https://github.com/YOUR_USERNAME/resovoice.git
cd resovoice
npm install

2. Environment variables

Copy .env.example to .env.local and fill in:

NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...

BOLNA_API_KEY=...
BOLNA_AGENT_ID=...
BOLNA_FROM_NUMBER=+1...

WEBHOOK_SECRET=any-random-string

3. Supabase setup

Run the SQL in supabase/schema.sql in your Supabase project's SQL editor. This creates the reservations table with RLS policies and enables Realtime.

4. Bolna agent setup

  1. Go to https://platform.bolna.ai and create an agent
  2. Copy the agent prompt from docs/bolna-agent-prompt.md
  3. Set the webhook URL to: https://YOUR_DEPLOY_URL/api/webhook
  4. Copy the agent ID into .env.local

5. Run

npm run dev

Open http://localhost:3000


📁 Project Structure

resovoice/
├── src/
│   ├── app/
│   │   ├── layout.tsx              # Root layout + fonts
│   │   ├── page.tsx                # Landing / dashboard
│   │   ├── globals.css             # Design tokens
│   │   └── api/
│   │       ├── call/route.ts       # Triggers Bolna outbound call
│   │       └── webhook/route.ts    # Receives Bolna call events
│   ├── components/
│   │   ├── ReservationForm.tsx     # New booking form
│   │   ├── ReservationsList.tsx    # Live reservations table
│   │   ├── StatsCards.tsx          # KPI cards
│   │   └── StatusBadge.tsx         # Reservation status pill
│   ├── lib/
│   │   ├── supabase.ts             # Client-side Supabase
│   │   ├── supabase-admin.ts       # Server-side (service role)
│   │   └── bolna.ts                # Bolna API wrapper
│   └── types/
│       └── index.ts                # Shared types
├── supabase/
│   └── schema.sql                  # Database schema
├── docs/
│   ├── bolna-agent-prompt.md       # The prompt for the Bolna agent
│   └── demo-script.md              # Demo walkthrough
└── README.md

🎬 Demo Flow (for screen recording)

  1. Open dashboard — show empty state, KPI cards at zero
  2. Submit a booking — enter name, phone, party size, date/time
  3. Watch row appear — status: calling (live via Supabase Realtime)
  4. Phone rings — answer the call, talk to the AI agent
  5. End call — Bolna webhook fires
  6. Row updates — status changes to confirmed, transcript appears
  7. KPI cards update — total reservations / confirmation rate climbs

🔐 Security Notes

  • Service-role key is server-only (never exposed to client)
  • Webhook verifies a shared WEBHOOK_SECRET header
  • RLS enabled on reservations table
  • Form rate-limited at the API route (10 reqs/min/IP)

🛠️ Tech Stack

  • Next.js 14 (App Router, RSC, Server Actions)
  • Supabase (Postgres + Realtime + RLS)
  • Tailwind CSS + custom design tokens
  • Bolna API (voice agent orchestration)
  • TypeScript strict mode
  • Vercel for deployment

📞 Contact

Built as a submission for the Bolna Full Stack Engineer assignment.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages