# sn1perzgg/driveo architecture

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

- Interactive diagram: https://gitdiagram.com/sn1perzgg/driveo
- Repository: https://github.com/sn1perzgg/driveo

## Overview

This is a Next.js car-rental booking frontend: visitors search vehicles, select a vehicle and dates, create a booking, then confirm payment; signed-in users can manage bookings and saved vehicles. The graph also includes account access, contact, and policy pages, plus shared API and domain layers. Some route implementations were not sampled, so their links are omitted rather than inferred; the README provides no additional product-specific capability detail.

Main entry points: [`src/lib/api.ts`](https://github.com/sn1perzgg/driveo/blob/dev/src/lib/api.ts) (API Client), [`src/hooks/useUserActions.ts`](https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useUserActions.ts) (User Actions), [`src/app/(client)/account/bookings/page.tsx`](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/bookings/page.tsx) (Booking History), [`src/app/(client)/checkout/page.tsx`](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/checkout/page.tsx) (Payment Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Vehicle Discovery"]
  node_home["Home Page<br/>[page.tsx]"]
  node_hero["Search Hero<br/>[index.tsx]"]
  node_vehicle_list["Vehicle Results<br/>[page.tsx]"]
  node_vehicle_detail["Vehicle Detail<br/>[page.tsx]"]
  node_vehicle_search["Vehicle Search<br/>[useVehicles.ts]"]
end

subgraph group_rental["Rental Management"]
  node_vehicle_booking["Booking Form<br/>[page.tsx]"]
  node_checkout["Payment Checkout<br/>[page.tsx]"]
  node_cancellation["Cancellation<br/>[page.tsx]"]
  node_booking_history["Booking History<br/>[page.tsx]"]
  node_saved_vehicles["Saved Vehicles<br/>[page.tsx]"]
  node_user_actions["User Actions<br/>[useUserActions.ts]"]
  node_create_booking["Booking Mutation"]
end

subgraph group_account["Account and Support"]
  node_contact["Contact Page<br/>[page.tsx]"]
  node_contact_mutation["Contact Mutation"]
  node_signup["Sign Up<br/>[page.tsx]"]
  node_login["Login<br/>[page.tsx]"]
  node_forgot["Password Recovery<br/>[page.tsx]"]
  node_account_page["Account Page<br/>[page.tsx]"]
  node_public_info["Policies and About<br/>[page.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_api["API Client<br/>[api.ts]"]
  node_loading["Loading View<br/>[loading.tsx]"]
  node_booking_types["Booking Types<br/>[booking.ts]"]
  node_vehicle_types["Vehicle Types<br/>[vehicle.ts]"]
  node_category_type["Category Type<br/>[category.ts]"]
  node_city_type["City Type<br/>[city.ts]"]
  node_user_type["User Type<br/>[user.ts]"]
  node_card_utils["Card Utilities<br/>[card.ts]"]
  node_date_utils["Date Utilities<br/>[dateFormat.ts]"]
  node_field_errors["Field Errors<br/>[getFieldErrors.ts]"]
  node_error_handler["Error Handler<br/>[errorHandler.ts]"]
  node_contact_items["Contact Content<br/>[contactItems.ts]"]
end

node_renter(("Renter"))
node_backend{{"Rental API"}}

node_renter -->|"opens"| node_home
node_renter -->|"browses"| node_vehicle_list
node_renter -->|"views"| node_vehicle_detail
node_renter -->|"requests rental"| node_vehicle_booking
node_renter -->|"pays booking"| node_checkout
node_renter -->|"manages bookings"| node_booking_history
node_renter -->|"views saved"| node_saved_vehicles
node_renter -->|"registers"| node_signup
node_renter -->|"signs in"| node_login
node_renter -->|"resets password"| node_forgot
node_renter -->|"contacts support"| node_contact
node_renter -->|"reads policies"| node_public_info
node_home -.->|"renders"| node_hero
node_hero -->|"fetches options"| node_api
node_vehicle_list -->|"uses search"| node_vehicle_search
node_vehicle_search -->|"searches vehicles"| node_api
node_checkout -->|"confirms payment"| node_api
node_checkout -->|"formats cards"| node_card_utils
node_booking_history -->|"loads bookings"| node_api
node_booking_history -->|"formats dates"| node_date_utils
node_booking_history -->|"uses booking data"| node_booking_types
node_cancellation -->|"updates booking"| node_api
node_user_actions -->|"mutates account"| node_api
node_user_actions -->|"uses user data"| node_user_type
node_user_actions -->|"formats errors"| node_error_handler
node_user_actions -.->|"delegates booking"| node_create_booking
node_create_booking -->|"creates booking"| node_api
node_create_booking -->|"formats errors"| node_error_handler
node_contact -->|"submits message"| node_contact_mutation
node_contact -->|"renders contact details"| node_contact_items
node_contact_mutation -->|"sends message"| node_api
node_contact_mutation -->|"formats errors"| node_error_handler
node_signup -->|"creates account"| node_api
node_signup -->|"maps field errors"| node_field_errors
node_login -->|"authenticates"| node_api
node_forgot -->|"requests reset"| node_api
node_api -->|"sends API requests"| node_backend

click node_home "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/page.tsx"
click node_hero "https://github.com/sn1perzgg/driveo/blob/dev/src/components/HeroSection/index.tsx"
click node_vehicle_list "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/vehicles/page.tsx"
click node_vehicle_detail "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/vehicles/%5Bid%5D/page.tsx"
click node_vehicle_booking "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/vehicles/%5Bid%5D/book/page.tsx"
click node_checkout "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/checkout/page.tsx"
click node_cancellation "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/checkout/cancellation/page.tsx"
click node_booking_history "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/bookings/page.tsx"
click node_saved_vehicles "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/saved/page.tsx"
click node_vehicle_search "https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useVehicles.ts"
click node_user_actions "https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useUserActions.ts"
click node_create_booking "https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useCreateBooking.ts"
click node_contact "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/contact/page.tsx"
click node_contact_mutation "https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useCreateContacts.ts"
click node_signup "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/signup/page.tsx"
click node_login "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/login/page.tsx"
click node_forgot "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/forgot/page.tsx"
click node_account_page "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/page.tsx"
click node_public_info "https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/booking-policy/page.tsx"
click node_api "https://github.com/sn1perzgg/driveo/blob/dev/src/lib/api.ts"
click node_loading "https://github.com/sn1perzgg/driveo/blob/dev/src/app/loading.tsx"
click node_booking_types "https://github.com/sn1perzgg/driveo/blob/dev/src/types/booking.ts"
click node_vehicle_types "https://github.com/sn1perzgg/driveo/blob/dev/src/types/vehicle.ts"
click node_category_type "https://github.com/sn1perzgg/driveo/blob/dev/src/types/category.ts"
click node_city_type "https://github.com/sn1perzgg/driveo/blob/dev/src/types/city.ts"
click node_user_type "https://github.com/sn1perzgg/driveo/blob/dev/src/types/user.ts"
click node_card_utils "https://github.com/sn1perzgg/driveo/blob/dev/src/utils/card.ts"
click node_date_utils "https://github.com/sn1perzgg/driveo/blob/dev/src/utils/dateFormat.ts"
click node_field_errors "https://github.com/sn1perzgg/driveo/blob/dev/src/utils/getFieldErrors.ts"
click node_error_handler "https://github.com/sn1perzgg/driveo/blob/dev/src/lib/errorHandler.ts"
click node_contact_items "https://github.com/sn1perzgg/driveo/blob/dev/constants/contactItems.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_hero,node_vehicle_list,node_vehicle_detail,node_vehicle_search toneBlue
class node_vehicle_booking,node_checkout,node_cancellation,node_booking_history,node_saved_vehicles,node_user_actions,node_create_booking toneAmber
class node_contact,node_contact_mutation,node_signup,node_login,node_forgot,node_account_page,node_public_info,node_backend toneMint
class node_api,node_loading,node_booking_types,node_vehicle_types,node_category_type,node_city_type,node_user_type,node_card_utils,node_date_utils,node_field_errors,node_error_handler,node_contact_items toneRose
class node_renter toneIndigo
```

## Components

### Vehicle Discovery

- [Home Page](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/page.tsx): `src/app/(client)/page.tsx`
- [Search Hero](https://github.com/sn1perzgg/driveo/blob/dev/src/components/HeroSection/index.tsx): `src/components/HeroSection/index.tsx`
- [Vehicle Results](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/vehicles/page.tsx): `src/app/(client)/vehicles/page.tsx`
- [Vehicle Detail](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/vehicles/%5Bid%5D/page.tsx): `src/app/(client)/vehicles/[id]/page.tsx`
- [Vehicle Search](https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useVehicles.ts): `src/hooks/useVehicles.ts`

### Rental Management

- [Booking Form](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/vehicles/%5Bid%5D/book/page.tsx): `src/app/(client)/vehicles/[id]/book/page.tsx`
- [Payment Checkout](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/checkout/page.tsx): `src/app/(client)/checkout/page.tsx`
- [Cancellation](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/checkout/cancellation/page.tsx): `src/app/(client)/checkout/cancellation/page.tsx`
- [Booking History](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/bookings/page.tsx): `src/app/(client)/account/bookings/page.tsx`
- [Saved Vehicles](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/saved/page.tsx): `src/app/(client)/account/saved/page.tsx`
- [User Actions](https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useUserActions.ts): `src/hooks/useUserActions.ts`
- [Booking Mutation](https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useCreateBooking.ts): `src/hooks/useCreateBooking.ts`

### Account and Support

- [Contact Page](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/contact/page.tsx): `src/app/(client)/contact/page.tsx`
- [Contact Mutation](https://github.com/sn1perzgg/driveo/blob/dev/src/hooks/useCreateContacts.ts): `src/hooks/useCreateContacts.ts`
- [Sign Up](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/signup/page.tsx): `src/app/(client)/signup/page.tsx`
- [Login](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/login/page.tsx): `src/app/(client)/login/page.tsx`
- [Password Recovery](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/forgot/page.tsx): `src/app/(client)/forgot/page.tsx`
- [Account Page](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/account/page.tsx): `src/app/(client)/account/page.tsx`
- [Policies and About](https://github.com/sn1perzgg/driveo/blob/dev/src/app/(client)/booking-policy/page.tsx): `src/app/(client)/booking-policy/page.tsx`

### Shared Services

- [API Client](https://github.com/sn1perzgg/driveo/blob/dev/src/lib/api.ts): `src/lib/api.ts`
- [Loading View](https://github.com/sn1perzgg/driveo/blob/dev/src/app/loading.tsx): `src/app/loading.tsx`
- [Booking Types](https://github.com/sn1perzgg/driveo/blob/dev/src/types/booking.ts): `src/types/booking.ts`
- [Vehicle Types](https://github.com/sn1perzgg/driveo/blob/dev/src/types/vehicle.ts): `src/types/vehicle.ts`
- [Category Type](https://github.com/sn1perzgg/driveo/blob/dev/src/types/category.ts): `src/types/category.ts`
- [City Type](https://github.com/sn1perzgg/driveo/blob/dev/src/types/city.ts): `src/types/city.ts`
- [User Type](https://github.com/sn1perzgg/driveo/blob/dev/src/types/user.ts): `src/types/user.ts`
- [Card Utilities](https://github.com/sn1perzgg/driveo/blob/dev/src/utils/card.ts): `src/utils/card.ts`
- [Date Utilities](https://github.com/sn1perzgg/driveo/blob/dev/src/utils/dateFormat.ts): `src/utils/dateFormat.ts`
- [Field Errors](https://github.com/sn1perzgg/driveo/blob/dev/src/utils/getFieldErrors.ts): `src/utils/getFieldErrors.ts`
- [Error Handler](https://github.com/sn1perzgg/driveo/blob/dev/src/lib/errorHandler.ts): `src/lib/errorHandler.ts`
- [Contact Content](https://github.com/sn1perzgg/driveo/blob/dev/constants/contactItems.ts): `constants/contactItems.ts`

### Other components

- **Renter**
- **Rental API**

## Connections

- Renter → Home Page: opens
- Renter → Vehicle Results: browses
- Renter → Vehicle Detail: views
- Renter → Booking Form: requests rental
- Renter → Payment Checkout: pays booking
- Renter → Booking History: manages bookings
- Renter → Saved Vehicles: views saved
- Renter → Sign Up: registers
- Renter → Login: signs in
- Renter → Password Recovery: resets password
- Renter → Contact Page: contacts support
- Renter → Policies and About: reads policies
- Home Page → Search Hero: renders
- Search Hero → API Client: fetches options (evidence: `src/components/HeroSection/index.tsx`)
- Vehicle Results → Vehicle Search: uses search (evidence: `src/app/(client)/vehicles/page.tsx`)
- Vehicle Search → API Client: searches vehicles (evidence: `src/hooks/useVehicles.ts`)
- Payment Checkout → API Client: confirms payment (evidence: `src/app/(client)/checkout/page.tsx`)
- Payment Checkout → Card Utilities: formats cards (evidence: `src/app/(client)/checkout/page.tsx`)
- Booking History → API Client: loads bookings (evidence: `src/app/(client)/account/bookings/page.tsx`)
- Booking History → Date Utilities: formats dates (evidence: `src/app/(client)/account/bookings/page.tsx`)
- Booking History → Booking Types: uses booking data (evidence: `src/app/(client)/account/bookings/page.tsx`)
- Cancellation → API Client: updates booking (evidence: `src/app/(client)/checkout/cancellation/page.tsx`)
- User Actions → API Client: mutates account (evidence: `src/hooks/useUserActions.ts`)
- User Actions → User Type: uses user data (evidence: `src/hooks/useUserActions.ts`)
- User Actions → Error Handler: formats errors (evidence: `src/hooks/useUserActions.ts`)
- User Actions → Booking Mutation: delegates booking
- Booking Mutation → API Client: creates booking (evidence: `src/hooks/useCreateBooking.ts`)
- Booking Mutation → Error Handler: formats errors (evidence: `src/hooks/useCreateBooking.ts`)
- Contact Page → Contact Mutation: submits message (evidence: `src/app/(client)/contact/page.tsx`)
- Contact Page → Contact Content: renders contact details (evidence: `src/app/(client)/contact/page.tsx`)
- Contact Mutation → API Client: sends message (evidence: `src/hooks/useCreateContacts.ts`)
- Contact Mutation → Error Handler: formats errors (evidence: `src/hooks/useCreateContacts.ts`)
- Sign Up → API Client: creates account (evidence: `src/app/(client)/signup/page.tsx`)
- Sign Up → Field Errors: maps field errors (evidence: `src/app/(client)/signup/page.tsx`)
- Login → API Client: authenticates (evidence: `src/app/(client)/login/page.tsx`)
- Password Recovery → API Client: requests reset (evidence: `src/app/(client)/forgot/page.tsx`)
- API Client → Rental API: sends API requests (evidence: `src/lib/api.ts`)
