Water Pavilion Hotel — Booking Engine & Payment Reconciliation
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.
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.
3. Architecture & Technology Stack
| 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 |
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%.
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.