# amey-thakur/car-rental-system architecture

> Architecture diagram of the GitHub repository amey-thakur/car-rental-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amey-thakur/car-rental-system
- Repository: https://github.com/amey-thakur/car-rental-system

## Overview

1. **Repository shape**
   - This is a **single monolithic PHP/MySQL application** for car rental management.
   - The runnable app lives under `Source Code/`; the rest of the repo is mainly **academic documentation, diagrams, papers, and packaging assets**.

2. **Core runtime stack**
   - Server-side logic is **procedural PHP 7.x** running behind **Apache**.
   - Persistence is **MySQL**, with schema and seed/design captured in `Source Code/sqlfile/carrental.sql`.
   - The UI is built with **HTML/CSS, Bootstrap 3, and jQuery**, plus a few legacy plugins for forms and dashboard widgets.

3. **Main architectural boundary: public site vs admin backend**
   - The app is split into two clear surfaces:
     - `Source Code/` public customer-facing pages.
     - `Source Code/admin/` administration console.
   - Both sides share the same database and common include patterns, but they expose different workflows and permissions.

4. **Shared application infrastructure**
   - `Source Code/includes/` and `Source Code/admin/includes/` contain the shared cross-cutting pieces such as:
     - database configuration (`config.php`)
     - header/footer layout fragments
     - login/registration/password recovery helpers
   - This indicates a **page-per-action** architecture with repeated includes rather than a framework-driven MVC structure.

5. **Customer-facing flows**
   - Public pages cover the end-user journey:
     - landing page: `index.php`
     - vehicle discovery: `car-listing.php`, `search-carresult.php`, `vehicle-details.php`
     - availability checks and booking: `check_availability.php`
     - account area: `profile.php`, `my-booking.php`, `update-password.php`
     - support/content: `contact-us.php`, `page.php`
   - Authentication and account setup are handled by `includes/login.php`, `registration.php`, and `forgotpassword.php`.

6. **Booking and inventory flow**
   - The main transactional flow is:
     - user browses vehicles
     - user checks availability for a date range
     - user submits a booking
     - booking status is later tracked in the account area
   - Vehicle data and booking state are stored in MySQL and surfaced through the search/detail pages and the booking history page.

7. **Administrative control plane**
   - The admin area is the operational backend for managing the rental business:
     - dashboard metrics: `dashboard.php`
     - fleet CRUD: `manage-vehicles.php`, `create-brand.php`, `edit-vehicle.php`, `edit-brand.php`, `post-avehicle.php`
     - booking moderation: `manage-bookings.php`
     - user/admin records: `reg-users.php`
     - content and engagement: `manage-pages.php`, `testimonials.php`, `manage-contactusquery.php`, `manage-subscribers.php`
   - This side also includes image-management and password/admin-session utilities, showing that the backend handles both data administration and content maintenance.

8. **Data model boundary**
   - `carrental.sql` is the source of truth for the relational schema.
   - Based on the file structure and feature set, the schema centers on entities such as:
     - users
     - vehicles
     - brands
     - bookings
     - contact inquiries
     - subscribers
     - testimonials
     - CMS-style pages
   - The README also calls out query optimization around vehicle brand and price filtering, so inventory search is a key data access path.

9. **Frontend asset layer**
   - Public assets are in `Source Code/assets/`; admin-specific assets are in `Source Code/admin/css`, `js`, `fonts`, and `img`.
   - The presence of `chartData.js`, `fileinput.js`, and `nicEdit.js` suggests the admin dashboard includes **charts, file uploads, and rich-text editing**.
   - UI rendering is mostly server-generated HTML with client-side enhancement rather than a SPA.

10. **Deployment and environment assumptions**
   - The repository is intended for a **local LAMP-style setup** such as XAMPP/WAMP/MAMP.
   - Database credentials are configured directly in `Source Code/includes/config.php` and `Source Code/admin/includes/config.php`.
   - This is a legacy-style deployment model with no containerization or modern framework abstraction.

11. **Documentation and academic layer**
   - `docs/` and `Mini-Project/` contain the system specification, UML/ER diagrams, report PDFs, and publication artifacts.
   - These materials are important for understanding intended design, but they are **not part of the runtime request flow**.
   - The root `index.html` appears to support repository presentation / GitHub Pages demo content rather than the PHP app itself.

12. **What an architecture diagram should show**
   - A user/browser talks to two PHP surfaces: **public site** and **admin console**.
   - Both surfaces call into the **same MySQL database** through shared config files.
   - The public side supports browsing, authentication, booking, profile management, and support.
   - The admin side supports fleet, bookings, users, CMS pages, testimonials, and inquiries.
   - Supporting layers include static assets, shared includes, and a separate documentation/research artifact set.

