Skip to content
All work

Websail

AI-powered business automation

A multi-tenant platform for small businesses. An AI receptionist answers the phone, books appointments into Google Calendar and takes messages. Websail also sends appointment reminders and publishes the business’s website.

My role
Designed, built and deployed independently
Technology
TypeScript, React, NestJS, PostgreSQL, Redis, Kubernetes, AWS, OpenAI Realtime, SIP, Google Calendar, Stripe
  1. CallerAny phone
  2. SIP trunkConnects the call
  3. OpenAI RealtimeSpeech in, speech out
  4. DashboardReact
  5. Websail APINestJS
  6. Google CalendarLive availability
  7. PostgreSQLRow-level security
  8. RemindersQueued in Redis
  9. Site builderStatic pages
  10. S3 and CloudFrontPublished site
  • Call audio
  • Control and API requests
  • Appointments
  • Website publishing
Call audio never passes through the Websail API. A separate control connection lets the API run tools while the caller talks to the model.

The problem

Small businesses often can’t answer the phone because they’re busy with the customer in front of them. Voicemail records the missed call, but it can’t check a diary, offer a time or book an appointment.

The rest of the customer journey is usually spread across separate tools for the calendar, reminders and website. Someone has to keep them all in step.

The solution

Websail gives each business an AI receptionist on its own phone number. It speaks the languages the business chooses, answers questions from the business’s own information, and can book, move or cancel appointments before the caller hangs up.

Appointments go into the staff member’s Google Calendar, with automated reminders. A business can approve each booking first or let Websail confirm bookings automatically. The same account covers website editing and publishing, with AI assistance.

Technical challenges

Acting during a live call

When a call arrives, the API verifies the webhook, works out which business was dialled, checks its usage allowance and starts a session set up for that business. It then opens its own WebSocket to the call to run tools, so credentials and booking rules stay on the server.

Finding the right business

Some SIP providers replace the dialled number in the usual header. Websail checks the other headers in priority order, normalises any phone numbers it finds and matches them to a business. If none match, it rejects the call.

Preventing double bookings

A slot can be taken between being offered and being accepted. Booking takes a PostgreSQL advisory lock for that staff member, then checks the calendar again before creating the event. If the database write fails, Websail removes the event. If that fails too, it records the event for later clean-up.

Keeping tenants apart

PostgreSQL row-level security enforces isolation below the application code. Each transaction carries the identity it’s running as, and a query without one is refused. Requests and background work use separate database roles, and the API won’t start if its database credentials could bypass the policies.

Deploying without dropping calls

A call can outlast a normal shutdown window. An API instance that’s shutting down accepts no new calls and waits for its active ones to finish before it exits.

Architecture

Websail is a TypeScript monorepo with a NestJS API, a React dashboard and shared packages for validation schemas, the database and site templates. Queue payloads are typed in one place, so the code adding a job and the worker running it share a definition.

The API and dashboard run in containers on Kubernetes. Customer websites are built as static pages, stored in S3 and served through CloudFront, so they don’t depend on the API to serve each page.

Stripe handles subscriptions. Receptionist time and AI editing are metered per business, and the API checks the allowance before accepting each call.

My contribution

I designed, built and deployed Websail independently. That covers the product itself, the data model, API, dashboard, voice integration, site publishing, billing and infrastructure.

Product screenshots

Websail site editor: the page list on the left, a live preview of a therapy website in the middle, and an AI chat on the right confirming a contrast change
Editing a website with the AI assistant
Websail appointments page with two appointments, one booked and one awaiting approval
Appointments, including one awaiting approval
Websail receptionist settings: English and Greek as languages, English as the default, plus voice and extra information
Receptionist language and voice settings