# espranav10/rent-a-car architecture

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

- Interactive diagram: https://gitdiagram.com/espranav10/rent-a-car
- Repository: https://github.com/espranav10/rent-a-car

## Overview

This is a vehicle-rental fleet showcase with an admin console for managing vehicles, business hours, blocked dates, and settings. The public flow presents and filters the fleet, opens vehicle details, and supports sharing or contacting the business; the admin flow edits fleet and business data. FleetContext owns data loading and mutations, using Supabase when configured and local initial data as fallback. The README is empty, so capabilities and links are based on the tree and shown source references; unsampled components are included only where their role is clear.

Main entry points: [`src/App.tsx`](https://github.com/espranav10/rent-a-car/blob/main/src/App.tsx) (App routing), [`src/context/FleetContext.tsx`](https://github.com/espranav10/rent-a-car/blob/main/src/context/FleetContext.tsx) (Fleet data context), [`src/components/public/FleetGrid.tsx`](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/FleetGrid.tsx) (Fleet grid), [`src/components/public/VehicleDetailModal.tsx`](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/VehicleDetailModal.tsx) (Vehicle details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Fleet"]
  node_app["App routing<br/>[App.tsx]"]
  node_fleetsearch["Fleet search<br/>[FleetSearchBar.tsx]"]
  node_fleetgrid["Fleet grid<br/>[FleetGrid.tsx]"]
  node_details["Vehicle details"]
  node_share["Vehicle sharing"]
  node_publicpages["Public sections<br/>[ContactSection.tsx]"]
end

subgraph group_admin["Admin Console"]
  node_auth["Admin login<br/>[AdminLogin.tsx]"]
  node_overview["Admin overview<br/>[AdminOverview.tsx]"]
  node_cars["Fleet management<br/>[AdminCars.tsx]"]
  node_editor["Vehicle editor<br/>[CarEditorModal.tsx]"]
  node_hours["Business hours"]
  node_blocked["Blocked dates"]
  node_settings["Business settings<br/>[AdminSettings.tsx]"]
  node_sqlmodal["Schema guidance<br/>[SqlSchemaModal.tsx]"]
end

subgraph group_data["Fleet Data"]
  node_context["Fleet data context<br/>[FleetContext.tsx]"]
  node_parser["Vehicle parser<br/>[vehicleParser.ts]"]
  node_initial["Initial fleet<br/>[initialFleet.ts]"]
  node_client["Supabase client<br/>[supabase.ts]"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase")]
node_storage[("Image storage")]
node_renter(("Rental inquiry channels"))

node_visitor -->|"opens"| node_app
node_app -->|"renders"| node_fleetsearch
node_app -->|"renders"| node_fleetgrid
node_app -->|"opens"| node_details
node_app -->|"renders"| node_publicpages
node_fleetgrid -->|"opens"| node_share
node_details -.->|"opens"| node_share
node_fleetgrid -->|"offers booking"| node_renter
node_details -->|"offers contact"| node_renter
node_app -->|"renders"| node_auth
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_cars
node_app -->|"routes to"| node_hours
node_app -->|"routes to"| node_blocked
node_app -->|"routes to"| node_settings
node_app -->|"opens"| node_editor
node_app -->|"opens"| node_sqlmodal
node_fleetgrid -->|"reads settings"| node_context
node_publicpages -->|"reads fleet data"| node_context
node_auth -->|"uses auth state"| node_context
node_overview -->|"reads data"| node_context
node_cars -->|"manages vehicles"| node_context
node_hours -->|"manages hours"| node_context
node_blocked -->|"manages dates"| node_context
node_settings -->|"saves settings"| node_context
node_editor -->|"saves vehicle"| node_context
node_context -->|"queries"| node_client
node_context -->|"uses fallback"| node_initial
node_context -->|"reads and writes"| node_supabase
node_client -->|"connects"| node_supabase
node_editor -->|"uploads images"| node_client
node_client -->|"stores images"| node_storage
node_fleetgrid -->|"formats vehicles"| node_parser
node_details -->|"formats vehicles"| node_parser
node_editor -->|"serializes details"| node_parser
node_cars -->|"parses vehicles"| node_parser
node_share -->|"shares listing"| node_renter

click node_app "https://github.com/espranav10/rent-a-car/blob/main/src/App.tsx"
click node_fleetsearch "https://github.com/espranav10/rent-a-car/blob/main/src/components/public/FleetSearchBar.tsx"
click node_fleetgrid "https://github.com/espranav10/rent-a-car/blob/main/src/components/public/FleetGrid.tsx"
click node_details "https://github.com/espranav10/rent-a-car/blob/main/src/components/public/VehicleDetailModal.tsx"
click node_share "https://github.com/espranav10/rent-a-car/blob/main/src/components/public/ShareVehicleModal.tsx"
click node_publicpages "https://github.com/espranav10/rent-a-car/blob/main/src/components/public/ContactSection.tsx"
click node_auth "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminLogin.tsx"
click node_overview "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminOverview.tsx"
click node_cars "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminCars.tsx"
click node_editor "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/CarEditorModal.tsx"
click node_hours "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminBusinessHours.tsx"
click node_blocked "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminBlockedDates.tsx"
click node_settings "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminSettings.tsx"
click node_sqlmodal "https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/SqlSchemaModal.tsx"
click node_context "https://github.com/espranav10/rent-a-car/blob/main/src/context/FleetContext.tsx"
click node_parser "https://github.com/espranav10/rent-a-car/blob/main/src/utils/vehicleParser.ts"
click node_initial "https://github.com/espranav10/rent-a-car/blob/main/src/data/initialFleet.ts"
click node_client "https://github.com/espranav10/rent-a-car/blob/main/src/lib/supabase.ts"

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_app,node_fleetsearch,node_fleetgrid,node_details,node_share,node_publicpages toneBlue
class node_auth,node_overview,node_cars,node_editor,node_hours,node_blocked,node_settings,node_sqlmodal,node_supabase,node_storage toneAmber
class node_context,node_parser,node_initial,node_client toneMint
class node_visitor,node_renter toneIndigo
```

## Components

### Public Fleet

- [App routing](https://github.com/espranav10/rent-a-car/blob/main/src/App.tsx): `src/App.tsx`
- [Fleet search](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/FleetSearchBar.tsx): `src/components/public/FleetSearchBar.tsx`
- [Fleet grid](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/FleetGrid.tsx): `src/components/public/FleetGrid.tsx`
- [Vehicle details](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/VehicleDetailModal.tsx): `src/components/public/VehicleDetailModal.tsx`
- [Vehicle sharing](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/ShareVehicleModal.tsx): `src/components/public/ShareVehicleModal.tsx`
- [Public sections](https://github.com/espranav10/rent-a-car/blob/main/src/components/public/ContactSection.tsx): `src/components/public/ContactSection.tsx`

### Admin Console

- [Admin login](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminLogin.tsx): `src/components/admin/AdminLogin.tsx`
- [Admin overview](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminOverview.tsx): `src/components/admin/AdminOverview.tsx`
- [Fleet management](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminCars.tsx): `src/components/admin/AdminCars.tsx`
- [Vehicle editor](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/CarEditorModal.tsx): `src/components/admin/CarEditorModal.tsx`
- [Business hours](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminBusinessHours.tsx): `src/components/admin/AdminBusinessHours.tsx`
- [Blocked dates](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminBlockedDates.tsx): `src/components/admin/AdminBlockedDates.tsx`
- [Business settings](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/AdminSettings.tsx): `src/components/admin/AdminSettings.tsx`
- [Schema guidance](https://github.com/espranav10/rent-a-car/blob/main/src/components/admin/SqlSchemaModal.tsx): `src/components/admin/SqlSchemaModal.tsx`

### Fleet Data

- [Fleet data context](https://github.com/espranav10/rent-a-car/blob/main/src/context/FleetContext.tsx): `src/context/FleetContext.tsx`
- [Vehicle parser](https://github.com/espranav10/rent-a-car/blob/main/src/utils/vehicleParser.ts): `src/utils/vehicleParser.ts`
- [Initial fleet](https://github.com/espranav10/rent-a-car/blob/main/src/data/initialFleet.ts): `src/data/initialFleet.ts`
- [Supabase client](https://github.com/espranav10/rent-a-car/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Visitor**
- **Supabase**
- **Image storage**
- **Rental inquiry channels**

## Connections

- Visitor → App routing: opens (evidence: `src/App.tsx`)
- App routing → Fleet search: renders (evidence: `src/App.tsx`)
- App routing → Fleet grid: renders (evidence: `src/App.tsx`)
- App routing → Vehicle details: opens (evidence: `src/App.tsx`)
- App routing → Public sections: renders (evidence: `src/App.tsx`)
- Fleet grid → Vehicle sharing: opens (evidence: `src/components/public/FleetGrid.tsx`)
- Vehicle details → Vehicle sharing: opens (evidence: `src/components/public/VehicleDetailModal.tsx`)
- Fleet grid → Rental inquiry channels: offers booking (evidence: `src/components/public/FleetGrid.tsx`)
- Vehicle details → Rental inquiry channels: offers contact (evidence: `src/components/public/VehicleDetailModal.tsx`)
- App routing → Admin login: renders (evidence: `src/App.tsx`)
- App routing → Admin overview: routes to (evidence: `src/App.tsx`)
- App routing → Fleet management: routes to (evidence: `src/App.tsx`)
- App routing → Business hours: routes to (evidence: `src/App.tsx`)
- App routing → Blocked dates: routes to (evidence: `src/App.tsx`)
- App routing → Business settings: routes to (evidence: `src/App.tsx`)
- App routing → Vehicle editor: opens (evidence: `src/App.tsx`)
- App routing → Schema guidance: opens (evidence: `src/App.tsx`)
- Fleet grid → Fleet data context: reads settings (evidence: `src/components/public/FleetGrid.tsx`)
- Public sections → Fleet data context: reads fleet data (evidence: `src/components/public/ContactSection.tsx`)
- Admin login → Fleet data context: uses auth state (evidence: `src/components/admin/AdminLogin.tsx`)
- Admin overview → Fleet data context: reads data (evidence: `src/components/admin/AdminOverview.tsx`)
- Fleet management → Fleet data context: manages vehicles (evidence: `src/components/admin/AdminCars.tsx`)
- Business hours → Fleet data context: manages hours (evidence: `src/components/admin/AdminBusinessHours.tsx`)
- Blocked dates → Fleet data context: manages dates (evidence: `src/components/admin/AdminBlockedDates.tsx`)
- Business settings → Fleet data context: saves settings (evidence: `src/components/admin/AdminSettings.tsx`)
- Vehicle editor → Fleet data context: saves vehicle (evidence: `src/components/admin/CarEditorModal.tsx`)
- Fleet data context → Supabase client: queries (evidence: `src/context/FleetContext.tsx`)
- Fleet data context → Initial fleet: uses fallback (evidence: `src/context/FleetContext.tsx`)
- Fleet data context → Supabase: reads and writes (evidence: `src/context/FleetContext.tsx`)
- Supabase client → Supabase: connects (evidence: `src/lib/supabase.ts`)
- Vehicle editor → Supabase client: uploads images (evidence: `src/components/admin/CarEditorModal.tsx`)
- Supabase client → Image storage: stores images (evidence: `src/lib/supabase.ts`)
- Fleet grid → Vehicle parser: formats vehicles (evidence: `src/components/public/FleetGrid.tsx`)
- Vehicle details → Vehicle parser: formats vehicles (evidence: `src/components/public/VehicleDetailModal.tsx`)
- Vehicle editor → Vehicle parser: serializes details (evidence: `src/components/admin/CarEditorModal.tsx`)
- Fleet management → Vehicle parser: parses vehicles (evidence: `src/components/admin/AdminCars.tsx`)
- Vehicle sharing → Rental inquiry channels: shares listing (evidence: `src/components/public/ShareVehicleModal.tsx`)
