S·G
OPEN TO REMOTE / HYBRID (MAX 2 DAYS ON-SITE)
Nairobi, KE — GMT+3
S·G
NO. 26.01

Water Pavilion Hotel — Booking Engine & Payment Reconciliation

ROLE Lead Backend & Infrastructure Engineer
CLIENT Water Pavilion Hotel, Kenya
YEAR 2026
PHP 8.1 MySQL NGINX Mpesa API Linux GitHub Actions
01 // THE CHALLENGE

1. The Problem

The hotel was experiencing frequent double-bookings and lost reservation requests because front-desk staff logged phone bookings across disconnected Google Spreadsheets. During peak holiday seasons, multiple guests were routinely assigned the same suite simultaneously. Payment reconciliation was purely manual: guests sent screenshot proofs of Mpesa transfers to front-desk phones, requiring staff to cross-reference bank SMS alerts against manual ledgers. This resulted in ~3 hours of daily reconciliation overhead and frequent customer disputes.

02 // SYSTEM IMPLEMENTATION

2. What I Built

I designed and deployed a custom PHP 8.1 MVC booking engine with a transactional reservation calendar. I implemented row-level database locking using `SELECT ... FOR UPDATE` on the room availability table, guaranteeing that once a user begins checkout on a room, concurrent attempts to lock that same date range fail gracefully with an availability notice. I integrated the Mpesa Daraja API with webhook callbacks for instant STK Push payment reconciliation, automatically confirming reservations and generating printable vouchers with encrypted QR verification tokens. I also configured NGINX reverse-proxy microcaching for public availability queries to insulate the backend during marketing traffic spikes, and established a GitHub Actions deployment workflow for reliable releases.

03 // ARCHITECTURE & STACK

3. Architecture & Technology Stack

SYSTEM ARCHITECTURE DIAGRAM // DATA FLOW View Full SVG ↗
Architecture diagram for Water Pavilion Hotel — Booking Engine & Payment Reconciliation
FIG. 2 — End-to-end component flow from client ingress to database & external webhook handlers.
PHP 8.1 MVC Custom object-oriented reservation engine and webhook handler
MySQL / MariaDB Availability calendar with row-level locking and transaction isolation
NGINX Reverse proxy with SSL termination and microcaching on availability queries
Mpesa API Webhook-based STK Push reconciliation (< 3s transaction confirmation)
Ubuntu 24.04 Hardened VPS with UFW firewall, fail2ban, and automated daily mysqldump backups
GitHub Actions CI/CD pipeline with .cpanel.yml deployment hooks
04 // PRODUCTION RESULTS

4. Results & Measurable Metrics

  • 1,200+ monthly reservations handled during peak holiday season with 0 double-booking occurrences.
  • Payment reconciliation time reduced from several hours to under 3 seconds per transaction via Daraja webhooks.
  • Recorded 99.8% uptime over 6 months on a single hardened Ubuntu VPS.
  • NGINX microcaching reduced server load on availability searches by ~60% during promotional campaigns.
  • Cut front-desk administrative reconciliation overhead by approximately 90%.
05 // ENGINEERING RETROSPECTIVE

5. What I'd Do Differently

If I were rebuilding this system today, I would implement Redis for ephemeral room reservation locks (e.g., a 10-minute hold lock during checkout) instead of relying solely on MySQL row locks, which would reduce transactional overhead on the primary database during mass promotional sales. I would also containerize the entire application using Docker Compose from day one to simplify local staging environments and make VPS migration even faster.