How luaim/car-rental-website works
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.