# dream-kid-342/canon-motors architecture

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

- Interactive diagram: https://gitdiagram.com/dream-kid-342/canon-motors
- Repository: https://github.com/dream-kid-342/canon-motors

## Overview

This is a Canon Motors vehicle-import showcase and enquiry site, despite the generic README title. Visitors discover inventory from the home page, browse or filter listings, inspect vehicle details, save favourites, and contact the business; supporting pages explain categories, makes, and the import process. The graph separates routes, shared site components, inventory/contact logic, and runtime support. Relationships are based on excerpts and SOURCE INDEX references; unsampled route behavior is represented only where the index or route tree supports it.

Main entry points: [`src/components/site/PageHeader.tsx`](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/PageHeader.tsx) (Page heading), [`src/lib/business.ts`](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/business.ts) (Business contact links), [`src/routes/index.tsx`](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/index.tsx) (Home and discovery), [`src/lib/inventory.ts`](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/inventory.ts) (Inventory adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Site routes"]
  node_root["Shared site shell<br/>[__root.tsx]"]
  node_home["Home and discovery<br/>[index.tsx]"]
  node_vehicle_list["Vehicle listings<br/>[vehicles.index.tsx]"]
  node_vehicle_detail["Vehicle detail<br/>[vehicles.$id.tsx]"]
  node_favourites_page["Saved vehicles<br/>[favourites.tsx]"]
  node_categories["Categories<br/>[categories.tsx]"]
  node_makes["Makes<br/>[makes.tsx]"]
  node_contact_page["Contact page<br/>[contact.tsx]"]
  node_about["About page<br/>[about.tsx]"]
  node_import_guide["Importing guide"]
end

subgraph group_presentation["Site presentation"]
  node_site_header["Navigation header<br/>[SiteHeader.tsx]"]
  node_site_footer["Site footer<br/>[SiteFooter.tsx]"]
  node_page_header["Page heading<br/>[PageHeader.tsx]"]
  node_vehicle_card["Vehicle card<br/>[VehicleCard.tsx]"]
  node_enquiry_form["Enquiry form<br/>[EnquiryForm.tsx]"]
  node_ui_controls["UI controls<br/>[button.tsx]"]
  node_mobile_sheet["Mobile sheet<br/>[sheet.tsx]"]
end

subgraph group_domain["Inventory and contact"]
  node_inventory["Inventory adapter<br/>[inventory.ts]"]
  node_favourites["Favourites state<br/>[favourites.ts]"]
  node_business["Business contact links<br/>[business.ts]"]
end

subgraph group_runtime["App runtime"]
  node_router["Router setup<br/>[router.tsx]"]
  node_route_tree["Route registry<br/>[routeTree.gen.ts]"]
  node_server["Server entry<br/>[server.ts]"]
  node_error_capture["Error capture<br/>[error-capture.ts]"]
  node_error_page["Error response<br/>[error-page.ts]"]
end

node_visitor(("Visitor"))
node_whatsapp(("WhatsApp"))
node_email(("Email client"))

node_visitor -->|"opens site"| node_router
node_router -->|"uses routes"| node_route_tree
node_route_tree -->|"registers routes"| node_root
node_visitor -->|"browses"| node_home
node_visitor -.->|"browses"| node_vehicle_list
node_visitor -->|"opens listing"| node_vehicle_detail
node_root -->|"renders"| node_site_header
node_root -->|"renders"| node_site_footer
node_home -->|"reads listings"| node_inventory
node_home -->|"renders"| node_vehicle_card
node_home -->|"renders"| node_enquiry_form
node_home -->|"uses contact links"| node_business
node_vehicle_list -->|"filters listings"| node_inventory
node_vehicle_list -->|"renders"| node_vehicle_card
node_vehicle_detail -->|"looks up vehicle"| node_inventory
node_vehicle_detail -->|"renders related vehicle"| node_vehicle_card
node_vehicle_detail -->|"renders enquiry"| node_enquiry_form
node_vehicle_detail -->|"uses contact details"| node_business
node_favourites_page -->|"reads saved IDs"| node_favourites
node_favourites_page -->|"resolves vehicles"| node_inventory
node_favourites_page -->|"renders"| node_vehicle_card
node_categories -->|"counts categories"| node_inventory
node_makes -->|"counts makes"| node_inventory
node_contact_page -->|"renders enquiry"| node_enquiry_form
node_contact_page -->|"shows contacts"| node_business
node_home -->|"uses guide steps"| node_page_header
node_about -->|"renders heading"| node_page_header
node_categories -->|"renders heading"| node_page_header
node_makes -->|"renders heading"| node_page_header
node_contact_page -->|"renders heading"| node_page_header
node_favourites_page -->|"renders heading"| node_page_header
node_vehicle_list -->|"renders heading"| node_page_header
node_import_guide -->|"renders heading"| node_page_header
node_site_header -->|"reads saved IDs"| node_favourites
node_site_header -->|"uses phone link"| node_business
node_site_header -->|"uses buttons"| node_ui_controls
node_vehicle_card -->|"formats vehicle"| node_inventory
node_vehicle_card -->|"toggles saved state"| node_favourites
node_enquiry_form -->|"builds message links"| node_business
node_enquiry_form -->|"uses buttons"| node_ui_controls
node_business -->|"opens chat link"| node_whatsapp
node_business -->|"opens mail link"| node_email
node_server -->|"uses capture"| node_error_capture
node_server -->|"uses error response"| node_error_page
node_mobile_sheet -.->|"supports sidebar"| node_ui_controls

click node_router "https://github.com/dream-kid-342/canon-motors/blob/main/src/router.tsx"
click node_route_tree "https://github.com/dream-kid-342/canon-motors/blob/main/src/routeTree.gen.ts"
click node_root "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/__root.tsx"
click node_home "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/index.tsx"
click node_vehicle_list "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/vehicles.index.tsx"
click node_vehicle_detail "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/vehicles.%24id.tsx"
click node_favourites_page "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/favourites.tsx"
click node_categories "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/categories.tsx"
click node_makes "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/makes.tsx"
click node_contact_page "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/contact.tsx"
click node_about "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/about.tsx"
click node_import_guide "https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/how-importing-works.tsx"
click node_site_header "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/SiteHeader.tsx"
click node_site_footer "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/SiteFooter.tsx"
click node_page_header "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/PageHeader.tsx"
click node_vehicle_card "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/VehicleCard.tsx"
click node_enquiry_form "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/EnquiryForm.tsx"
click node_ui_controls "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/ui/button.tsx"
click node_mobile_sheet "https://github.com/dream-kid-342/canon-motors/blob/main/src/components/ui/sheet.tsx"
click node_inventory "https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/inventory.ts"
click node_favourites "https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/favourites.ts"
click node_business "https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/business.ts"
click node_server "https://github.com/dream-kid-342/canon-motors/blob/main/src/server.ts"
click node_error_capture "https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/error-capture.ts"
click node_error_page "https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/error-page.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_root,node_home,node_vehicle_list,node_vehicle_detail,node_favourites_page,node_categories,node_makes,node_contact_page,node_about,node_import_guide,node_email toneBlue
class node_site_header,node_site_footer,node_page_header,node_vehicle_card,node_enquiry_form,node_ui_controls,node_mobile_sheet toneAmber
class node_inventory,node_favourites,node_business toneMint
class node_router,node_route_tree,node_server,node_error_capture,node_error_page toneRose
class node_visitor,node_whatsapp toneIndigo
```

## Components

### Site routes

- [Shared site shell](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Home and discovery](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Vehicle listings](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/vehicles.index.tsx): `src/routes/vehicles.index.tsx`
- [Vehicle detail](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/vehicles.%24id.tsx): `src/routes/vehicles.$id.tsx`
- [Saved vehicles](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/favourites.tsx): `src/routes/favourites.tsx`
- [Categories](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/categories.tsx): `src/routes/categories.tsx`
- [Makes](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/makes.tsx): `src/routes/makes.tsx`
- [Contact page](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/contact.tsx): `src/routes/contact.tsx`
- [About page](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/about.tsx): `src/routes/about.tsx`
- [Importing guide](https://github.com/dream-kid-342/canon-motors/blob/main/src/routes/how-importing-works.tsx): `src/routes/how-importing-works.tsx`

### Site presentation

- [Navigation header](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/SiteHeader.tsx): `src/components/site/SiteHeader.tsx`
- [Site footer](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/SiteFooter.tsx): `src/components/site/SiteFooter.tsx`
- [Page heading](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/PageHeader.tsx): `src/components/site/PageHeader.tsx`
- [Vehicle card](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/VehicleCard.tsx): `src/components/site/VehicleCard.tsx`
- [Enquiry form](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/site/EnquiryForm.tsx): `src/components/site/EnquiryForm.tsx`
- [UI controls](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Mobile sheet](https://github.com/dream-kid-342/canon-motors/blob/main/src/components/ui/sheet.tsx): `src/components/ui/sheet.tsx`

### Inventory and contact

- [Inventory adapter](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/inventory.ts): `src/lib/inventory.ts`
- [Favourites state](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/favourites.ts): `src/lib/favourites.ts`
- [Business contact links](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/business.ts): `src/lib/business.ts`

### App runtime

- [Router setup](https://github.com/dream-kid-342/canon-motors/blob/main/src/router.tsx): `src/router.tsx`
- [Route registry](https://github.com/dream-kid-342/canon-motors/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Server entry](https://github.com/dream-kid-342/canon-motors/blob/main/src/server.ts): `src/server.ts`
- [Error capture](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Error response](https://github.com/dream-kid-342/canon-motors/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`

### Other components

- **Visitor**
- **WhatsApp**
- **Email client**

## Connections

- Visitor → Router setup: opens site (evidence: `src/router.tsx`)
- Router setup → Route registry: uses routes (evidence: `src/router.tsx`)
- Route registry → Shared site shell: registers routes (evidence: `src/routeTree.gen.ts`)
- Visitor → Home and discovery: browses (evidence: `src/routes/index.tsx`)
- Visitor → Vehicle listings: browses
- Visitor → Vehicle detail: opens listing
- Shared site shell → Navigation header: renders (evidence: `src/routes/__root.tsx`)
- Shared site shell → Site footer: renders (evidence: `src/routes/__root.tsx`)
- Home and discovery → Inventory adapter: reads listings (evidence: `src/routes/index.tsx`)
- Home and discovery → Vehicle card: renders (evidence: `src/routes/index.tsx`)
- Home and discovery → Enquiry form: renders (evidence: `src/routes/index.tsx`)
- Home and discovery → Business contact links: uses contact links (evidence: `src/routes/index.tsx`)
- Vehicle listings → Inventory adapter: filters listings (evidence: `src/routes/vehicles.index.tsx`)
- Vehicle listings → Vehicle card: renders (evidence: `src/routes/vehicles.index.tsx`)
- Vehicle detail → Inventory adapter: looks up vehicle (evidence: `src/routes/vehicles.$id.tsx`)
- Vehicle detail → Vehicle card: renders related vehicle (evidence: `src/routes/vehicles.$id.tsx`)
- Vehicle detail → Enquiry form: renders enquiry (evidence: `src/routes/vehicles.$id.tsx`)
- Vehicle detail → Business contact links: uses contact details (evidence: `src/routes/vehicles.$id.tsx`)
- Saved vehicles → Favourites state: reads saved IDs (evidence: `src/routes/favourites.tsx`)
- Saved vehicles → Inventory adapter: resolves vehicles (evidence: `src/routes/favourites.tsx`)
- Saved vehicles → Vehicle card: renders (evidence: `src/routes/favourites.tsx`)
- Categories → Inventory adapter: counts categories (evidence: `src/routes/categories.tsx`)
- Makes → Inventory adapter: counts makes (evidence: `src/routes/makes.tsx`)
- Contact page → Enquiry form: renders enquiry (evidence: `src/routes/contact.tsx`)
- Contact page → Business contact links: shows contacts (evidence: `src/routes/contact.tsx`)
- Home and discovery → Page heading: uses guide steps (evidence: `src/routes/index.tsx`)
- About page → Page heading: renders heading (evidence: `src/routes/about.tsx`)
- Categories → Page heading: renders heading (evidence: `src/routes/categories.tsx`)
- Makes → Page heading: renders heading (evidence: `src/routes/makes.tsx`)
- Contact page → Page heading: renders heading (evidence: `src/routes/contact.tsx`)
- Saved vehicles → Page heading: renders heading (evidence: `src/routes/favourites.tsx`)
- Vehicle listings → Page heading: renders heading (evidence: `src/routes/vehicles.index.tsx`)
- Importing guide → Page heading: renders heading (evidence: `src/routes/how-importing-works.tsx`)
- Navigation header → Favourites state: reads saved IDs (evidence: `src/components/site/SiteHeader.tsx`)
- Navigation header → Business contact links: uses phone link (evidence: `src/components/site/SiteHeader.tsx`)
- Navigation header → UI controls: uses buttons (evidence: `src/components/site/SiteHeader.tsx`)
- Vehicle card → Inventory adapter: formats vehicle (evidence: `src/components/site/VehicleCard.tsx`)
- Vehicle card → Favourites state: toggles saved state (evidence: `src/components/site/VehicleCard.tsx`)
- Enquiry form → Business contact links: builds message links (evidence: `src/components/site/EnquiryForm.tsx`)
- Enquiry form → UI controls: uses buttons (evidence: `src/components/site/EnquiryForm.tsx`)
- Business contact links → WhatsApp: opens chat link
- Business contact links → Email client: opens mail link
- Server entry → Error capture: uses capture (evidence: `src/server.ts`)
- Server entry → Error response: uses error response (evidence: `src/server.ts`)
- Mobile sheet → UI controls: supports sidebar
