# rayhan-bin-maleque/rent-a-car-management-system architecture

> Architecture diagram of the GitHub repository rayhan-bin-maleque/rent-a-car-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rayhan-bin-maleque/rent-a-car-management-system
- Repository: https://github.com/rayhan-bin-maleque/rent-a-car-management-system

## Overview

Rent A CAR is a PHP/MySQL rental-management application organized around role-based MVC-style routes. Requests enter through index.php, dispatch to authentication or a role controller, and use domain models for booking, vehicle, user, payment, maintenance, and log operations. The principal customer workflow is browse/search → request a booking → pay → view a receipt; managers approve bookings and manage cars, while staff verify vehicle operations and record maintenance. The source excerpts show several controller/model calls and direct SQL access; README-documented capabilities with unsampled implementation are represented without asserting unverified calls.

Main entry points: [`index.php`](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/index.php) (Request router), [`controllers/customer_controller.php`](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/customer_controller.php) (Customer workflow), [`controllers/admin_controller.php`](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/admin_controller.php) (Administration), [`controllers/staff_controller.php`](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/staff_controller.php) (Staff operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request and access"]
  node_router["Request router<br/>[index.php]"]
  node_auth["Authentication"]
  node_helpers["Session helpers<br/>[helpers.php]"]
end

subgraph group_rental["Rental operations"]
  node_customer_flow["Customer workflow"]
  node_manager_ops["Manager operations"]
  node_staff_ops["Staff operations"]
  node_admin_ops["Administration"]
  node_ajax["AJAX searches"]
end

subgraph group_data["Domain data"]
  node_booking["Bookings<br/>[booking_model.php]"]
  node_cars["Car inventory<br/>[car_model.php]"]
  node_users["User accounts<br/>[user_model.php]"]
  node_payments["Payments<br/>[payment_model.php]"]
  node_maintenance["Maintenance records"]
  node_logs["Activity logs<br/>[log_model.php]"]
  node_sql_connection[("MySQL connection<br/>[database.php]")]
end

subgraph group_interfaces["Role views"]
  node_customer_views["Customer screens"]
  node_manager_views["Manager screens"]
  node_staff_views["Staff screens"]
  node_admin_views["Admin screens"]
  node_auth_views["Login and registration"]
end

node_customer_actor(("Customer"))
node_admin_actor(("Administrator"))
node_manager_actor(("Manager"))
node_staff_actor(("Staff"))
node_mysql[("MySQL database")]

node_customer_actor -->|"requests"| node_router
node_admin_actor -->|"requests"| node_router
node_manager_actor -->|"requests"| node_router
node_staff_actor -->|"requests"| node_router
node_router -->|"dispatches"| node_auth
node_router -->|"dispatches"| node_admin_ops
node_router -->|"dispatches"| node_manager_ops
node_router -->|"dispatches"| node_staff_ops
node_router -->|"dispatches"| node_customer_flow
node_router -->|"dispatches"| node_ajax
node_router -->|"loads"| node_sql_connection
node_sql_connection -->|"connects"| node_mysql
node_auth -->|"authenticates"| node_users
node_auth -->|"records activity"| node_logs
node_auth -->|"renders"| node_auth_views
node_customer_flow -->|"creates and reads"| node_booking
node_customer_flow -->|"checks availability"| node_cars
node_customer_flow -->|"creates and reads"| node_payments
node_customer_flow -->|"renders"| node_customer_views
node_manager_ops -->|"manages"| node_cars
node_manager_ops -->|"reviews"| node_booking
node_manager_ops -->|"renders"| node_manager_views
node_staff_ops -->|"verifies operations"| node_booking
node_staff_ops -->|"updates status"| node_cars
node_staff_ops -->|"records service"| node_maintenance
node_staff_ops -->|"reads records"| node_payments
node_staff_ops -->|"renders"| node_staff_views
node_admin_ops -->|"manages"| node_users
node_admin_ops -->|"reads inventory"| node_cars
node_admin_ops -->|"reads bookings"| node_booking
node_admin_ops -->|"reads payments"| node_payments
node_admin_ops -->|"reads logs"| node_logs
node_admin_ops -->|"renders"| node_admin_views
node_ajax -->|"searches"| node_cars
node_ajax -->|"searches"| node_logs
node_booking -->|"looks up vehicle"| node_cars
node_customer_flow -.->|"booking lifecycle"| node_manager_ops
node_customer_flow -.->|"pickup and return"| node_staff_ops

click node_router "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/index.php"
click node_auth "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/auth_controller.php"
click node_helpers "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/helpers/helpers.php"
click node_customer_flow "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/customer_controller.php"
click node_manager_ops "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/manager_controller.php"
click node_staff_ops "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/staff_controller.php"
click node_admin_ops "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/admin_controller.php"
click node_ajax "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/ajax_controller.php"
click node_booking "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/booking_model.php"
click node_cars "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/car_model.php"
click node_users "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/user_model.php"
click node_payments "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/payment_model.php"
click node_maintenance "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/maintenance_model.php"
click node_logs "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/log_model.php"
click node_sql_connection "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/config/database.php"
click node_customer_views "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/customer"
click node_manager_views "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/manager"
click node_staff_views "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/staff"
click node_admin_views "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/admin"
click node_auth_views "https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/auth"

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_router,node_auth,node_helpers toneBlue
class node_customer_flow,node_manager_ops,node_staff_ops,node_admin_ops,node_ajax,node_mysql toneAmber
class node_booking,node_cars,node_users,node_payments,node_maintenance,node_logs,node_sql_connection toneMint
class node_customer_views,node_manager_views,node_staff_views,node_admin_views,node_auth_views toneRose
class node_customer_actor,node_admin_actor,node_manager_actor,node_staff_actor toneIndigo
```

## Components

### Request and access

- [Request router](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/index.php): `index.php`
- [Authentication](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/auth_controller.php): `controllers/auth_controller.php`
- [Session helpers](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/helpers/helpers.php): `helpers/helpers.php`

### Rental operations

- [Customer workflow](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/customer_controller.php): `controllers/customer_controller.php`
- [Manager operations](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/manager_controller.php): `controllers/manager_controller.php`
- [Staff operations](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/staff_controller.php): `controllers/staff_controller.php`
- [Administration](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/admin_controller.php): `controllers/admin_controller.php`
- [AJAX searches](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/controllers/ajax_controller.php): `controllers/ajax_controller.php`

### Domain data

- [Bookings](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/booking_model.php): `models/booking_model.php`
- [Car inventory](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/car_model.php): `models/car_model.php`
- [User accounts](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/user_model.php): `models/user_model.php`
- [Payments](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/payment_model.php): `models/payment_model.php`
- [Maintenance records](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/maintenance_model.php): `models/maintenance_model.php`
- [Activity logs](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/models/log_model.php): `models/log_model.php`
- [MySQL connection](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/blob/main/config/database.php): `config/database.php`

### Role views

- [Customer screens](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/customer): `views/customer`
- [Manager screens](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/manager): `views/manager`
- [Staff screens](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/staff): `views/staff`
- [Admin screens](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/admin): `views/admin`
- [Login and registration](https://github.com/rayhan-bin-maleque/rent-a-car-management-system/tree/main/views/auth): `views/auth`

### Other components

- **Customer**
- **Administrator**
- **Manager**
- **Staff**
- **MySQL database**

## Connections

- Customer → Request router: requests (evidence: `README.md`)
- Administrator → Request router: requests (evidence: `README.md`)
- Manager → Request router: requests (evidence: `README.md`)
- Staff → Request router: requests (evidence: `README.md`)
- Request router → Authentication: dispatches (evidence: `index.php`)
- Request router → Administration: dispatches (evidence: `index.php`)
- Request router → Manager operations: dispatches (evidence: `index.php`)
- Request router → Staff operations: dispatches (evidence: `index.php`)
- Request router → Customer workflow: dispatches (evidence: `index.php`)
- Request router → AJAX searches: dispatches (evidence: `index.php`)
- Request router → MySQL connection: loads (evidence: `index.php`)
- MySQL connection → MySQL database: connects (evidence: `config/database.php`)
- Authentication → User accounts: authenticates (evidence: `controllers/auth_controller.php`)
- Authentication → Activity logs: records activity (evidence: `controllers/auth_controller.php`)
- Authentication → Login and registration: renders (evidence: `controllers/auth_controller.php`)
- Customer workflow → Bookings: creates and reads (evidence: `controllers/customer_controller.php`)
- Customer workflow → Car inventory: checks availability (evidence: `controllers/customer_controller.php`)
- Customer workflow → Payments: creates and reads (evidence: `controllers/customer_controller.php`)
- Customer workflow → Customer screens: renders (evidence: `controllers/customer_controller.php`)
- Manager operations → Car inventory: manages (evidence: `controllers/manager_controller.php`)
- Manager operations → Bookings: reviews (evidence: `controllers/manager_controller.php`)
- Manager operations → Manager screens: renders (evidence: `controllers/manager_controller.php`)
- Staff operations → Bookings: verifies operations (evidence: `controllers/staff_controller.php`)
- Staff operations → Car inventory: updates status (evidence: `controllers/staff_controller.php`)
- Staff operations → Maintenance records: records service (evidence: `controllers/staff_controller.php`)
- Staff operations → Payments: reads records (evidence: `controllers/staff_controller.php`)
- Staff operations → Staff screens: renders (evidence: `controllers/staff_controller.php`)
- Administration → User accounts: manages (evidence: `controllers/admin_controller.php`)
- Administration → Car inventory: reads inventory (evidence: `controllers/admin_controller.php`)
- Administration → Bookings: reads bookings (evidence: `controllers/admin_controller.php`)
- Administration → Payments: reads payments (evidence: `controllers/admin_controller.php`)
- Administration → Activity logs: reads logs (evidence: `controllers/admin_controller.php`)
- Administration → Admin screens: renders (evidence: `controllers/admin_controller.php`)
- AJAX searches → Car inventory: searches (evidence: `controllers/ajax_controller.php`)
- AJAX searches → Activity logs: searches (evidence: `controllers/ajax_controller.php`)
- Bookings → Car inventory: looks up vehicle (evidence: `models/booking_model.php`)
- Customer workflow → Manager operations: booking lifecycle (evidence: `README.md`)
- Customer workflow → Staff operations: pickup and return (evidence: `README.md`)
