HQ
HostQ Documentation

Technical specifications, architecture, and design guidelines for the HostQ Platform.

1. Project Overview

HostQ is a premium, all-in-one property management SaaS built specifically for the Kenyan short-stay market. It empowers Hosts (property owners) and Agents (booking agents) to manage listings, bookings, guests, and M-Pesa payments from a single, unified dashboard.

The platform features a "God Mode" Super Admin panel that controls all global reference data, user subscriptions, and platform metrics.

Lightweight Stack

Built with Vanilla HTML/CSS/JS and PHP (PDO). No heavy frontend frameworks (React/Vue) to guarantee lightning-fast load times on mobile networks in Kenya.

2. Directory Architecture

Below is the file structure for the /host.prompter.co.ke/ root directory.

/host.prompter.co.ke/ │ ├── index.html # Main Public Landing Page │ ├── /admin/ # SUPER ADMIN CONTROL CENTER │ ├── /auth/ # Admin login & registration │ ├── /db/ # Database connection (config.php) │ ├── /api/ # Backend API endpoints │ │ ├── /auth/ # login.php, register.php │ │ ├── /setup/ # setup.php (Dynamic CRUD engine) │ │ └── /locations/ # locations.php (Hierarchy engine) │ ├── dashboard.html # Admin KPIs, Revenue & Analytics │ └── /setup/ # Admin Reference Data Management │ ├── /property-type/ # Apartment, Villa, etc. │ ├── /room-types/ # 1-Bedroom, Studio, etc. │ ├── /amenities/ # WiFi, Pool, etc. │ ├── /house-rules/ # No smoking, Pets, etc. │ ├── /cancellation-policies/ │ ├── /check-in-out/ # 10:00 AM, 2:00 PM, etc. │ └── /locations/ # Counties, Locations, Centres │ ├── /host/ # HOST DASHBOARD (Property Owners) ├── /agent/ # AGENT DASHBOARD (Sales/Commissions) └── /staff/ # STAFF PORTAL (Cleaners/Handymen)

3. User Roles & Permissions

HostQ uses Role-Based Access Control (RBAC). The system dynamically routes users to different dashboards upon login based on their database role.

Role Name System ID Dashboard Route Access Level
Super Admin super_admin /admin/dashboard.html God Mode (Global Control)
Host / Owner host /host/dashboard.html Full access to their properties
Co-Host / Manager manager /host/dashboard.html Day-to-day ops (No financials)
Booking Agent agent /agent/dashboard.html Own bookings & commissions only
Cleaner / Staff cleaner /staff/dashboard.html Assigned cleaning tasks only

4. The Dynamic API Engine

Instead of writing a new PHP file for every single table, the Super Admin setup pages use a highly optimized, dynamic PHP engine located at /admin/api/setup/setup.php.

How it works: It accepts a ?table= parameter to perform Create, Read, Update, and Delete (CRUD) operations safely.

Method Endpoint Example Action
GET /setup.php?table=amenities Fetch all amenities
POST /setup.php?table=house_rules Create a new rule
PUT /setup.php?table=checkin_times Update a time slot
DELETE /setup.php?table=property_types&id=5 Delete a property type
Security Features

The API uses PDO Prepared Statements, strict table whitelisting, and custom duplicate validation logic (Name + Type) to prevent SQL injection and data corruption.

5. Brand Color Palette

The HostQ UI avoids the generic "tech blue" and uses a warm, premium color scheme that conveys trust and hospitality.

Primary Colors

Terracotta
#C15C3C var(--admin-accent)
Buttons, Links, Active States
Cream
#FBF8F4 var(--bg-main)
App Background
Charcoal
#1C1917 var(--ink)
Headings, Sidebar, Topbar

UI Feedback Colors

Emerald Green
#059669 var(--green)
Success, Active Status
Crimson Red
#DC2626 var(--red)
Errors, Delete, Inactive
Warm Gold
#D97706 var(--gold)
Warnings, Popular Badges
Royal Blue
#2563EB var(--blue)
Info Alerts, Help Text

Structural Colors

Pure White
#FFFFFF var(--bg-panel)
Cards, Modals, Sidebar
Soft Sand
#E5E2DC var(--border)
Borders, Dividers, Inputs
Slate Gray
#6B7280 var(--ink-muted)
Secondary Text, Placeholders

6. Database Reference Tables

The setup pages manage the "Reference Data" that powers the entire platform. These tables are connected to the setup.php API and all support drag-and-drop reordering via the order_index column.

  • admin_users - Stores Super Admin credentials (hashed).
  • property_types - e.g., Apartment, Villa, Bungalow.
  • room_types - e.g., Studio, 1-Bedroom, 2-Bedroom.
  • amenities - e.g., WiFi, Kitchen, Pool (grouped by category).
  • house_rules - e.g., No smoking, Pets allowed.
  • cancellation_policies - e.g., Flexible, Strict (with specific refund rules).
  • checkin_times - e.g., 10:00 AM Check-in, 2:00 PM Check-out.
  • counties, locations, centres - Hierarchical location data for Kenya.