Habify BaseHabify Base
Spa & Local ServicesHabify Base · Developer Experience Team2026-11-267 min read

Building a Multi-Branch Spa, Salon & On-Demand Local Service Booking Backend

Power spas, studios, and on-demand home service teams: conflict-free staff scheduling, address autocomplete via Places Service, automated Zalo ZBS / SMS appointment reminders, and tracked promo links.

Multi-Staff SchedulingAddress & Map SearchZalo & SMS RemindersTracked Short Links
Multi-branch spa and home service booking architecture with address autocomplete and reminders

Appointment workflows extend far beyond clinics: spas, hair salons, photo studios, auto care shops, and on-demand home technicians can compose every needed capability natively on Habify Base. Alongside conflict-free PostgreSQL staff locks, built-in Places and Link services handle home address autocomplete and campaign link telemetry cleanly.

With branches, services, technicians, and bookings organized inside one isolated PostgreSQL database, multi-location brands manage every branch consistently without brittle third-party glue.

1. Multi-Branch & On-Demand Service Architecture

Combining isolated PostgreSQL tables with Places, Messaging, and Link services solves six daily operational workflows:

Service WorkflowHabify Base FeatureBusiness Outcome
Branch & technician slotsPostgreSQL partial unique index on (staff_id, slot_at)Prevents two customers from double-booking the same specialist
Home service address entryPlaces Service (/v1/places/autocomplete & geocode)Captures verified street addresses and map coordinates cleanly
Deposit / voucher checkoutDirect BYO QR Checkout straight to shop bankCuts last-minute no-shows without marketplace commissions
Booking phone verificationPasswordless OTP via official Zalo OA or SMSStops fake spam bookings before reserving staff hours
Automated reminders & NPSZalo ZBS triggers 2h before visit & post-serviceDrives repeat visits and structured customer feedback
Tracked SMS promo linksLink Service short URLs + device/click analyticsShortens SMS length and measures campaign ROI accurately

2. Branch, Staff & Collision-Free Slot Schema

A single partial unique index per specialist and start timestamp keeps schedules conflict-free across locations while RLS isolates personal customer histories:

sql
CREATE TABLE public.service_bookings (
  id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  branch_id uuid NOT NULL,
  staff_id uuid NOT NULL,
  customer_id uuid NOT NULL,
  service_name text NOT NULL,
  service_address text,
  slot_at timestamptz NOT NULL,
  status text NOT NULL DEFAULT 'confirmed' CHECK (status IN ('confirmed', 'cancelled', 'done'))
);

CREATE UNIQUE INDEX uniq_staff_active_booking
  ON public.service_bookings (staff_id, slot_at)
  WHERE status = 'confirmed';

ALTER TABLE public.service_bookings ENABLE ROW LEVEL SECURITY;
ALTER TABLE public.service_bookings FORCE ROW LEVEL SECURITY;
CREATE POLICY bookings_customer_or_branch ON public.service_bookings
  USING (
    customer_id::text = current_setting('app.current_user_id', true)
    OR current_setting('app.current_role', true) = 'branch_reception'
  )
  WITH CHECK (
    customer_id::text = current_setting('app.current_user_id', true)
    OR current_setting('app.current_role', true) = 'branch_reception'
  );

4. Collecting Booking Deposits and Measuring Campaign Links

For peak weekend slots, collect small QR deposits straight into your merchant account to reduce no-shows. Every short link tracks human clicks separately from messaging link-preview bots so marketing teams see true campaign performance.

Frequently Asked Questions

Does Places Service support Vietnam addresses cleanly?

Yes. Places Service includes Vietnam-tuned address autocomplete and geocoding accessible directly via browser publishable keys.

Can 5 separate salon branches share a single project database?

Yes. Include branch_id across your service and booking tables and scope receptionists to their assigned location inside your PostgreSQL RLS rules.

Are short links protected against messaging bot preview inflation?

Yes. Link Service filters out Zalo, Facebook, and Telegram link-preview crawlers automatically while supporting branded custom domains.

Related Documentation & Guides

Launch This Architecture in Free Sandbox in 3 Minutes

Spin up an isolated PostgreSQL 18 database, grab your hb_pk_* / hb_sk_* keys, and wire @habifybase/sdk.

More Engineering Articles & Use Cases