Back to Projects

FlazIT

Laravel 12PHP 8.4MySQLRedisOpenAIWhatsApp Business APIPusherStripe

Overview

FlazIT is a multi-tenant hospitality SaaS that lets short-stay and hotel operators manage properties, sync reservations from channel-manager/PMS sources, and automate guest communication end-to-end over WhatsApp. It combines a reservation pipeline, a tool-calling AI guest-assistant that replies on WhatsApp, a dense schedule of automated messaging (check-in instructions, document reminders, checkout feedback, 6-month re-engagement), and subscription billing — all isolated per tenant (vendor).

Objectives

  • ▸ Automate 24/7 guest communication over WhatsApp with minimal staff intervention for routine queries
  • ▸ Support provider-agnostic reservation sync via a pluggable channel-manager adapter framework
  • ▸ Keep AI and messaging cost-controlled through reply gating and template-cost optimization
  • ▸ Enforce strict multi-tenant isolation for every reservation, contact, property, and message
  • ▸ Monetize via metered and licensed subscription billing (Stripe, Razorpay)

Architecture

PHP 8.4 / Laravel 12 codebase organized into 16 self-contained Yantrana components following a layered pattern (Controllers → Engines → Repositories → Models). Inbound WhatsApp webhooks persist messages and dispatch events through a job pipeline; a Redis-backed batch + per-conversation lock feeds a two-tier AI gating flow. Three MCP servers (guest AI, booking assistant, admin) expose ~30 tools to LLM clients. Scheduled Artisan commands drive all guest-journey automation.

Key Features

  • ▸ Two-tier AI gating: a cheap ShouldReplyAgent classifier decides if a response is warranted before the full CustomerReplyAgent runs, saving LLM credits on low-effort messages
  • ▸ Provider-agnostic channel-manager framework behind ChannelManagerAdapterInterface + capability interfaces + neutral DTOs (WuBook default, pluggable providers, built-in demo provider)
  • ▸ WhatsApp cost optimization: inspects the 24h customer-care window and downgrades templated sends to free-form messages when allowed, directly reducing Meta template costs
  • ▸ Sentiment-gated review requests: a CheckoutExperienceAgent analyzes the in-stay conversation and suppresses review prompts for unhappy guests to protect the operator's rating
  • ▸ Scheduled guest-journey automation: check-in instructions, document reminders, approval notifications, checkout feedback, and 6-month re-engagement, timezone-scoped per vendor
  • ▸ Stripe metered + licensed billing via Cashier, with dynamic apartment-count usage reporting at invoice time, plus Razorpay and manual billing
  • ▸ Multi-tenant isolation via vendors__id foreign keys, global scopes, and VendorAccessCheckpost middleware; MCP admin auth uses timing-safe token comparison plus vendor-scoping headers

Challenges

  • ▸ Reliable high-volume async AI processing — solved with Redis-backed per-conversation locks, wamid dedup, and oldest-first message batching
  • ▸ Abstracting channel-manager providers without leaking provider assumptions into shared persistence — solved with capability interfaces and neutral DTOs so adding a provider is registration + adapter, not a refactor
  • ▸ Controlling cost across both LLM calls and WhatsApp template fees — solved with two-stage reply gating, 24h-window template downgrading, and sentiment-gated sends

Outcomes

  • ▸ Production-grade multi-tenant SaaS combining PMS sync, WhatsApp Business API, LLM tool-calling agents, and an MCP server surface in one Laravel codebase
  • ▸ Clean extensibility seam for channel managers — a registry/adapter/capability design that future-proofs the PMS integration layer
  • ▸ End-to-end automation of the hospitality guest journey from reservation sync through AI-powered support to post-stay review capture and re-engagement