# luaim/car-rental-website architecture

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

- Interactive diagram: https://gitdiagram.com/luaim/car-rental-website
- Repository: https://github.com/luaim/car-rental-website

## Overview

##### Project Type and Purpose
- This is a full-stack LAMP-style website (“DOOS Car Rental”) that serves mostly static HTML/CSS pages and a dynamic “subscription_page” built in PHP.
- Purpose: let customers browse, filter, subscribe, and rent vehicles via a responsive UI with server-side data storage.

##### File Structure
Top-level directories:
- About_us_Page, Contact_Page, FAQ_page, Invest_Form_Page, Main_Page
– Each contains a static HTML file and a matching CSS file.
– These are purely front-end, delivered directly by the web server.
- subscription_page
– Contains plan.php, vechicles.php (server-side endpoints), accompanying JS/CSS, and CarRental.sql (DB schema).
– JS files (plan.js, vechicles.js, TAB.JS) handle AJAX calls and UI behavior (sliders, filtering).
- assets
– Holds images, fonts or other static resources used across pages.
- README.md / LICENSE

##### Extract Architectural Insights from the README
- Frontend: HTML + CSS (responsive design), JavaScript (1.7%) using jQuery UI for sliders.
- Backend: PHP (24.7%) handling form submissions, database queries.
- Database: MySQL (schema in CarRental.sql) stores vehicle listings, subscriptions, rental records.
- External: Font Awesome CDN, Google Fonts CDN.

##### Main Components
a. Client (Browser)
– Loads static HTML/CSS/JS from server.
– Executes JavaScript, including AJAX calls to PHP endpoints.
b. Web Server (Apache/Nginx + PHP)
– Serves static files for “Main_Page”, “About_us_Page”, etc.
– Executes plan.php, vechicles.php to query the database and return HTML or JSON.
c. Database (MySQL)
– Hosts vehicle inventory, user subscription & rental data.
– Initialized via CarRental.sql.
d. Static Assets Storage
e. External Services
– Font Awesome CDN
– Google Fonts CDN
– jQuery UI library (CDN)

##### Relationships and Interactions
- Static Page Request Flow:
Browser → HTTP GET → Web Server → Static HTML/CSS/JS → Browser
- Dynamic Request Flow (e.g., vehicle filtering):
Browser(JS) → AJAX GET/POST → plan.php or vechicles.php → PHP code → SQL query → MySQL → result → PHP → JSON/HTML → Browser
- Asset Retrieval:
Browser → HTTP GET → Web Server → assets directory → Browser
- External Library Fetch:
Browser → HTTPS → CDN (Font Awesome, Google Fonts, jQuery UI) → Browser

##### Architectural Patterns & Design Principles
- Monolithic LAMP stack (no microservices).
- Separation of concerns: static vs. dynamic pages.
- MVC-like separation at a basic level:
- Model: MySQL/Data schema
- Controller: PHP scripts handling requests
- View: HTML templates + CSS, plus JS rendering dynamic UI
- Responsive design principle for cross-device compatibility.

