Leja Book — Online Booking Platform
Multi-Tenant Service Scheduling & Payments SaaS
Comprehensive service booking and appointment scheduling platform allowing businesses to manage time slots, client calendars, automated reminders, and online payments. Built as a multi-tenant SaaS where each business gets its own branded booking page with independently configurable availability rules.
Architecture & System Design
Built on Laravel with a service-oriented architecture. Each business operates as a tenant with customizable booking rules, availability slots, and payment configurations. The scheduling engine handles conflict resolution, buffer times, and timezone conversions at the database transaction level.
- Timezone-aware scheduling engine supporting 30+ timezone configurations
- Automated email/SMS reminders with configurable intervals before appointments
- Payment gateway abstraction layer supporting multiple providers per business
- Calendar sync with Google Calendar API for business owners
Engineering Challenges
Scheduling Conflict Resolution
Handling race conditions when multiple customers try to book the same time slot simultaneously during high-traffic periods.
Implemented pessimistic row-locking during slot confirmation inside a database transaction, with automatic fallback suggestion of the nearest available slots when a lock fails.
Zero double-booking incidents across 10K+ monthly bookings, with instant alternative-slot suggestions.
Payment Gateway Reconciliation
Different businesses required different payment providers, and failed or delayed webhooks risked leaving bookings in a paid-but-unconfirmed state.
Built a gateway abstraction layer with a unified webhook contract, idempotent event logging, and a reconciliation job that reverifies pending transactions on a schedule.
Payment success rate sustained at 99.8% with zero orphaned paid bookings.
Cross-Timezone Availability
Businesses and customers frequently operate in different timezones, causing displayed slots to mismatch actual business hours.
Centralized all slot storage in UTC with a presentation-layer conversion service driven by business and customer timezone metadata.
Eliminated timezone-related booking errors reported by support across 50+ active businesses.
Core Features
Smart Scheduling
Intelligent slot management with buffer times, recurring appointments, and group booking support.
Clean Code
1<?php23namespace App\Services;45use App\Models\TimeSlot;6use Illuminate\Support\Carbon;7use Illuminate\Support\Facades\DB;89class AvailabilityService10{11 public function reserveSlot(int $businessId, Carbon $date, string $time): TimeSlot12 {13 return DB::transaction(function () use ($businessId, $date, $time) {14 $slot = TimeSlot::where('business_id', $businessId)15 ->whereDate('date', $date)16 ->where('start_time', $time)17 ->where('is_booked', false)18 ->lockForUpdate()19 ->firstOrFail();2021 $slot->update([22 'is_booked' => true,23 'held_until' => now()->addMinutes(10),24 ]);2526 return $slot;27 });28 }29}