Back to projects
Feb 2024 • 3 min read

Real-Time Appointment Booking System

Real-Time Appointment Booking System
Concurrency-safe scheduling platform with live slot availability, automated booking workflows, and multi-channel notifications.
Node.jsFastifyReactPostgreSQLRedisTwilio

A concurrency-safe reservation platform that completely eliminates double bookings during high-traffic registration windows using distributed mutex locking.

import Redlock from "redlock";
import { redisClient } from "./redis";

const redlock = new Redlock([redisClient], {
  retryCount: 5,
  retryDelay: 150,
});

export async function reserveTimeSlot(slotId: string, customerId: string) {
  const resourceKey = `locks:slot:${slotId}`;
  const lock = await redlock.acquire([resourceKey], 4000);

  try {
    return await executeSlotBookingTransaction(slotId, customerId);
  } finally {
    await lock.release();
  }
}

πŸš€ Quick Links

πŸ“œ Features & Highlights

  • βœ… Dynamic provider calendar management with custom buffer times and holidays
  • βœ… Atomic slot reservations powered by Redis distributed mutex locks
  • βœ… Instant calendar invitations (Google Calendar, Apple iCal, Outlook)
  • βœ… Automated WhatsApp, SMS, and Email confirmation and reminder triggers
  • βœ… Customizable intake forms with validation and file upload support
  • βœ… Comprehensive audit trail for appointment rescheduling and cancellations

πŸ“ˆ Lighthouse Score

100
Performance
100
Accessibility
100
Best Practices
100
SEO

πŸ’» Technology Stack

Layer Technologies
Backend Node.js (Fastify), TypeScript
Frontend React, TailwindCSS, FullCalendar
Database & Locks PostgreSQL, Redis (Redlock algorithm)
Notifications Twilio API, SendGrid, ICS generator
Deployment Docker, Azure App Services, GitHub Actions

πŸ›οΈ License

MIT License • Free and open source.