# ayon-biswas/carventurewebsite architecture

> Architecture diagram of the GitHub repository ayon-biswas/carventurewebsite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ayon-biswas/carventurewebsite
- Repository: https://github.com/ayon-biswas/carventurewebsite

## Overview

1. **Overall shape**
   - This is a classic **PHP/MySQL monolith** for a car-rental website.
   - The app is split into a **public customer-facing site**, an **admin panel**, and a set of **AJAX endpoints** that handle interactive operations without full page reloads.

2. **Public-facing pages**
   - The root-level PHP pages are the main user experience: `index.php`, `cars.php`, `car_details.php`, `facilities.php`, `about.php`, `contact.php`, `bookings.php`, `profile.php`, `pay_now.php`, `confirm_booking.php`, `email_confirm.php`, and `logout.php`.
   - These pages are mostly server-rendered and likely read from the database to show cars, facilities, user data, and booking state.

3. **Admin subsystem**
   - The `admin/` directory is a separate back-office area for site management.
   - It includes dashboard and CRUD screens for `cars`, `carousel`, `feature_facilities`, `settings`, `users`, `user_bookings`, and `user_queries`.
   - This indicates a split between **customer workflows** and **operational management**.

4. **AJAX layer**
   - The `ajax/` folder contains request handlers such as `cars.php`, `login_register.php`, `profile.php`, and `confirm_booking.php`.
   - The `admin/ajax/` folder contains admin-side handlers for CRUD operations.
   - This is the main boundary for dynamic behavior: forms and filters can update data asynchronously instead of reloading full pages.

5. **Shared infrastructure and layout**
   - Reusable PHP includes live in `inc/` and `admin/inc/`.
   - These likely centralize database connection, common utilities, headers/footers, scripts, and CSS/JS includes.
   - `admin/inc/db_config.php` is the clear database configuration entry point for the admin area, and the root `inc/` directory plays the same role for the public site.

6. **Data store**
   - The repository includes `carventurewebsite.sql`, which defines the database schema and seed data.
   - The architecture depends on **MySQL** as the source of truth for cars, users, bookings, settings, queries, and content like carousel items and facilities.

7. **Authentication and user state**
   - User-facing authentication is handled through AJAX and page flows such as `ajax/login_register.php`, `profile.php`, and `logout.php`.
   - The presence of booking and profile pages suggests session-based identity is used to tie bookings to a logged-in user.

8. **Booking and payment flow**
   - The booking path appears to start from car browsing, then moves into `confirm_booking.php`, `pay_now.php`, and booking history in `bookings.php`.
   - `ajax/confirm_booking.php` suggests booking submission is processed asynchronously, while `pay_now.php` is likely the final confirmation/payment step in the flow.

9. **Email notifications**
   - `PHPMailer/` exists at the repository root and also under `ajax/PHPMailer/`, which suggests email delivery is used from multiple request contexts.
   - `email_confirm.php` strongly implies booking or account-related confirmation emails are part of the architecture.

10. **Asset organization**
   - CSS is split into `css/` for the public site and `admin/css/` for the admin panel.
   - Images are organized by domain object: `cars`, `carousel`, `facilities`, `features`, `users`, and `about`, which matches the content model in the database.

11. **Client-side behavior**
   - The admin panel has dedicated JavaScript files in `admin/scripts/` for each managed entity, such as cars, users, settings, and facilities.
   - This suggests the admin UI is interactive and data-driven, with JS wiring forms and AJAX CRUD calls to the server.

12. **External dependencies and framework layer**
   - The stack is **PHP + MySQL + AJAX + Bootstrap**, so the architecture is server-rendered with lightweight client-side interactivity rather than a SPA.
   - Bootstrap primarily affects presentation, while PHPMailer affects outbound mail handling.

13. **Key architectural boundaries**
   - Public site vs admin panel is the main security and responsibility boundary.
   - AJAX handlers vs page controllers is the main execution boundary for dynamic updates.
   - Database access is centralized through config/include files, making MySQL the shared backend for all subsystems.