Main entry points: [`Source Code/index.php`](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/index.php) (Public site), [`Source Code/admin/index.php`](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/admin/index.php) (Admin console), [`Source Code/sqlfile/carrental.sql`](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/sqlfile/carrental.sql) (MySQL), [`Source Code/car-listing.php`](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/car-listing.php) (Catalog flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_browser(("Browser<br/>client"))
  node_public_site["Public site<br/>php app<br/>[index.php]"]
  node_public_includes["Shared includes<br/>php includes"]
  node_catalog_flow["Catalog flow<br/>browse/search<br/>[car-listing.php]"]
  node_booking_account["Booking area<br/>account/booking<br/>[my-booking.php]"]
  node_support_content["Support pages<br/>content/support<br/>[contact-us.php]"]
  node_auth_entry["Auth entry<br/>login/register<br/>[login.php]"]
  node_admin_console["Admin console<br/>admin php app<br/>[index.php]"]
  node_admin_includes["Admin includes"]
  node_fleet_ops["Fleet ops<br/>vehicle management"]
  node_booking_ops["Booking ops<br/>moderation"]
  node_content_ops["Content ops<br/>cms/support<br/>[manage-pages.php]"]
  node_users_ops["Users ops<br/>user admin<br/>[reg-users.php]"]
end

subgraph group_data["Data"]
  node_mysql_db[("MySQL<br/>relational db<br/>[carrental.sql]")]
end

subgraph group_assets["Assets"]
  node_public_assets["Public assets<br/>static assets"]
  node_admin_assets["Admin assets<br/>static assets"]
end

subgraph group_docs["Docs"]
  node_docs_pack["Docs pack<br/>documentation<br/>[SPECIFICATION.md]"]
  node_mini_project["Mini-project<br/>academic docs"]
end

node_browser -->|"use"| node_public_site
node_browser -->|"administer"| node_admin_console
node_public_site -->|"includes"| node_public_includes
node_public_site -->|"hosts"| node_catalog_flow
node_public_site -->|"hosts"| node_booking_account
node_public_site -->|"hosts"| node_support_content
node_public_site -->|"auth"| node_auth_entry
node_catalog_flow -->|"reads/writes"| node_mysql_db
node_booking_account -->|"reads/writes"| node_mysql_db
node_auth_entry -->|"reads/writes"| node_mysql_db
node_support_content -->|"reads/writes"| node_mysql_db
node_admin_console -->|"includes"| node_admin_includes
node_admin_console -->|"manages"| node_fleet_ops
node_admin_console -->|"manages"| node_booking_ops
node_admin_console -->|"manages"| node_content_ops
node_admin_console -->|"manages"| node_users_ops
node_fleet_ops -->|"reads/writes"| node_mysql_db
node_booking_ops -->|"reads/writes"| node_mysql_db
node_content_ops -->|"reads/writes"| node_mysql_db
node_users_ops -->|"reads/writes"| node_mysql_db
node_public_site -->|"uses"| node_public_assets
node_admin_console -->|"uses"| node_admin_assets
node_docs_pack -.->|"complements"| node_mini_project

click node_public_site "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/index.php"
click node_public_includes "https://github.com/amey-thakur/car-rental-system/tree/main/Source Code/includes"
click node_catalog_flow "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/car-listing.php"
click node_booking_account "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/my-booking.php"
click node_support_content "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/contact-us.php"
click node_auth_entry "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/includes/login.php"
click node_admin_console "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/admin/index.php"
click node_admin_includes "https://github.com/amey-thakur/car-rental-system/tree/main/Source Code/admin/includes"
click node_fleet_ops "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/admin/manage-vehicles.php"
click node_booking_ops "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/admin/manage-bookings.php"
click node_content_ops "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/admin/manage-pages.php"
click node_users_ops "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/admin/reg-users.php"
click node_mysql_db "https://github.com/amey-thakur/car-rental-system/blob/main/Source Code/sqlfile/carrental.sql"
click node_public_assets "https://github.com/amey-thakur/car-rental-system/tree/main/Source Code/assets"
click node_admin_assets "https://github.com/amey-thakur/car-rental-system/tree/main/Source Code/admin/css"
click node_docs_pack "https://github.com/amey-thakur/car-rental-system/blob/main/docs/SPECIFICATION.md"
click node_mini_project "https://github.com/amey-thakur/car-rental-system/tree/main/Mini-Project"

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_browser,node_public_site,node_public_includes,node_catalog_flow,node_booking_account,node_support_content,node_auth_entry,node_admin_console,node_admin_includes,node_fleet_ops,node_booking_ops,node_content_ops,node_users_ops toneBlue
class node_mysql_db toneAmber
class node_public_assets,node_admin_assets toneMint
class node_docs_pack,node_mini_project toneRose
```

## Components

### Runtime

Browser-facing PHP application surfaces and shared request handling.

- **Browser**: client · User agent entering the site and admin console.
- [Public site](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/index.php): php app · Customer-facing PHP pages for browsing, booking, and account actions. · `Source Code/index.php`
- [Shared includes](https://github.com/amey-thakur/car-rental-system/tree/HEAD/Source%20Code/includes): php includes · Common public helpers for config, layout, auth, and forms. · `Source Code/includes`
- [Catalog flow](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/car-listing.php): browse/search · Vehicle listing, search, detail, and availability pages. · `Source Code/car-listing.php`
- [Booking area](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/my-booking.php): account/booking · Booking history, profile, password update, and booking submission flow. · `Source Code/my-booking.php`
- [Support pages](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/contact-us.php): content/support · Contact, static page rendering, and support entry points. · `Source Code/contact-us.php`
- [Auth entry](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/includes/login.php): login/register · Login, registration, password recovery, and logout endpoints. · `Source Code/includes/login.php`
- [Admin console](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/admin/index.php): admin php app · Operational backend for fleet, bookings, users, and CMS management. · `Source Code/admin/index.php`
- [Admin includes](https://github.com/amey-thakur/car-rental-system/tree/HEAD/Source%20Code/admin/includes): admin includes · Shared admin config, header, and navigation fragments. · `Source Code/admin/includes`
- [Fleet ops](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/admin/manage-vehicles.php): vehicle management · Brand and vehicle CRUD, image handling, and inventory publishing. · `Source Code/admin/manage-vehicles.php`
- [Booking ops](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/admin/manage-bookings.php): moderation · Admin moderation and tracking of reservations. · `Source Code/admin/manage-bookings.php`
- [Content ops](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/admin/manage-pages.php): cms/support · Pages, testimonials, contact queries, and subscriber management. · `Source Code/admin/manage-pages.php`
- [Users ops](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/admin/reg-users.php): user admin · Registered users and admin password/session maintenance. · `Source Code/admin/reg-users.php`

### Data

Database schema and persistence layer.

- [MySQL](https://github.com/amey-thakur/car-rental-system/blob/HEAD/Source%20Code/sqlfile/carrental.sql): relational db · Single shared database for users, vehicles, bookings, content, and inquiries. · `Source Code/sqlfile/carrental.sql`

### Assets

Static UI resources for public and admin interfaces.

- [Public assets](https://github.com/amey-thakur/car-rental-system/tree/HEAD/Source%20Code/assets): static assets · Front-end CSS, JS, fonts, and images for the customer site. · `Source Code/assets`
- [Admin assets](https://github.com/amey-thakur/car-rental-system/tree/HEAD/Source%20Code/admin/css): static assets · Admin CSS, JS, fonts, and uploaded vehicle images. · `Source Code/admin/css`

### Docs

Specification, papers, and presentation artifacts.

- [Docs pack](https://github.com/amey-thakur/car-rental-system/blob/main/docs/SPECIFICATION.md): documentation · Specification, report PDFs, and academic project artifacts. · `docs/SPECIFICATION.md`
- [Mini-project](https://github.com/amey-thakur/car-rental-system/tree/main/Mini-Project): academic docs · Publication and draft materials supporting the repository narrative. · `Mini-Project`

## Connections

- Browser → Public site: use · Customers access the public PHP site.
- Browser → Admin console: administer · Operators access the backend console.
- Public site → Shared includes: includes · Public pages reuse shared layout, config, and auth helpers.
- Public site → Catalog flow: hosts · Vehicle discovery and availability flow.
- Public site → Booking area: hosts · Booking history and account management.
- Public site → Support pages: hosts · Support and content pages.
- Public site → Auth entry: auth · Login, registration, recovery, and logout.
- Catalog flow → MySQL: reads/writes · Searches vehicles and checks availability against shared data.
- Booking area → MySQL: reads/writes · Stores and retrieves bookings and profile state.
- Auth entry → MySQL: reads/writes · Authenticates users and persists account records.
- Support pages → MySQL: reads/writes · Loads pages and stores inquiries where applicable.
- Admin console → Admin includes: includes · Admin pages share config and navigation fragments.
- Admin console → Fleet ops: manages · CRUD for brands, vehicles, and images.
- Admin console → Booking ops: manages · Moderates and tracks bookings.
- Admin console → Content ops: manages · Maintains pages, testimonials, contact requests, and subscribers.
- Admin console → Users ops: manages · Maintains registered users and admin access state.
- Fleet ops → MySQL: reads/writes · Updates fleet and inventory records.
- Booking ops → MySQL: reads/writes · Updates reservation status and history.
- Content ops → MySQL: reads/writes · Stores CMS and engagement records.
- Users ops → MySQL: reads/writes · Reads users and updates admin credentials.
- Public site → Public assets: uses · Serves customer-facing UI assets.
- Admin console → Admin assets: uses · Serves admin dashboard assets and uploads.
- Docs pack → Mini-project: complements · Documentation and academic artifacts overlap in purpose.
