# muhammadelzmrany/car-rental-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/muhammadelzmrany/car-rental-management-system
- Repository: https://github.com/muhammadelzmrany/car-rental-management-system

## Overview

This is a PHP/MySQL car-rental management application. Customers browse branch-filtered cars, search inventory, register or sign in, create reservations, and complete payment; administrators manage vehicles, pickup/return, users, and reports. The graph separates customer flows, reservation/payment stages, administration, and shared infrastructure. README features cover some unsampled endpoints; those capabilities are included, but their internal calls are not inferred. Database relationships are shown only where the excerpts or README support them.

Main entry points: [`includes/db.php`](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/db.php) (Database connection), [`admin/index.php`](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/index.php) (Admin dashboard), [`includes/functions.php`](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/functions.php) (Security helpers), [`index.php`](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/index.php) (Car listings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_home["Car listings<br/>[index.php]"]
  node_search["Advanced search"]
  node_auth["Account access<br/>[login.php]"]
  node_signup["Registration<br/>[signup.php]"]
end

subgraph group_rental["Rental lifecycle"]
  node_rental["Reservation booking<br/>[rent.php]"]
  node_return["Return confirmation<br/>[return_confirm.php]"]
  node_payment["Payment processing<br/>[payment.php]"]
  node_invoice["Invoices<br/>[invoice.php]"]
end

subgraph group_admin["Administration"]
  node_admin_home["Admin dashboard<br/>[index.php]"]
  node_fleet_add["Add vehicles<br/>[addcars.php]"]
  node_fleet_update["Vehicle updates<br/>[updatecar.php]"]
  node_pickup["Pickup and return<br/>[pickup_return.php]"]
  node_users["User management<br/>[users.php]"]
  node_reports["Admin reports"]
end

subgraph group_platform["Shared platform"]
  node_functions["Security helpers<br/>[functions.php]"]
  node_auth_guard["Admin authorization<br/>[admin_auth.php]"]
  node_db_access["Database connection<br/>[db.php]"]
  node_config["Configuration<br/>[config.php]"]
  node_database[("Rental data<br/>[final.sql]")]
end

node_customer(("Customer"))
node_admin_actor(("Administrator"))

node_customer -->|"browses"| node_home
node_customer -->|"searches"| node_search
node_customer -->|"signs in"| node_auth
node_customer -->|"registers"| node_signup
node_home -->|"opens booking"| node_rental
node_customer -->|"confirms return"| node_return
node_customer -->|"pays"| node_payment
node_customer -.->|"requests invoice"| node_invoice
node_admin_actor -->|"manages fleet"| node_admin_home
node_admin_home -->|"links to"| node_fleet_add
node_admin_home -->|"links to"| node_fleet_update
node_admin_home -->|"links to"| node_pickup
node_admin_home -->|"links to"| node_reports
node_admin_home -->|"links to"| node_users
node_home -->|"queries"| node_db_access
node_search -->|"queries"| node_db_access
node_rental -->|"queries and records"| node_db_access
node_payment -->|"queries"| node_db_access
node_reports -->|"queries"| node_db_access
node_fleet_update -->|"updates"| node_db_access
node_admin_home -->|"queries"| node_db_access
node_auth_guard -->|"checks session"| node_functions
node_db_access -->|"loads settings"| node_config
node_db_access -->|"uses connection helper"| node_functions
node_functions -->|"loads settings"| node_config
node_db_access -->|"connects to"| node_database
node_fleet_add -->|"uses helpers"| node_functions
node_users -->|"uses helpers"| node_functions
node_pickup -->|"uses helpers"| node_functions
node_invoice -->|"queries"| node_db_access
node_return -->|"queries"| node_db_access

click node_home "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/index.php"
click node_search "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/advanced_search.php"
click node_auth "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/login.php"
click node_signup "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/signup.php"
click node_rental "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/rent.php"
click node_return "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/return_confirm.php"
click node_payment "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/payment.php"
click node_invoice "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/invoice.php"
click node_admin_home "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/index.php"
click node_fleet_add "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/addcars.php"
click node_fleet_update "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/updatecar.php"
click node_pickup "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/pickup_return.php"
click node_users "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/users.php"
click node_reports "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/advanced_reports.php"
click node_functions "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/functions.php"
click node_auth_guard "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/admin_auth.php"
click node_db_access "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/db.php"
click node_config "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/config.php"
click node_database "https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/final.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_home,node_search,node_auth,node_signup toneBlue
class node_rental,node_return,node_payment,node_invoice toneAmber
class node_admin_home,node_fleet_add,node_fleet_update,node_pickup,node_users,node_reports toneMint
class node_functions,node_auth_guard,node_db_access,node_config,node_database toneRose
class node_customer,node_admin_actor toneIndigo
```

## Components

### Customer experience

- [Car listings](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/index.php): `index.php`
- [Advanced search](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/advanced_search.php): `php/advanced_search.php`
- [Account access](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/login.php): `php/login.php`
- [Registration](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/signup.php): `php/signup.php`

### Rental lifecycle

- [Reservation booking](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/rent.php): `php/rent.php`
- [Return confirmation](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/return_confirm.php): `php/return_confirm.php`
- [Payment processing](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/payment.php): `php/payment.php`
- [Invoices](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/php/invoice.php): `php/invoice.php`

### Administration

- [Admin dashboard](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/index.php): `admin/index.php`
- [Add vehicles](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/addcars.php): `admin/addcars.php`
- [Vehicle updates](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/updatecar.php): `admin/updatecar.php`
- [Pickup and return](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/pickup_return.php): `admin/pickup_return.php`
- [User management](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/users.php): `admin/users.php`
- [Admin reports](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/admin/advanced_reports.php): `admin/advanced_reports.php`

### Shared platform

- [Security helpers](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/functions.php): `includes/functions.php`
- [Admin authorization](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/admin_auth.php): `includes/admin_auth.php`
- [Database connection](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/db.php): `includes/db.php`
- [Configuration](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/includes/config.php): `includes/config.php`
- [Rental data](https://github.com/muhammadelzmrany/car-rental-management-system/blob/main/final.sql): `final.sql`

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Car listings: browses (evidence: `index.php`)
- Customer → Advanced search: searches (evidence: `README.md`)
- Customer → Account access: signs in (evidence: `README.md`)
- Customer → Registration: registers (evidence: `README.md`)
- Car listings → Reservation booking: opens booking (evidence: `index.php`)
- Customer → Return confirmation: confirms return (evidence: `README.md`)
- Customer → Payment processing: pays (evidence: `README.md`)
- Customer → Invoices: requests invoice
- Administrator → Admin dashboard: manages fleet (evidence: `admin/index.php`)
- Admin dashboard → Add vehicles: links to (evidence: `admin/index.php`)
- Admin dashboard → Vehicle updates: links to (evidence: `admin/index.php`)
- Admin dashboard → Pickup and return: links to (evidence: `admin/index.php`)
- Admin dashboard → Admin reports: links to (evidence: `admin/index.php`)
- Admin dashboard → User management: links to (evidence: `admin/index.php`)
- Car listings → Database connection: queries (evidence: `index.php`)
- Advanced search → Database connection: queries (evidence: `php/advanced_search.php`)
- Reservation booking → Database connection: queries and records (evidence: `php/rent.php`)
- Payment processing → Database connection: queries (evidence: `php/payment.php`)
- Admin reports → Database connection: queries (evidence: `admin/advanced_reports.php`)
- Vehicle updates → Database connection: updates (evidence: `admin/updatecar.php`)
- Admin dashboard → Database connection: queries (evidence: `admin/index.php`)
- Admin authorization → Security helpers: checks session (evidence: `includes/admin_auth.php`)
- Database connection → Configuration: loads settings (evidence: `includes/db.php`)
- Database connection → Security helpers: uses connection helper (evidence: `includes/db.php`)
- Security helpers → Configuration: loads settings (evidence: `includes/functions.php`)
- Database connection → Rental data: connects to (evidence: `README.md`)
- Add vehicles → Security helpers: uses helpers (evidence: `admin/addcars.php`)
- User management → Security helpers: uses helpers (evidence: `admin/users.php`)
- Pickup and return → Security helpers: uses helpers (evidence: `admin/pickup_return.php`)
- Invoices → Database connection: queries (evidence: `php/invoice.php`)
- Return confirmation → Database connection: queries (evidence: `php/return_confirm.php`)
