Booklnk
All Projects
Full-Stack 2024 9 months 3 engineers

Booklnk

Multi-tenant appointment booking backend serving barbershops, gyms, and consultants — built from scratch on NestJS + PostgreSQL. I owned the architecture end-to-end.

Live Site
Scroll to read
Category
Full-Stack
Year
2024
Duration
9 months
Team
3 engineers
01 — Overview
01

Built the backend from scratch for a multi-tenant booking platform on NestJS and PostgreSQL — supporting barbershops, gyms, and consultants from a single codebase. Owned the schema design, service architecture, and the full API layer

02

Integrated Kashier (Egyptian payment gateway) end-to-end: webhook ingestion, idempotent transaction validation, and reconciliation logic. Shipping payments is always messier than the docs make it look

03

Slot validation and concurrent-booking prevention was the hardest part. Optimistic locking with a version field eliminates double-bookings without killing throughput

04

Modelled multi-business-type scheduling with different slot rules, service durations, and staff availability — abstracted behind a polymorphic booking engine so adding a new business type is config, not code

02 — The Problem
01

Booking platforms for Egyptian SMBs were either too generic with no local payment support, or industry-specific and impossible to adapt. Barbershops, gyms, and consultants all have fundamentally different scheduling rules but no shared infrastructure

02

Concurrent booking was a real reliability problem — two customers hitting the same slot at the same millisecond was causing lost revenue for pilot businesses

03

No Egyptian payment gateway integration existed in the open-source ecosystem, forcing businesses to handle cash or use fragmented workarounds

03 — The Solution
01

Designed a multi-tenant schema where each business type extends a shared booking core. Table inheritance in PostgreSQL keeps queries fast and adding a new business type costs zero migration risk

02

Implemented optimistic locking on the slot reservation table — each row carries a version counter. Concurrent requests compare-and-swap; the loser retries. Eliminated 100% of double-bookings under load testing

03

Built a Kashier webhook pipeline with idempotency keys — every incoming event is deduplicated before processing, so network retries never create phantom transactions. Reconciliation runs nightly and flags mismatches

04

Exposed a clean REST API with role-based guards (business owner vs customer vs staff) using NestJS guards + JWT. Dockerised the full stack for reproducible deploys

04 — Key Outcomes
01

Zero double-bookings since optimistic locking shipped across all pilot businesses||Kashier integration handles Egyptian card payments, Meeza, and Fawry with full webhook reliability||Multi-tenant architecture supports 3 business types from a single deployed instance||New environment spins up in under 2 minutes with Docker + CI||API documented end-to-end with Swagger — onboarded two frontend devs with no back-and-forth

05 — Gallery
Booklnk — screenshot 1
Expand
01 / 07
Booklnk — screenshot 2
Expand
02 / 07
Booklnk — screenshot 3
Expand
03 / 07
Booklnk — screenshot 4
Expand
04 / 07
Booklnk — screenshot 5
Expand
05 / 07
Booklnk — screenshot 6
Expand
06 / 07
Booklnk — screenshot 7
Expand
07 / 07