Main entry points: [`carventurewebsite.sql`](https://github.com/ayon-biswas/carventurewebsite/blob/main/carventurewebsite.sql) (MySQL schema), [`admin/dashboard.php`](https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/dashboard.php) (Dashboard), [`index.php`](https://github.com/ayon-biswas/carventurewebsite/blob/main/index.php) (Home), [`ajax/login_register.php`](https://github.com/ayon-biswas/carventurewebsite/blob/main/ajax/login_register.php) (AJAX API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_public_home["Home<br/>public page<br/>[index.php]"]
  node_public_catalog["Cars<br/>catalog page<br/>[cars.php]"]
  node_public_car_details["Car details<br/>detail page<br/>[car_details.php]"]
  node_public_booking_flow["Booking flow<br/>checkout pages"]
  node_public_account["Account<br/>user pages<br/>[profile.php]"]
  node_public_content["Content pages<br/>static pages<br/>[about.php]"]
  node_public_ajax["AJAX API<br/>async handlers<br/>[login_register.php]"]
end

subgraph group_admin["Admin area"]
  node_admin_dashboard["Dashboard<br/>admin page<br/>[dashboard.php]"]
  node_admin_cars["Cars admin<br/>crud page<br/>[cars.php]"]
  node_admin_content["Content admin<br/>crud pages<br/>[carousel.php]"]
  node_admin_ajax["Admin AJAX<br/>async handlers<br/>[cars.php]"]
end

subgraph group_shared["Shared code"]
  node_public_includes["Public includes<br/>shared includes<br/>[header.php]"]
  node_admin_includes["Admin includes<br/>shared includes<br/>[header.php]"]
  node_mailer["PHPMailer<br/>mail library<br/>[PHPMailer.php]"]
  node_styles["Stylesheets<br/>assets<br/>[common.css]"]
end

subgraph group_data["Data store"]
  node_database[("MySQL schema")]
end

node_public_home -->|"browse"| node_public_catalog
node_public_catalog -->|"view"| node_public_car_details
node_public_car_details -->|"book"| node_public_booking_flow
node_public_booking_flow -->|"account"| node_public_account
node_public_content -.->|"nav"| node_public_home
node_public_ajax -->|"read/write"| node_database
node_public_ajax -->|"send mail"| node_mailer
node_public_includes -.->|"layout"| node_public_home
node_public_includes -.->|"bootstrap"| node_public_ajax
node_admin_dashboard -.->|"manage"| node_admin_cars
node_admin_dashboard -.->|"manage"| node_admin_content
node_admin_ajax -->|"read/write"| node_database
node_admin_ajax -->|"notify"| node_mailer
node_admin_includes -.->|"layout"| node_admin_dashboard
node_admin_includes -.->|"bootstrap"| node_admin_ajax
node_styles -.->|"style"| node_public_home
node_styles -.->|"style"| node_admin_dashboard
node_database -->|"content"| node_public_catalog
node_database -->|"state"| node_public_booking_flow
node_database -->|"ops data"| node_admin_content

click node_public_home "https://github.com/ayon-biswas/carventurewebsite/blob/main/index.php"
click node_public_catalog "https://github.com/ayon-biswas/carventurewebsite/blob/main/cars.php"
click node_public_car_details "https://github.com/ayon-biswas/carventurewebsite/blob/main/car_details.php"
click node_public_booking_flow "https://github.com/ayon-biswas/carventurewebsite/blob/main/confirm_booking.php"
click node_public_account "https://github.com/ayon-biswas/carventurewebsite/blob/main/profile.php"
click node_public_content "https://github.com/ayon-biswas/carventurewebsite/blob/main/about.php"
click node_public_ajax "https://github.com/ayon-biswas/carventurewebsite/blob/main/ajax/login_register.php"
click node_admin_dashboard "https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/dashboard.php"
click node_admin_cars "https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/cars.php"
click node_admin_content "https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/carousel.php"
click node_admin_ajax "https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/ajax/cars.php"
click node_public_includes "https://github.com/ayon-biswas/carventurewebsite/blob/main/inc/header.php"
click node_admin_includes "https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/inc/header.php"
click node_mailer "https://github.com/ayon-biswas/carventurewebsite/blob/main/PHPMailer/PHPMailer.php"
click node_styles "https://github.com/ayon-biswas/carventurewebsite/blob/main/css/common.css"
click node_database "https://github.com/ayon-biswas/carventurewebsite/blob/main/carventurewebsite.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_home,node_public_catalog,node_public_car_details,node_public_booking_flow,node_public_account,node_public_content,node_public_ajax toneBlue
class node_admin_dashboard,node_admin_cars,node_admin_content,node_admin_ajax toneAmber
class node_public_includes,node_admin_includes,node_mailer,node_styles toneMint
class node_database toneRose
```

## Components

### Public site

Customer-facing pages and flows

- [Home](https://github.com/ayon-biswas/carventurewebsite/blob/main/index.php): public page · Landing and browsing entry point · `index.php`
- [Cars](https://github.com/ayon-biswas/carventurewebsite/blob/main/cars.php): catalog page · Vehicle listing and filtering · `cars.php`
- [Car details](https://github.com/ayon-biswas/carventurewebsite/blob/main/car_details.php): detail page · Single-car view and actions · `car_details.php`
- [Booking flow](https://github.com/ayon-biswas/carventurewebsite/blob/main/confirm_booking.php): checkout pages · Booking confirmation, payment, and booking history · `confirm_booking.php`
- [Account](https://github.com/ayon-biswas/carventurewebsite/blob/main/profile.php): user pages · Profile, email confirmation, and logout · `profile.php`
- [Content pages](https://github.com/ayon-biswas/carventurewebsite/blob/main/about.php): static pages · About, facilities, contact, and similar informational pages · `about.php`
- [AJAX API](https://github.com/ayon-biswas/carventurewebsite/blob/main/ajax/login_register.php): async handlers · Public-side login, car browsing, profile, and booking endpoints · `ajax/login_register.php`

### Admin area

Back-office management screens and handlers

- [Dashboard](https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/dashboard.php): admin page · Admin landing and navigation hub · `admin/dashboard.php`
- [Cars admin](https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/cars.php): crud page · Vehicle management UI · `admin/cars.php`
- [Content admin](https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/carousel.php): crud pages · Carousel, facilities, settings, users, bookings, and queries management · `admin/carousel.php`
- [Admin AJAX](https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/ajax/cars.php): async handlers · Admin-side CRUD endpoints · `admin/ajax/cars.php`

### Shared code

Reusable includes, assets, and mailer library

- [Public includes](https://github.com/ayon-biswas/carventurewebsite/blob/main/inc/header.php): shared includes · Shared header, footer, links, and utilities for the public site · `inc/header.php`
- [Admin includes](https://github.com/ayon-biswas/carventurewebsite/blob/main/admin/inc/header.php): shared includes · Shared admin layout, config, and utilities · `admin/inc/header.php`
- [PHPMailer](https://github.com/ayon-biswas/carventurewebsite/blob/main/PHPMailer/PHPMailer.php): mail library · Outbound email delivery used by page and AJAX flows · `PHPMailer/PHPMailer.php`
- [Stylesheets](https://github.com/ayon-biswas/carventurewebsite/blob/main/css/common.css): assets · Public and admin CSS assets · `css/common.css`

### Data store

Database schema and seed data

- [MySQL schema](https://github.com/ayon-biswas/carventurewebsite/blob/main/carventurewebsite.sql): sql schema · Database definitions and seed data · `carventurewebsite.sql`

## Connections

- Home → Cars: browse · Users move from landing to vehicle listings
- Cars → Car details: view · Listing pages lead into single-car details
- Car details → Booking flow: book · Car detail actions feed the booking path
- Booking flow → Account: account · Booking state and history connect to user profile
- Content pages → Home: nav · Informational pages are part of the main site navigation
- AJAX API → MySQL schema: read/write · Public AJAX handlers persist and query site data
- AJAX API → PHPMailer: send mail · Account and booking flows can trigger email notifications
- Public includes → Home: layout · Shared includes compose public pages
- Public includes → AJAX API: bootstrap · Public endpoints reuse shared utilities and config
- Dashboard → Cars admin: manage · Dashboard routes into entity management screens
- Dashboard → Content admin: manage · Dashboard routes into operational management screens
- Admin AJAX → MySQL schema: read/write · Admin CRUD handlers operate on the database
- Admin AJAX → PHPMailer: notify · Admin-side actions may trigger email workflows
- Admin includes → Dashboard: layout · Shared admin includes compose the back-office UI
- Admin includes → Admin AJAX: bootstrap · Admin endpoints reuse common config and helpers
- Stylesheets → Home: style · CSS supports the public interface
- Stylesheets → Dashboard: style · CSS supports the admin interface
- MySQL schema → Cars: content · Listings are powered by stored car data
- MySQL schema → Booking flow: state · Bookings and payments depend on stored booking records
- MySQL schema → Content admin: ops data · Admin screens manage content, users, and bookings
