# alax0915/cpp architecture

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

- Interactive diagram: https://gitdiagram.com/alax0915/cpp
- Repository: https://github.com/alax0915/cpp

## Overview

This is a console-based car-rental agency. The user selects registration, rental, return, or listing actions from a menu; handlers validate input and update in-memory customer and car arrays, with rentals stored on each customer. The graph distinguishes menu orchestration, fleet operations, customer operations, and rental operations. Evidence is limited to the supplied excerpts and source index; no README capabilities or external integrations are documented.

Main entry points: [`main.cpp`](https://github.com/alax0915/cpp/blob/main/main.cpp) (Console menu), [`function.cpp`](https://github.com/alax0915/cpp/blob/main/function.cpp) (In-memory records), [`create_rental.cpp`](https://github.com/alax0915/cpp/blob/main/create_rental.cpp) (Create rental), [`register_car.cpp`](https://github.com/alax0915/cpp/blob/main/register_car.cpp) (Register car)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_menu["Menu"]
  node_menu["Console menu<br/>[main.cpp]"]
  node_state[("In-memory records<br/>[function.cpp]")]
end

subgraph group_fleet["Fleet"]
  node_car_model["Car record<br/>[car.cpp]"]
  node_car_register["Register car<br/>[register_car.cpp]"]
  node_car_validate["Validate car<br/>[validate_car.cpp]"]
  node_car_display["List available cars<br/>[display_car.cpp]"]
end

subgraph group_customers["Customers"]
  node_customer_model["Customer record<br/>[customer.cpp]"]
  node_customer_register["Register customer"]
  node_customer_validate["Validate customer"]
  node_customer_display["List customers"]
end

subgraph group_rentals["Rentals"]
  node_rent_model["Rental record<br/>[rent.cpp]"]
  node_rent_validate["Validate rental<br/>[validate_rent.cpp]"]
  node_rent_create["Create rental<br/>[create_rental.cpp]"]
  node_rent_return["Return car<br/>[return_car.cpp]"]
end

node_user(("Agency user"))

node_user -->|"chooses action"| node_menu
node_menu -->|"dispatches"| node_car_register
node_menu -->|"dispatches"| node_customer_register
node_menu -->|"dispatches"| node_rent_create
node_menu -->|"dispatches"| node_rent_return
node_menu -->|"dispatches"| node_car_display
node_menu -->|"dispatches"| node_customer_display
node_car_register -->|"validates"| node_car_validate
node_customer_register -->|"validates"| node_customer_validate
node_rent_create -->|"validates"| node_rent_validate
node_rent_create -->|"checks customer"| node_rent_validate
node_rent_create -->|"displays options"| node_car_display
node_rent_return -->|"checks customer"| node_rent_validate
node_car_register -->|"stores car"| node_state
node_customer_register -->|"stores customer"| node_state
node_rent_create -->|"updates records"| node_state
node_rent_return -->|"updates records"| node_state
node_car_display -->|"reads cars"| node_state
node_customer_display -->|"reads customers"| node_state

click node_menu "https://github.com/alax0915/cpp/blob/main/main.cpp"
click node_state "https://github.com/alax0915/cpp/blob/main/function.cpp"
click node_car_model "https://github.com/alax0915/cpp/blob/main/car.cpp"
click node_car_register "https://github.com/alax0915/cpp/blob/main/register_car.cpp"
click node_car_validate "https://github.com/alax0915/cpp/blob/main/validate_car.cpp"
click node_car_display "https://github.com/alax0915/cpp/blob/main/display_car.cpp"
click node_customer_model "https://github.com/alax0915/cpp/blob/main/customer.cpp"
click node_customer_register "https://github.com/alax0915/cpp/blob/main/register_customer.cpp"
click node_customer_validate "https://github.com/alax0915/cpp/blob/main/validate_customer.cpp"
click node_customer_display "https://github.com/alax0915/cpp/blob/main/display_customer.cpp"
click node_rent_model "https://github.com/alax0915/cpp/blob/main/rent.cpp"
click node_rent_validate "https://github.com/alax0915/cpp/blob/main/validate_rent.cpp"
click node_rent_create "https://github.com/alax0915/cpp/blob/main/create_rental.cpp"
click node_rent_return "https://github.com/alax0915/cpp/blob/main/return_car.cpp"

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_menu,node_state,node_user toneBlue
class node_car_model,node_car_register,node_car_validate,node_car_display toneAmber
class node_customer_model,node_customer_register,node_customer_validate,node_customer_display toneMint
class node_rent_model,node_rent_validate,node_rent_create,node_rent_return toneRose
```

## Components

### Menu

- [Console menu](https://github.com/alax0915/cpp/blob/main/main.cpp): `main.cpp`
- [In-memory records](https://github.com/alax0915/cpp/blob/main/function.cpp): `function.cpp`

### Fleet

- [Car record](https://github.com/alax0915/cpp/blob/main/car.cpp): `car.cpp`
- [Register car](https://github.com/alax0915/cpp/blob/main/register_car.cpp): `register_car.cpp`
- [Validate car](https://github.com/alax0915/cpp/blob/main/validate_car.cpp): `validate_car.cpp`
- [List available cars](https://github.com/alax0915/cpp/blob/main/display_car.cpp): `display_car.cpp`

### Customers

- [Customer record](https://github.com/alax0915/cpp/blob/main/customer.cpp): `customer.cpp`
- [Register customer](https://github.com/alax0915/cpp/blob/main/register_customer.cpp): `register_customer.cpp`
- [Validate customer](https://github.com/alax0915/cpp/blob/main/validate_customer.cpp): `validate_customer.cpp`
- [List customers](https://github.com/alax0915/cpp/blob/main/display_customer.cpp): `display_customer.cpp`

### Rentals

- [Rental record](https://github.com/alax0915/cpp/blob/main/rent.cpp): `rent.cpp`
- [Validate rental](https://github.com/alax0915/cpp/blob/main/validate_rent.cpp): `validate_rent.cpp`
- [Create rental](https://github.com/alax0915/cpp/blob/main/create_rental.cpp): `create_rental.cpp`
- [Return car](https://github.com/alax0915/cpp/blob/main/return_car.cpp): `return_car.cpp`

### Other components

- **Agency user**

## Connections

- Agency user → Console menu: chooses action (evidence: `main.cpp`)
- Console menu → Register car: dispatches (evidence: `main.cpp`)
- Console menu → Register customer: dispatches (evidence: `main.cpp`)
- Console menu → Create rental: dispatches (evidence: `main.cpp`)
- Console menu → Return car: dispatches (evidence: `main.cpp`)
- Console menu → List available cars: dispatches (evidence: `main.cpp`)
- Console menu → List customers: dispatches (evidence: `main.cpp`)
- Register car → Validate car: validates (evidence: `register_car.cpp`)
- Register customer → Validate customer: validates (evidence: `register_customer.cpp`)
- Create rental → Validate rental: validates (evidence: `create_rental.cpp`)
- Create rental → Validate rental: checks customer (evidence: `create_rental.cpp`)
- Create rental → List available cars: displays options (evidence: `create_rental.cpp`)
- Return car → Validate rental: checks customer (evidence: `return_car.cpp`)
- Register car → In-memory records: stores car (evidence: `register_car.cpp`)
- Register customer → In-memory records: stores customer (evidence: `register_customer.cpp`)
- Create rental → In-memory records: updates records (evidence: `create_rental.cpp`)
- Return car → In-memory records: updates records (evidence: `return_car.cpp`)
- List available cars → In-memory records: reads cars (evidence: `display_car.cpp`)
- List customers → In-memory records: reads customers (evidence: `display_customer.cpp`)
