# metshein/car_rent architecture

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

- Interactive diagram: https://gitdiagram.com/metshein/car_rent
- Repository: https://github.com/metshein/car_rent

## Overview

This is a small PHP/MySQL car-rental website prototype: visitors search a car listing and open a car detail page, while an admin area provides an early management interface. The tree contains several parallel directories; the sampled public listing/detail flow is under `autorent/`, while the sampled admin pages are under `car_rent/`. The README also outlines authentication, user accounts and reservations as later stages, but the tree has no corresponding runtime implementation, so these are shown as documented plans rather than wired features.

Main entry points: [`car_rent/admin/index.php`](https://github.com/metshein/car_rent/blob/main/car_rent/admin/index.php) (Admin listing), [`autorent/index.php`](https://github.com/metshein/car_rent/blob/main/autorent/index.php) (Car listing), [`autorent/single_car.php`](https://github.com/metshein/car_rent/blob/main/autorent/single_car.php) (Car detail), [`car_rent/car_edit.php`](https://github.com/metshein/car_rent/blob/main/car_rent/car_edit.php) (Car editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_visitor["Public rental site"]
  node_listing["Car listing<br/>[index.php]"]
  node_detail["Car detail<br/>[single_car.php]"]
end

subgraph group_admin["Car administration"]
  node_admin_home["Admin listing<br/>[index.php]"]
  node_car_edit["Car editor<br/>[car_edit.php]"]
end

subgraph group_data["Database access"]
  node_public_config["DB connection<br/>[config.php]"]
  node_cars_db[("Cars database<br/>[car_rent.sql]")]
  node_admin_config["DB connection<br/>[config.php]"]
  node_admin_db[("Cars database<br/>[car_rent.sql]")]
end

subgraph group_planned["Documented future stages"]
  node_auth_plan["Admin authentication<br/>[README.md]"]
  node_users_plan["User accounts<br/>[README.md]"]
  node_reservations_plan["Reservations<br/>[README.md]"]
end

node_renter(("Renter"))
node_admin_user(("Admin"))

node_renter -->|"opens"| node_listing
node_listing -->|"includes"| node_public_config
node_listing -->|"queries cars"| node_cars_db
node_listing -->|"links to"| node_detail
node_detail -->|"includes"| node_public_config
node_detail -->|"queries car"| node_cars_db
node_admin_user -->|"opens"| node_admin_home
node_admin_home -->|"includes"| node_admin_config
node_admin_home -->|"queries cars"| node_admin_db
node_admin_home -->|"edit link"| node_car_edit
node_car_edit -->|"includes"| node_admin_config
node_car_edit -->|"queries car"| node_admin_db
node_auth_plan -.->|"planned protection"| node_admin_home
node_users_plan -.->|"planned association"| node_reservations_plan

click node_listing "https://github.com/metshein/car_rent/blob/main/autorent/index.php"
click node_detail "https://github.com/metshein/car_rent/blob/main/autorent/single_car.php"
click node_public_config "https://github.com/metshein/car_rent/blob/main/autorent/config.php"
click node_cars_db "https://github.com/metshein/car_rent/blob/main/autorent/db/car_rent.sql"
click node_admin_home "https://github.com/metshein/car_rent/blob/main/car_rent/admin/index.php"
click node_car_edit "https://github.com/metshein/car_rent/blob/main/car_rent/car_edit.php"
click node_admin_config "https://github.com/metshein/car_rent/blob/main/car_rent/config.php"
click node_admin_db "https://github.com/metshein/car_rent/blob/main/car_rent/car_rent.sql"
click node_auth_plan "https://github.com/metshein/car_rent/blob/main/README.md"
click node_users_plan "https://github.com/metshein/car_rent/blob/main/README.md"
click node_reservations_plan "https://github.com/metshein/car_rent/blob/main/README.md"

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_listing,node_detail toneBlue
class node_admin_home,node_car_edit toneAmber
class node_public_config,node_cars_db,node_admin_config,node_admin_db toneMint
class node_auth_plan,node_users_plan,node_reservations_plan toneRose
class node_renter,node_admin_user toneIndigo
```

## Components

### Public rental site

- [Car listing](https://github.com/metshein/car_rent/blob/main/autorent/index.php): `autorent/index.php`
- [Car detail](https://github.com/metshein/car_rent/blob/main/autorent/single_car.php): `autorent/single_car.php`

### Car administration

- [Admin listing](https://github.com/metshein/car_rent/blob/main/car_rent/admin/index.php): `car_rent/admin/index.php`
- [Car editor](https://github.com/metshein/car_rent/blob/main/car_rent/car_edit.php): `car_rent/car_edit.php`

### Database access

- [DB connection](https://github.com/metshein/car_rent/blob/main/autorent/config.php): `autorent/config.php`
- [Cars database](https://github.com/metshein/car_rent/blob/main/autorent/db/car_rent.sql): `autorent/db/car_rent.sql`
- [DB connection](https://github.com/metshein/car_rent/blob/main/car_rent/config.php): `car_rent/config.php`
- [Cars database](https://github.com/metshein/car_rent/blob/main/car_rent/car_rent.sql): `car_rent/car_rent.sql`

### Documented future stages

- [Admin authentication](https://github.com/metshein/car_rent/blob/main/README.md): `README.md`
- [User accounts](https://github.com/metshein/car_rent/blob/main/README.md): `README.md`
- [Reservations](https://github.com/metshein/car_rent/blob/main/README.md): `README.md`

### Other components

- **Renter**
- **Admin**

## Connections

- Renter → Car listing: opens
- Car listing → DB connection: includes
- Car listing → Cars database: queries cars
- Car listing → Car detail: links to
- Car detail → DB connection: includes
- Car detail → Cars database: queries car
- Admin → Admin listing: opens
- Admin listing → DB connection: includes
- Admin listing → Cars database: queries cars
- Admin listing → Car editor: edit link
- Car editor → DB connection: includes
- Car editor → Cars database: queries car
- Admin authentication → Admin listing: planned protection
- User accounts → Reservations: planned association
