# isaifghjnbvf/ksi_car_showroom architecture

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

- Interactive diagram: https://gitdiagram.com/isaifghjnbvf/ksi_car_showroom
- Repository: https://github.com/isaifghjnbvf/ksi_car_showroom

## Overview

KSI is a console-based car showroom manager. A user selects menu actions to add, browse, search, update, delete, or sell cars; the program executes the corresponding database operations and prints results. The same script creates and selects the MySQL database and defines the cars table. Stock totals come from database queries, while total sales are accumulated in memory for the current run. All behavior is in one file, so the components below are logical responsibilities rather than separate modules.

Main entry points: [`ksi.py`](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py) (Console menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Showroom user"))
node_menu["Console menu<br/>[ksi.py]"]
node_inventory[("Car inventory<br/>[ksi.py]")]
node_add["Add car<br/>[ksi.py]"]
node_browse["View cars<br/>[ksi.py]"]
node_search["Search cars<br/>[ksi.py]"]
node_update["Update car<br/>[ksi.py]"]
node_delete["Delete car<br/>[ksi.py]"]
node_sell["Sell car<br/>[ksi.py]"]
node_sales["Session sales total<br/>[ksi.py]"]
node_summary["Stock summary<br/>[ksi.py]"]

node_user -->|"chooses action"| node_menu
node_menu -->|"dispatches"| node_add
node_menu -->|"dispatches"| node_browse
node_menu -->|"dispatches"| node_search
node_menu -->|"dispatches"| node_update
node_menu -->|"dispatches"| node_delete
node_menu -->|"dispatches"| node_sell
node_menu -->|"dispatches"| node_summary
node_menu -->|"creates table"| node_inventory
node_add -->|"inserts"| node_inventory
node_browse -->|"reads"| node_inventory
node_search -->|"queries"| node_inventory
node_update -->|"reads and updates"| node_inventory
node_delete -->|"reads and deletes"| node_inventory
node_sell -->|"reads and deletes"| node_inventory
node_sell -->|"adds sale price"| node_sales
node_summary -->|"counts and sums"| node_inventory
node_summary -->|"reads total"| node_sales

click node_menu "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_inventory "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_add "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_browse "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_search "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_update "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_delete "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_sell "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_sales "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"
click node_summary "https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py"

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_user,node_browse toneBlue
class node_menu,node_add,node_search,node_update,node_delete,node_sell,node_sales,node_summary toneTeal
class node_inventory toneAmber
```

## Components

### Other components

- **Showroom user**
- [Console menu](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Car inventory](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Add car](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [View cars](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Search cars](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Update car](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Delete car](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Sell car](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Session sales total](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`
- [Stock summary](https://github.com/isaifghjnbvf/ksi_car_showroom/blob/main/ksi.py): `ksi.py`

## Connections

- Showroom user → Console menu: chooses action (evidence: `ksi.py`)
- Console menu → Add car: dispatches (evidence: `ksi.py`)
- Console menu → View cars: dispatches (evidence: `ksi.py`)
- Console menu → Search cars: dispatches (evidence: `ksi.py`)
- Console menu → Update car: dispatches (evidence: `ksi.py`)
- Console menu → Delete car: dispatches (evidence: `ksi.py`)
- Console menu → Sell car: dispatches (evidence: `ksi.py`)
- Console menu → Stock summary: dispatches (evidence: `ksi.py`)
- Console menu → Car inventory: creates table (evidence: `ksi.py`)
- Add car → Car inventory: inserts (evidence: `ksi.py`)
- View cars → Car inventory: reads (evidence: `ksi.py`)
- Search cars → Car inventory: queries (evidence: `ksi.py`)
- Update car → Car inventory: reads and updates (evidence: `ksi.py`)
- Delete car → Car inventory: reads and deletes (evidence: `ksi.py`)
- Sell car → Car inventory: reads and deletes (evidence: `ksi.py`)
- Sell car → Session sales total: adds sale price (evidence: `ksi.py`)
- Stock summary → Car inventory: counts and sums (evidence: `ksi.py`)
- Stock summary → Session sales total: reads total (evidence: `ksi.py`)