- Clear component labels: Browser, Web Server (Static & Dynamic), Database, Assets, External CDNs.
- A small note on “Deployment Environment” (e.g., XAMPP/WAMP) if relevant.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    Browser["Client (Browser)"]:::client

    %% Web Server grouping
    subgraph "Web Server" 
        direction TB
        SC["Static Content"]:::server
        DC["Dynamic Content"]:::server
    end

    %% Static Content Pages
    SC --> MainHTML["main.html"]:::server
    SC --> MainCSS["main.css"]:::server
    SC --> AboutHTML["about_us.html"]:::server
    SC --> AboutCSS["about_us.css"]:::server
    SC --> ContactHTML["contact.html"]:::server
    SC --> ContactCSS["contact.css"]:::server
    SC --> FAQHTML["faq.html"]:::server
    SC --> FAQCSS["faq.css"]:::server
    SC --> InvestHTML["invest_form.html"]:::server
    SC --> InvestCSS["invest_form.css"]:::server

    %% Dynamic Content Endpoints and Assets
    DC --> PlanPHP["plan.php"]:::server
    DC --> VehiclesPHP["vechicles.php"]:::server
    DC --> PlanCSS["plan.css"]:::server
    DC --> VehiclesCSS["vechicles.css"]:::server
    DC --> PlanJS["plan.js"]:::server
    DC --> VehiclesJS["vechicles.js"]:::server
    DC --> TABJS["TAB.JS"]:::server

    %% Assets and Documentation
    Assets["assets/"]:::assets
    Docs["README.md / LICENSE"]:::assets

    %% Database
    Database[(MySQL<br/>CarRental.sql)]:::database

    %% External Services
    subgraph "External Services"
        direction TB
        FA["Font Awesome CDN"]:::external
        GF["Google Fonts CDN"]:::external
        JQ["jQuery UI CDN"]:::external
    end

    %% Connections
    Browser -->|"GET static files"| SC
    Browser -->|"AJAX calls"| DC
    Browser -->|"GET assets"| Assets
    Browser -->|"HTTPS"| FA
    Browser -->|"HTTPS"| GF
    Browser -->|"HTTPS"| JQ
    DC -->|"SQL queries"| Database
    Database -->|"Results JSON/HTML"| DC

    %% Click Events
    click MainHTML "https://github.com/luaim/car-rental-website/blob/main/Main_Page/main.Html"
    click MainCSS "https://github.com/luaim/car-rental-website/blob/main/Main_Page/main.css"
    click AboutHTML "https://github.com/luaim/car-rental-website/blob/main/About_us_Page/about_us.html"
    click AboutCSS "https://github.com/luaim/car-rental-website/blob/main/About_us_Page/about_us.css"
    click ContactHTML "https://github.com/luaim/car-rental-website/blob/main/Contact_Page/contact.html"
    click ContactCSS "https://github.com/luaim/car-rental-website/blob/main/Contact_Page/contact.CSS"
    click FAQHTML "https://github.com/luaim/car-rental-website/blob/main/FAQ_page/faq.HTML"
    click FAQCSS "https://github.com/luaim/car-rental-website/blob/main/FAQ_page/faq.css"
    click InvestHTML "https://github.com/luaim/car-rental-website/blob/main/Invest_Form_Page/invest_form.HTML"
    click InvestCSS "https://github.com/luaim/car-rental-website/blob/main/Invest_Form_Page/invest_form.css"
    click PlanPHP "https://github.com/luaim/car-rental-website/blob/main/subscription_page/plan.php"
    click VehiclesPHP "https://github.com/luaim/car-rental-website/blob/main/subscription_page/vechicles.php"
    click PlanCSS "https://github.com/luaim/car-rental-website/blob/main/subscription_page/plan.css"
    click VehiclesCSS "https://github.com/luaim/car-rental-website/blob/main/subscription_page/vechicles.css"
    click PlanJS "https://github.com/luaim/car-rental-website/blob/main/subscription_page/plan.js"
    click VehiclesJS "https://github.com/luaim/car-rental-website/blob/main/subscription_page/vechicles.js"
    click TABJS "https://github.com/luaim/car-rental-website/blob/main/subscription_page/TAB.JS"
    click Assets "https://github.com/luaim/car-rental-website/tree/main/assets/"
    click Database "https://github.com/luaim/car-rental-website/blob/main/subscription_page/CarRental.sql"
    click Docs "https://github.com/luaim/car-rental-website/blob/main/README.md"
    click Docs "https://github.com/luaim/car-rental-website/tree/main/LICENSE"

    %% Styles
    classDef client fill:#aed6f1,stroke:#1f618d,color:#1b2631
    classDef server fill:#abebc6,stroke:#196f3d,color:#1b2631
    classDef database fill:#f5b041,stroke:#b9770e,color:#1b2631
    classDef assets fill:#d5d8dc,stroke:#626567,color:#1b2631
    classDef external fill:#e5e7e9,stroke:#7b7d7d,color:#1b2631
```
