1. Platform Overview

HostQ is a comprehensive, all-in-one property management SaaS designed specifically for the Kenyan short-stay and hospitality market. It streamlines operations for property owners, co-hosts, agents, and cleaning staff.

Core Capabilities:

2. System Architecture

The platform uses a lightweight, highly optimized "Headless PHP + Vanilla JS" stack. This ensures blazing-fast load times on mobile devices, even on slower Kenyan 3G/4G networks.

# Tech Stack Frontend: HTML5, CSS3, Vanilla JavaScript (ES6+) Backend: PHP 8.x (PDO for Database) Database: MySQL Libraries: FontAwesome (Icons), SortableJS (Drag & Drop) # Directory Structure / (Root - Landing Page) ├── /admin/ # Super Admin Panel & APIs │ ├── /auth/ # Admin Login/Register │ ├── /db/ # config.php (PDO Connection) │ ├── /api/ # Backend JSON Endpoints │ └── /setup/ # Reference Data UI (Locations, Amenities, etc.) ├── /host/ # Host Dashboard ├── /agent/ # Agent Dashboard └── /staff/ # Cleaning/Maintenance Portal

3. User Roles (RBAC)

HostQ uses strict Role-Based Access Control. The system dynamically checks the user's role in the database and routes them to the appropriate dashboard.

Role System ID Access Scope Permissions
Super Admin super_admin Global Platform Manage all users, setup reference data, view all financials.
Host (Owner) host Own Properties Full CRUD on listings, bookings, expenses, and payouts.
Co-Host / Manager manager Assigned Properties Manage bookings & guests. Blocked from financial payouts.
Agent agent Own Bookings Create bookings, view own commissions. Blocked from expenses.
Cleaner / Staff cleaner Assigned Tasks View and complete housekeeping tasks. No financial/guest access.

4. API Engine

Instead of writing dozens of repetitive PHP files, HostQ uses a centralized dynamic API for reference data at /admin/api/setup/setup.php.

Dynamic CRUD Engine

The API accepts a ?table= parameter. It dynamically builds the SQL query based on the JSON payload sent by the frontend.

HTTP Method Endpoint Example Action Performed
GET setup.php?table=amenities Fetches all amenities ordered by order_index.
POST setup.php?table=house_rules Validates for duplicates and inserts a new record.
PUT setup.php?table=checkin_times Updates a record (or handles drag-and-drop reordering).
DELETE setup.php?table=property_types&id=5 Deletes a specific record by ID.

Security Measures

5. Database Schema Overview

The platform relies on several core tables. Every reference table (except location hierarchy) shares the same structure:

-- Standard Reference Table Structure CREATE TABLE `example_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, `slug` varchar(100) DEFAULT NULL, `is_popular` tinyint(1) DEFAULT 0, `status` varchar(20) DEFAULT 'Active', `order_index` int(11) DEFAULT 0, PRIMARY KEY (`id`) );

Key Tables:

6. Brand Color Palette

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

Terracotta (Primary)
#C15C3C
Deep Charcoal
#1C1917
Warm Cream (Background)
#FBF8F4
Emerald (Success)
#059669
Crimson (Danger/Delete)
#DC2626
Gold (Warnings/Popular)
#D97706

7. Core UI Components

HostQ uses a strict set of re-usable UI components across the platform to ensure consistency.

Component Description / Behavior
Custom Modals All browser alert() and confirm() dialogs have been replaced with custom HTML/CSS modals. Errors fade in with a red/amber icon and a "Got it" button.
Drag & Drop Lists Utilizing SortableJS. The drag handle is usually the fa-grip-vertical icon. On drop, an AJAX request is sent to save the order_index of the list.
Status Pills Small badges used in tables to show state (Active = Green, Inactive = Red, Popular = Gold).
Icon Previews When typing a FontAwesome class into an input, a live preview renders instantly next to the field.