WhatsApp Booking Agent

Booking Agent
  • #Node.js
  • #Express
  • #TypeScript
  • #PostgreSQL
  • #Drizzle ORM
  • #React
  • #TanStack Router
  • #WhatsApp Cloud API

Role: Full Stack Developer, built end to end
Project Type: WhatsApp booking agent with automated worker management
Stack: Node.js, Express, TypeScript, PostgreSQL, Drizzle ORM, React, TanStack Router, Tailwind CSS, WhatsApp Cloud API, Docker


Project Overview

This is a booking agent that lives inside WhatsApp, built for a home services business. The business's customers already spend their day in WhatsApp, so that is where the agent meets them. There is no app to install and no account to create.

A customer sends a message and the agent takes it from there. It shows the services on offer, checks the area, finds a free slot, quotes the price and confirms the booking. Once a worker is assigned, the agent keeps the worker in the loop too, right inside their own WhatsApp.

I built the whole system: the agent, the booking page, the worker side, the admin dashboard and the public website.


How the Agent Works

The agent does not run on hard coded answers. It works from a knowledge base that the business manages itself from the dashboard:

  • The service catalogue, with prices, photos and details
  • The areas the business covers
  • Each worker's availability and working hours
  • Coupons, deals and price quotes
  • Business settings such as opening hours and time zone

Every reply the agent sends is built from this knowledge base in real time. When the team adds a service, changes a price or blocks out a worker's day, the agent picks it up on the very next message. The business shapes how the agent behaves without ever touching the code.


Key Features

Booking agent for customers

  • Guides each customer through booking with WhatsApp buttons and lists
  • Answers from the knowledge base: services, prices, areas and open slots
  • Opens a secure booking page from the chat when there are more choices to make, with no sign in
  • Applies coupons and deals and sends price quotes
  • Lets customers view and manage their existing bookings from the chat

Automated worker management

  • Sends each worker their new jobs in WhatsApp, with quick reply buttons
  • Lets workers mark a job as completed from the chat, with a confirm step
  • Collects worker documents through private links that expire
  • Tracks certification expiry dates and asks for a renewal before they lapse
  • Works out commissions, payouts and invoices for every completed job
  • Keeps a record of each worker's performance and activity

Admin dashboard

  • One place to manage the knowledge base the agent works from
  • Bookings with filters, notes, status history and counts
  • Worker profiles, availability, performance and documents
  • An analytics dashboard with the numbers that matter
  • Payouts, invoices and a full activity log

Public website

  • Marketing, privacy, terms and data deletion pages, as Meta requires before it approves a WhatsApp business

Tech Stack

Agent and backend

  • Node.js, Express and TypeScript: The agent, the API and the WhatsApp webhook
  • PostgreSQL and Drizzle ORM: The knowledge base, bookings and workers, with typed tables and versioned migrations
  • Better Auth: Admin sign in

Frontend

  • React and TanStack Router: The admin dashboard and the booking page
  • Tailwind CSS: Styling

Messaging

  • WhatsApp Cloud API: Webhooks, interactive messages and message templates

Ops and testing

  • Docker: Each app runs in its own container
  • Object storage: Private photos and documents, never on public links
  • Vitest: Unit tests, plus integration tests against a real database

How a Booking Flows

Customer messages the business
  → Agent reads the knowledge base and shows services and areas
  → Customer opens a secure booking page from the chat
  → Picks a date and time from slots that are really free
  → Confirms → booking saved → confirmation in WhatsApp
  → Worker is assigned → agent sends the job to the worker in WhatsApp
  → Worker marks it completed → commission and invoice worked out automatically

Key Technical Challenges

1. An agent that always knows where it is

WhatsApp messages arrive one at a time, and the agent has to remember where every customer is in the conversation. I gave each customer a saved session and built the conversation as a set of clear steps, each with its own handler: service, area, cart, date and time, and confirmation. Every message is routed by where that customer is right now, so the agent stays predictable and each step is easy to test and change on its own.

2. A knowledge base the team can change safely

The team changes prices, services and availability all the time, and the agent must never quote something that is out of date. Rather than copy that data into the conversation, the agent reads it fresh from the knowledge base whenever it replies. A change in the dashboard reaches customers on the very next message.

3. Moving big choices out of the chat

WhatsApp lists are short, and choosing between many services and time slots in a chat feels clumsy. So the agent sends a link to a booking page instead. The link carries a signed token tied to that customer, which means the page knows who is booking without asking anyone to log in.

4. One business time zone

The server, the team and the customers can all sit in different time zones, but a slot has to mean the business's local time. All the scheduling maths runs in the business time zone and is pinned down by tests, so slots always land on the right hour.

5. Keeping the dashboard in step with WhatsApp

A worker once marked a job completed in WhatsApp while an open dashboard tab still showed it as confirmed, so an admin changed it by hand. I traced it step by step. The backend was right; the dashboard simply never refreshed. Now lists refresh when you come back to the tab and on a short timer, so changes made in WhatsApp show up without a reload.

6. Passing Meta's review

Meta only approves a WhatsApp business that has a public website with the right policy pages, and its crawler does not run JavaScript. I built that site with React at build time only, so what ships is plain HTML and one stylesheet. Every page is real HTML that reviewers and crawlers can read straight away.


Key Learnings

  • Meet people where they already are
  • Let the business own the knowledge, and keep the agent reading it live
  • Treat a conversation as a clear set of steps
  • When a bug looks like a backend bug, first check what the screen actually loaded

Conclusion

This project put a whole booking business inside a chat app, from the first hello to the worker's payout. I owned every layer, from the webhook to the dashboard.

It showed me that the best interface is sometimes one people already use every day, as long as the agent behind it knows the business as well as the team does.

Back to Work

Contact me

Send me an email or message me on LinkedIn if you're looking for someone who builds without the fluff.

Open to work
Please wait...