Delivered remotely for a business based in Bristol, United Kingdom. Names withheld by agreement.
Project Overview
Multi-branch service businesses—ranging from specialist clinics to wellness studios and repair centers—depend on exact coordination between staff availability, physical rooms, and customer expectations. Out of Bristol, we built a multi-location appointment booking SaaS on Node.js, React, PostgreSQL, Redis, and Stripe that replaces fragile manual diaries with deterministic availability calculation and automated customer self-service.
Business Bottleneck
Operators expanding beyond a single branch struggled with overlapping appointments whenever receptionists updated shared spreadsheets at the same moment online customers submitted web forms. External practitioner calendars routinely drifted out of sync, deposits were chased manually over phone calls, and daylight saving shifts introduced off-by-one-hour errors for regional locations. Businesses needed an embeddable online booking flow and an operational dispatch calendar capable of enforcing room constraints, cancellation cutoffs, and multi-branch payouts cleanly.
Architectural Strategy
We placed temporal correctness directly inside PostgreSQL rather than relying exclusively on application-level mutexes that break across scaled Node.js processes. Using PostgreSQL's native tstzrange type and GiST EXCLUDE constraints guarantees at the storage engine level that neither two customers nor a receptionist and an online guest can claim overlapping time for the same practitioner or treatment room.
Node.js and TypeScript compute open slot grids dynamically from shift rules, service buffers, and synced external busy blocks, while Redis holds transient checkout reservations long enough for customers to complete Stripe authentication without blocking inventory indefinitely.
Core Capabilities
- Multi-Branch Service Catalogs: Per-location pricing, duration, buffer padding, and paired resource requirements such as specific rooms or equipment.
- Embeddable Customer Booking Widget: Lightweight React flow allowing clients to select branch, service, practitioner preference, and local-timezone slot without redirects.
- Deposit & Full-Pay Checkout: Configurable deposit rules, card-on-file holds for late-cancellation fees, and branch-scoped Stripe settlement.
- Two-Way Calendar Synchronization: Real-time busy-time imports and outbound booking updates for practitioner Google and Microsoft calendars.
- Automated Reminder & Waitlist Engine: Scheduled SMS and email reminders alongside automatic waitlist notifications when cancellations reopen prime slots.
- Front-Desk Dispatch Calendar: Drag-to-reschedule multi-column staff timeline supporting walk-ins, recurring appointments, and instant status tracking.
Technical Architecture
Flow: Customer / Receptionist (React SPA) -> Node.js TypeScript API -> PostgreSQL (GiST Exclusion Constraints) & Redis (Checkout Hold TTL) / BullMQ -> Stripe & External Calendars
When a customer opens the booking widget, React queries the Node.js availability endpoint with location, service ID, and date window. The service loads staff shifts, active bookings, and external calendar blocks in UTC, applies prep and teardown buffers, and caches computed slot arrays briefly in Redis for fast pagination.
Once a slot is chosen, the API opens a PostgreSQL transaction to insert a pending_hold reservation row. Because tstzrange exclusion constraints cover both confirmed and active pending_hold rows, competing requests fail cleanly with a 409 Conflict prompt to pick another time. Simultaneously, Node.js initializes a Stripe PaymentIntent and schedules a BullMQ expiry job. When the Stripe webhook confirms payment, the row flips to confirmed and triggers outbound calendar sync and confirmation alerts; if checkout stalls past the hold TTL, the cleanup worker expires the hold and frees the range.
Technology Stack
| Category | Technology detail |
|---|---|
| API & Domain Engine | Node.js and TypeScript modular services handling availability computation and booking state |
| Client & Admin UI | React SPA with embeddable booking widget and multi-branch calendar console |
| Scheduling Database | PostgreSQL leveraging tstzrange exclusion constraints for zero-overlap bookings |
| Checkout Hold Layer | Redis TTL slot locks preserving selected times briefly during payment entry |
| Job Orchestration | BullMQ queues managing SMS/email reminders, no-show workflows, and webhook retries |
| Payments & Deposits | Stripe PaymentIntents and Connect transfers supporting branch-level payouts |
| Calendar Bridges | Two-way sync adapters for Google Calendar and Outlook busy-block webhooks |
| Deployment Packaging | Docker containers running behind stateless reverse proxies with automated migrations |
Engineering Trade-offs & Solutions
| Challenge | Architectural Solution |
|---|---|
| Eliminating concurrent booking race conditions across API replicas | PostgreSQL tstzrange GiST EXCLUDE USING constraints covering staff and room resources atomically |
| Balancing checkout completion time against inventory lockup | Short-lived pending reservation rows paired with deterministic BullMQ expiration jobs to release abandoned holds |
| Handling complex shift exceptions and daylight saving changes | IANA timezone-anchored shift templates materialized into canonical UTC intervals at query and write time |
| Absorbing bursty availability lookups during email campaigns | Short-TTL Redis caching of computed day-slot grids invalidated immediately on booking writes |
| Recovering missed third-party calendar push notifications | Incremental delta-token polling fallback scheduled periodically alongside webhook listeners |
Security & Reliability
Payment workflows never store raw card data on application servers; Stripe Elements tokenizes payment methods client-side, and webhook handlers verify Stripe cryptographic signatures before mutating booking states. Multi-tenant franchise data is partitioned by organization and branch identifiers enforced across every API policy, ensuring branch staff can view only authorized practitioner rosters and customer records.
Reminder dispatches and calendar sync calls implement idempotency keys and exponential backoff inside BullMQ so transient provider outages never double-text customers or silently drop calendar invites. Outbound webhook notifications to merchant POS or accounting endpoints include HMAC-SHA256 signatures and replay timestamps, allowing downstream integrators to verify authenticity cleanly.
Performance & Scale
Splitting read-heavy slot discovery from strict transactional reservation writes keeps browsing fast under marketing spikes while reserving database lock contention strictly for final checkout commitments. Composite GiST indexes on (location_id, practitioner_id, booking_range) keep overlap checks fast even as multi-year booking histories accumulate, and archival partitioning moves completed historical appointments out of hot active range checks cleanly.
Because availability grids depend on deterministic shift rules and compact active-range queries, horizontal Node.js replicas share stateless Redis caches cleanly behind standard load balancers. Peak morning check-in traffic from front-desk consoles remains isolated from public widget bursts through separate rate-limit buckets and connection pool quotas.
Operational Outcomes
Multi-location operators eliminated manual diary reconciliation and stopped losing bookings to overlapping schedule collisions. Front-desk teams gained live visibility across every practitioner and room in one timeline, while automated reminders and deposit holds brought predictable attendance and cleaner daily settlement across branches. Customers book directly in their local timezone without phone back-and-forth, freeing reception staff to focus on in-person service quality.