# guneshsiripuram/crazy-cars-rental architecture

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

- Interactive diagram: https://gitdiagram.com/guneshsiripuram/crazy-cars-rental
- Repository: https://github.com/guneshsiripuram/crazy-cars-rental

## Overview

Crazy Cars Rental is a self-drive car rental website with a public fleet, gallery, location and contact experience, plus an admin CMS. Customers browse vehicles and submit booking enquiries; admins sign in to manage bookings, cars, gallery content and website settings. The main page and API routes are sampled, but several section components and the database implementation are only partially shown, so the graph omits uncertain internal wiring. Storage supports Supabase with a local JSON fallback, and image upload can use Supabase Storage.

Main entry points: [`src/app/page.tsx`](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/page.tsx) (Home Page), [`src/app/admin/page.tsx`](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/admin/page.tsx) (Admin Dashboard), [`src/lib/db.ts`](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/db.ts) (Data Access), [`src/app/api/bookings/route.ts`](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/bookings/route.ts) (Bookings API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Website"]
  node_home["Home Page<br/>[page.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_hero["Hero<br/>[Hero.tsx]"]
  node_ticker["Vehicle Ticker"]
  node_why["Why Choose Us<br/>[WhyChooseUs.tsx]"]
  node_fleet["Fleet Section<br/>[FleetSection.tsx]"]
  node_gallery["Gallery Section<br/>[GallerySection.tsx]"]
  node_location["Location"]
  node_contact["Contact Section<br/>[ContactSection.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_booking["Booking Modal<br/>[BookingModal.tsx]"]
end

subgraph group_admin["Admin CMS"]
  node_adminpage["Admin Dashboard<br/>[page.tsx]"]
end

subgraph group_api["API"]
  node_authroute["Admin Sign-in API<br/>[route.ts]"]
  node_bookingsapi["Bookings API<br/>[route.ts]"]
  node_carsapi["Cars API<br/>[route.ts]"]
  node_galleryapi["Gallery API<br/>[route.ts]"]
  node_settingsapi["Settings API<br/>[route.ts]"]
end

subgraph group_data["Data and Integrations"]
  node_authlib["Session Tokens<br/>[auth.ts]"]
  node_guard["Admin Guard<br/>[requireAdmin.ts]"]
  node_db["Data Access<br/>[db.ts]"]
  node_localdb[("JSON Store<br/>[db.json]")]
  node_supabase["Supabase<br/>[supabase.ts]"]
end

node_visitor(("Customer"))
node_storage[("Supabase Storage")]
node_adminactor(("Administrator"))

node_visitor -->|"opens"| node_home
node_home -->|"fetches cars"| node_carsapi
node_home -->|"fetches settings"| node_settingsapi
node_home -->|"fetches gallery"| node_galleryapi
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_ticker
node_home -->|"renders"| node_why
node_home -->|"renders"| node_fleet
node_home -->|"renders"| node_gallery
node_home -->|"renders"| node_location
node_home -->|"renders"| node_contact
node_home -->|"renders"| node_footer
node_home -->|"renders"| node_booking
node_ticker -->|"selects car"| node_booking
node_fleet -->|"starts booking"| node_booking
node_booking -->|"submits enquiry"| node_bookingsapi
node_adminactor -->|"uses"| node_adminpage
node_adminpage -->|"signs in"| node_authroute
node_authroute -->|"creates token"| node_authlib
node_adminpage -->|"manages cars"| node_carsapi
node_adminpage -->|"manages bookings"| node_bookingsapi
node_adminpage -->|"manages gallery"| node_galleryapi
node_adminpage -->|"manages settings"| node_settingsapi
node_adminpage -.->|"uploads images"| node_storage
node_bookingsapi -->|"checks admin"| node_guard
node_carsapi -->|"checks admin"| node_guard
node_galleryapi -->|"checks admin"| node_guard
node_settingsapi -->|"checks admin"| node_guard
node_bookingsapi -->|"reads/writes"| node_db
node_carsapi -->|"reads/writes"| node_db
node_galleryapi -->|"reads/writes"| node_db
node_settingsapi -->|"reads/writes"| node_db
node_db -->|"fallback storage"| node_localdb
node_db -.->|"uses when configured"| node_supabase
node_adminpage -->|"updates status"| node_bookingsapi

click node_home "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/page.tsx"
click node_navbar "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/Navbar.tsx"
click node_hero "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/Hero.tsx"
click node_ticker "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/LiveVehicleTicker.tsx"
click node_why "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/WhyChooseUs.tsx"
click node_fleet "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/FleetSection.tsx"
click node_gallery "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/GallerySection.tsx"
click node_location "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/LocationSection.tsx"
click node_contact "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/ContactSection.tsx"
click node_footer "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/Footer.tsx"
click node_booking "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/BookingModal.tsx"
click node_adminpage "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/admin/page.tsx"
click node_authroute "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/auth/route.ts"
click node_authlib "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/auth.ts"
click node_bookingsapi "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/bookings/route.ts"
click node_carsapi "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/cars/route.ts"
click node_galleryapi "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/gallery/route.ts"
click node_settingsapi "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/settings/route.ts"
click node_guard "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/requireAdmin.ts"
click node_db "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/db.ts"
click node_localdb "https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/data/db.json"
click node_supabase "https://github.com/guneshsiripuram/crazy-cars-rental/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_home,node_navbar,node_hero,node_ticker,node_why,node_fleet,node_gallery,node_location,node_contact,node_footer,node_booking toneBlue
class node_adminpage,node_storage toneAmber
class node_authroute,node_bookingsapi,node_carsapi,node_galleryapi,node_settingsapi toneMint
class node_authlib,node_guard,node_db,node_localdb,node_supabase toneRose
class node_visitor,node_adminactor toneIndigo
```

## Components

### Customer Website

- [Home Page](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Navigation](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Hero](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/Hero.tsx): `src/components/Hero.tsx`
- [Vehicle Ticker](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/LiveVehicleTicker.tsx): `src/components/LiveVehicleTicker.tsx`
- [Why Choose Us](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/WhyChooseUs.tsx): `src/components/WhyChooseUs.tsx`
- [Fleet Section](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/FleetSection.tsx): `src/components/FleetSection.tsx`
- [Gallery Section](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/GallerySection.tsx): `src/components/GallerySection.tsx`
- [Location](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/LocationSection.tsx): `src/components/LocationSection.tsx`
- [Contact Section](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/ContactSection.tsx): `src/components/ContactSection.tsx`
- [Footer](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Booking Modal](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/components/BookingModal.tsx): `src/components/BookingModal.tsx`

### Admin CMS

- [Admin Dashboard](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`

### API

- [Admin Sign-in API](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/auth/route.ts): `src/app/api/auth/route.ts`
- [Bookings API](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/bookings/route.ts): `src/app/api/bookings/route.ts`
- [Cars API](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/cars/route.ts): `src/app/api/cars/route.ts`
- [Gallery API](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/gallery/route.ts): `src/app/api/gallery/route.ts`
- [Settings API](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/app/api/settings/route.ts): `src/app/api/settings/route.ts`

### Data and Integrations

- [Session Tokens](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Admin Guard](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/requireAdmin.ts): `src/lib/requireAdmin.ts`
- [Data Access](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [JSON Store](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/data/db.json): `data/db.json`
- [Supabase](https://github.com/guneshsiripuram/crazy-cars-rental/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Customer**
- **Supabase Storage**
- **Administrator**

## Connections

- Customer → Home Page: opens
- Home Page → Cars API: fetches cars
- Home Page → Settings API: fetches settings
- Home Page → Gallery API: fetches gallery
- Home Page → Navigation: renders
- Home Page → Hero: renders
- Home Page → Vehicle Ticker: renders
- Home Page → Why Choose Us: renders
- Home Page → Fleet Section: renders
- Home Page → Gallery Section: renders
- Home Page → Location: renders
- Home Page → Contact Section: renders
- Home Page → Footer: renders
- Home Page → Booking Modal: renders
- Vehicle Ticker → Booking Modal: selects car
- Fleet Section → Booking Modal: starts booking
- Booking Modal → Bookings API: submits enquiry
- Administrator → Admin Dashboard: uses
- Admin Dashboard → Admin Sign-in API: signs in
- Admin Sign-in API → Session Tokens: creates token
- Admin Dashboard → Cars API: manages cars
- Admin Dashboard → Bookings API: manages bookings
- Admin Dashboard → Gallery API: manages gallery
- Admin Dashboard → Settings API: manages settings
- Admin Dashboard → Supabase Storage: uploads images
- Bookings API → Admin Guard: checks admin
- Cars API → Admin Guard: checks admin
- Gallery API → Admin Guard: checks admin
- Settings API → Admin Guard: checks admin
- Bookings API → Data Access: reads/writes
- Cars API → Data Access: reads/writes
- Gallery API → Data Access: reads/writes
- Settings API → Data Access: reads/writes
- Data Access → JSON Store: fallback storage
- Data Access → Supabase: uses when configured
- Admin Dashboard → Bookings API: updates status
