# hifzur001/boobs architecture

> Architecture diagram of the GitHub repository hifzur001/boobs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hifzur001/boobs
- Repository: https://github.com/hifzur001/boobs

## Overview

##### Project Type and Purpose
- This is a full-stack travel booking web application (“StayScape Services”) with:
- A modern responsive frontend (HTML5/CSS3/JS + Bootstrap)
- A RESTful PHP backend (api/auth.php, api/services.php, api/bookings.php)
- A MySQL database (via config/database.php and PDO)
- Separate user roles and UIs (end users, brokers, admins)

##### File Structure
- Top-level HTML pages for each role and flow:
- index.html, booking.html, confirmation.html, my-bookings.html (end user)
- admin-login.html, admin-panel.html (admin)
- broker-login.html, broker-panel.html (broker)
- “api/” directory: three controllers (auth, services, bookings)
- “config/database.php”: database connection details
- “js/” and page-level *.js: frontend logic, API client (js/api-client.js)
- “style.css” and per-panel CSS files: styling
- “supabase/migrations”: database migration scripts (optional DevOps)
- Static assets: img/, font/, css/, js/

##### README for Additional Insights
- Technology stack: PHP7.4+, MySQL5.7+, PDO, REST
- Key architectural patterns:
- Layered architecture (Presentation → API layer → Data layer)
- Role-based access control
- Stateless REST endpoints with session tokens
- Database schema relationships (Users→Bookings, Brokers→Services, Cities→Services)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Zone
    subgraph "Client Zone"
        subgraph "End-User Interface" 
            EU_Pages["HTML Pages: index.html, booking.html, confirmation.html, my-bookings.html, destinations.html, services.html, about.html, contact.html"]:::frontend
            EU_JS["JS: booking.js, confirmation.js, my-bookings.js, destinations.js, services.js, script.js"]:::frontend
            EU_CSS["CSS: style.css"]:::frontend
        end
        subgraph "Broker Interface"
            BR_Pages["HTML Pages: broker-login.html, broker-panel.html"]:::frontend
            BR_JS["JS: broker-script.js"]:::frontend
            BR_CSS["CSS: broker-style.css"]:::frontend
        end
        subgraph "Admin Interface"
            AD_Pages["HTML Pages: admin-login.html, admin-login-updated.html, admin-panel.html"]:::frontend
            AD_JS["JS: admin-script.js"]:::frontend
            AD_CSS["CSS: admin-style.css"]:::frontend
        end
        subgraph "Static Assets"
            Fonts["Fonts"]:::static
            Images["Images"]:::static
            APIClient["Shared JS: api-client.js"]:::static
        end
    end

    %% Server Zone
    subgraph "Server Zone"
        StaticServer["Static Asset Server (Apache/Nginx)"]:::backend
        subgraph "PHP Application (API Layer)"
            AuthAPI["Auth API (api/auth.php)"]:::backend
            ServicesAPI["Services API (api/services.php)"]:::backend
            BookingsAPI["Bookings API (api/bookings.php)"]:::backend
            DBConfig["DB Config (config/database.php)"]:::backend
        end
    end

    %% Database Zone
    subgraph "Database Zone"
        MySQL["MySQL Database"]:::database
        Migrations["Migrations (supabase/migrations)"]:::database
    end

    %% Connections
    EU_Pages -->|HTTPS request| StaticServer
    BR_Pages -->|HTTPS request| StaticServer
    AD_Pages -->|HTTPS request| StaticServer
    APIClient -->|AJAX/Fetch| AuthAPI
    APIClient -->|AJAX/Fetch| ServicesAPI
    APIClient -->|AJAX/Fetch| BookingsAPI
    AuthAPI -->|PDO queries| MySQL
    ServicesAPI -->|PDO queries| MySQL
    BookingsAPI -->|PDO queries| MySQL
    DBConfig -->|connects| MySQL
    Migrations -->|schema| MySQL

    %% Click Events
    click EU_Pages "https://github.com/hifzur001/boobs/blob/master/index.html"
    click EU_JS "https://github.com/hifzur001/boobs/blob/master/js/booking.js"
    click EU_JS "https://github.com/hifzur001/boobs/blob/master/js/confirmation.js"
    click EU_JS "https://github.com/hifzur001/boobs/blob/master/js/my-bookings.js"
    click EU_JS "https://github.com/hifzur001/boobs/blob/master/js/destinations.js"
    click EU_JS "https://github.com/hifzur001/boobs/blob/master/js/services.js"
    click EU_JS "https://github.com/hifzur001/boobs/blob/master/js/script.js"
    click EU_CSS "https://github.com/hifzur001/boobs/blob/master/style.css"
    click BR_Pages "https://github.com/hifzur001/boobs/blob/master/broker-login.html"
    click BR_Pages "https://github.com/hifzur001/boobs/blob/master/broker-panel.html"
    click BR_JS "https://github.com/hifzur001/boobs/blob/master/broker-script.js"
    click BR_CSS "https://github.com/hifzur001/boobs/blob/master/broker-style.css"
    click AD_Pages "https://github.com/hifzur001/boobs/blob/master/admin-login.html"
    click AD_Pages "https://github.com/hifzur001/boobs/blob/master/admin-login-updated.html"
    click AD_Pages "https://github.com/hifzur001/boobs/blob/master/admin-panel.html"
    click AD_JS "https://github.com/hifzur001/boobs/blob/master/admin-script.js"
    click AD_CSS "https://github.com/hifzur001/boobs/blob/master/admin-style.css"
    click Fonts "https://github.com/hifzur001/boobs/blob/master/font/Astrid.otf"
    click Fonts "https://github.com/hifzur001/boobs/blob/master/font/brillant.otf"
    click Images "https://github.com/hifzur001/boobs/tree/master/img/"
    click APIClient "https://github.com/hifzur001/boobs/blob/master/js/api-client.js"
    click AuthAPI "https://github.com/hifzur001/boobs/blob/master/api/auth.php"
    click ServicesAPI "https://github.com/hifzur001/boobs/blob/master/api/services.php"
    click BookingsAPI "https://github.com/hifzur001/boobs/blob/master/api/bookings.php"
    click DBConfig "https://github.com/hifzur001/boobs/blob/master/config/database.php"
    click Migrations "https://github.com/hifzur001/boobs/blob/master/supabase/migrations/20250707193220_small_mode.sql"
    click Migrations "https://github.com/hifzur001/boobs/tree/master/supabase/migrations"

    %% Styles
    classDef frontend fill:#E8F0FE,stroke:#4285F4,stroke-width:1px
    classDef backend fill:#FFF4E5,stroke:#FB8C00,stroke-width:1px
    classDef database fill:#E8F5E9,stroke:#43A047,stroke-width:1px
    classDef static fill:#F3E5F5,stroke:#8E24AA,stroke-width:1px
```
