Back to projects
Live SaaS

Leja Book — Online Booking Platform

Multi-Tenant Service Scheduling & Payments SaaS

PHPLaravelMySQLPayment GatewaySaaSREST APIRedis
Business Clients
50+active
Bookings Processed
10K+monthly
Payment Success
99.8%
Uptime
99.9%

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.

Request Flow
Customer Booking Request
Availability Engine
Row-Locked Conflict Resolution
Payment Gateway Authorization
Webhook Confirmation
Reminder Queue (Email/SMS)
Business Dashboard Update
  • 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

Problem

Handling race conditions when multiple customers try to book the same time slot simultaneously during high-traffic periods.

Solution

Implemented pessimistic row-locking during slot confirmation inside a database transaction, with automatic fallback suggestion of the nearest available slots when a lock fails.

Result

Zero double-booking incidents across 10K+ monthly bookings, with instant alternative-slot suggestions.

Payment Gateway Reconciliation

Problem

Different businesses required different payment providers, and failed or delayed webhooks risked leaving bookings in a paid-but-unconfirmed state.

Solution

Built a gateway abstraction layer with a unified webhook contract, idempotent event logging, and a reconciliation job that reverifies pending transactions on a schedule.

Result

Payment success rate sustained at 99.8% with zero orphaned paid bookings.

Cross-Timezone Availability

Problem

Businesses and customers frequently operate in different timezones, causing displayed slots to mismatch actual business hours.

Solution

Centralized all slot storage in UTC with a presentation-layer conversion service driven by business and customer timezone metadata.

Result

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

AvailabilityService — Lock-Safe Slot Reservation
1<?php
2
3namespace App\Services;
4
5use App\Models\TimeSlot;
6use Illuminate\Support\Carbon;
7use Illuminate\Support\Facades\DB;
8
9class AvailabilityService
10{
11 public function reserveSlot(int $businessId, Carbon $date, string $time): TimeSlot
12 {
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();
20
21 $slot->update([
22 'is_booked' => true,
23 'held_until' => now()->addMinutes(10),
24 ]);
25
26 return $slot;
27 });
28 }
29}