# dhetchaiyakrith24/dive-records architecture

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

- Interactive diagram: https://gitdiagram.com/dhetchaiyakrith24/dive-records
- Repository: https://github.com/dhetchaiyakrith24/dive-records

## Overview

Dive Records is a bilingual dive-shop storefront for scuba gear, dive trips, and educational content. Shoppers enter through the localized homepage, browse or filter gear, inspect product details, then order through the configurable cart/checkout or LINE chat flow. Other branches cover product comparison, trip inquiries, policies, and video-supported learning. The graph reflects source-index references and excerpts; several pages and integrations were not sampled, so uncertain runtime links are omitted.

Main entry points: [`src/lib/catalog.ts`](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/catalog.ts) (Product catalog), [`src/app/[locale]/gear/[slug]/page.tsx`](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/%5Bslug%5D/page.tsx) (Product detail), [`src/components/CheckoutView.tsx`](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/CheckoutView.tsx) (Checkout form), [`src/components/ProductCard.tsx`](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/ProductCard.tsx) (Product cards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Homepage<br/>[page.tsx]"]
  node_gear["Gear listing<br/>[page.tsx]"]
  node_finder["Gear finder<br/>[page.tsx]"]
  node_product["Product detail<br/>[page.tsx]"]
  node_comparepage["Gear comparison<br/>[page.tsx]"]
end

subgraph group_commerce["Gear commerce"]
  node_catalog["Product catalog<br/>[catalog.ts]"]
  node_productcards["Product cards<br/>[ProductCard.tsx]"]
  node_compare["Comparison rules<br/>[compare.ts]"]
  node_cartpage["Cart page<br/>[page.tsx]"]
  node_cartview["Cart view<br/>[CartView.tsx]"]
  node_cartstate["Cart state<br/>[cart-store.ts]"]
  node_checkoutpage["Checkout page<br/>[page.tsx]"]
  node_checkoutview["Checkout form<br/>[CheckoutView.tsx]"]
  node_checkoutrules["Checkout rules<br/>[checkout.ts]"]
  node_shopsettings["Shop settings<br/>[shop.ts]"]
  node_lineorder["LINE ordering<br/>[LineOrder.tsx]"]
  node_linechat["LINE chat links<br/>[line.ts]"]
end

subgraph group_engagement["Dive and learning"]
  node_dive["Dive trips<br/>[page.tsx]"]
  node_diveask["Trip inquiry<br/>[DiveAsk.tsx]"]
  node_learn["Learning hub<br/>[page.tsx]"]
  node_article["Learning article<br/>[page.tsx]"]
  node_articles["Article content<br/>[articles.ts]"]
  node_videos["Video catalog<br/>[videos.ts]"]
  node_youtube["Video player<br/>[YouTubeLite.tsx]"]
  node_policies["Shop policies<br/>[page.tsx]"]
  node_policydata["Policy content<br/>[policies.ts]"]
end

subgraph group_platform["Shared services"]
  node_routing["Locale routing<br/>[routing.ts]"]
  node_navigation["Localized navigation<br/>[navigation.ts]"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens"| node_home
node_shopper -->|"browses"| node_gear
node_shopper -->|"explores"| node_dive
node_shopper -->|"reads"| node_learn
node_home -->|"loads picks"| node_catalog
node_home -->|"renders"| node_productcards
node_gear -->|"loads gear"| node_catalog
node_gear -->|"renders"| node_productcards
node_finder -->|"loads gear"| node_catalog
node_finder -->|"renders"| node_productcards
node_productcards -->|"reads product data"| node_catalog
node_product -->|"loads product"| node_catalog
node_product -->|"checks category"| node_compare
node_product -->|"looks up review"| node_videos
node_product -->|"renders related gear"| node_productcards
node_comparepage -->|"loads gear"| node_catalog
node_comparepage -->|"uses categories"| node_compare
node_cartpage -->|"renders"| node_cartview
node_cartpage -->|"loads cart catalog"| node_catalog
node_cartpage -->|"loads settings"| node_shopsettings
node_cartview -->|"reads cart"| node_cartstate
node_cartview -->|"calculates totals"| node_checkoutrules
node_checkoutpage -->|"renders"| node_checkoutview
node_checkoutpage -->|"loads cart catalog"| node_catalog
node_checkoutpage -->|"loads settings"| node_shopsettings
node_checkoutview -->|"reads cart"| node_cartstate
node_checkoutview -->|"quotes and validates"| node_checkoutrules
node_checkoutview -->|"renders summary"| node_cartview
node_checkoutview -->|"receives settings"| node_shopsettings
node_dive -->|"offers inquiries"| node_diveask
node_dive -->|"formats prices"| node_catalog
node_learn -->|"loads articles"| node_articles
node_learn -->|"loads videos"| node_videos
node_article -->|"loads article"| node_articles
node_article -->|"loads videos"| node_videos
node_product -->|"embeds review"| node_youtube
node_policies -->|"loads policy"| node_policydata
node_lineorder -->|"builds order link"| node_linechat
node_routing -->|"configures"| node_navigation

click node_home "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/page.tsx"
click node_gear "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/page.tsx"
click node_finder "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/finder/page.tsx"
click node_product "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/%5Bslug%5D/page.tsx"
click node_catalog "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/catalog.ts"
click node_productcards "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/ProductCard.tsx"
click node_comparepage "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/compare/%5Bcategory%5D/page.tsx"
click node_compare "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/compare.ts"
click node_cartpage "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/cart/page.tsx"
click node_cartview "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/CartView.tsx"
click node_cartstate "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/cart-store.ts"
click node_checkoutpage "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/checkout/page.tsx"
click node_checkoutview "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/CheckoutView.tsx"
click node_checkoutrules "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/checkout.ts"
click node_shopsettings "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/shop.ts"
click node_lineorder "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/LineOrder.tsx"
click node_linechat "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/line.ts"
click node_dive "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/dive/page.tsx"
click node_diveask "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/DiveAsk.tsx"
click node_learn "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/learn/page.tsx"
click node_article "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/learn/%5Bslug%5D/page.tsx"
click node_articles "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/articles.ts"
click node_videos "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/videos.ts"
click node_youtube "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/YouTubeLite.tsx"
click node_policies "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/policies/%5Bslug%5D/page.tsx"
click node_policydata "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/policies.ts"
click node_routing "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/i18n/routing.ts"
click node_navigation "https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/i18n/navigation.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_gear,node_finder,node_product,node_comparepage toneBlue
class node_catalog,node_productcards,node_compare,node_cartpage,node_cartview,node_cartstate,node_checkoutpage,node_checkoutview,node_checkoutrules,node_shopsettings,node_lineorder,node_linechat toneAmber
class node_dive,node_diveask,node_learn,node_article,node_articles,node_videos,node_youtube,node_policies,node_policydata toneMint
class node_routing,node_navigation toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Homepage](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/page.tsx): `src/app/[locale]/page.tsx`
- [Gear listing](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/page.tsx): `src/app/[locale]/gear/page.tsx`
- [Gear finder](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/finder/page.tsx): `src/app/[locale]/gear/finder/page.tsx`
- [Product detail](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/%5Bslug%5D/page.tsx): `src/app/[locale]/gear/[slug]/page.tsx`
- [Gear comparison](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/gear/compare/%5Bcategory%5D/page.tsx): `src/app/[locale]/gear/compare/[category]/page.tsx`

### Gear commerce

- [Product catalog](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/catalog.ts): `src/lib/catalog.ts`
- [Product cards](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Comparison rules](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/compare.ts): `src/lib/compare.ts`
- [Cart page](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/cart/page.tsx): `src/app/[locale]/cart/page.tsx`
- [Cart view](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/CartView.tsx): `src/components/CartView.tsx`
- [Cart state](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/cart-store.ts): `src/lib/cart-store.ts`
- [Checkout page](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/checkout/page.tsx): `src/app/[locale]/checkout/page.tsx`
- [Checkout form](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/CheckoutView.tsx): `src/components/CheckoutView.tsx`
- [Checkout rules](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/checkout.ts): `src/lib/checkout.ts`
- [Shop settings](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/shop.ts): `src/lib/shop.ts`
- [LINE ordering](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/LineOrder.tsx): `src/components/LineOrder.tsx`
- [LINE chat links](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/line.ts): `src/lib/line.ts`

### Dive and learning

- [Dive trips](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/dive/page.tsx): `src/app/[locale]/dive/page.tsx`
- [Trip inquiry](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/DiveAsk.tsx): `src/components/DiveAsk.tsx`
- [Learning hub](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/learn/page.tsx): `src/app/[locale]/learn/page.tsx`
- [Learning article](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/learn/%5Bslug%5D/page.tsx): `src/app/[locale]/learn/[slug]/page.tsx`
- [Article content](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/articles.ts): `src/lib/articles.ts`
- [Video catalog](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/videos.ts): `src/lib/videos.ts`
- [Video player](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/components/YouTubeLite.tsx): `src/components/YouTubeLite.tsx`
- [Shop policies](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/app/%5Blocale%5D/policies/%5Bslug%5D/page.tsx): `src/app/[locale]/policies/[slug]/page.tsx`
- [Policy content](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/lib/policies.ts): `src/lib/policies.ts`

### Shared services

- [Locale routing](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/i18n/routing.ts): `src/i18n/routing.ts`
- [Localized navigation](https://github.com/dhetchaiyakrith24/dive-records/blob/main/src/i18n/navigation.ts): `src/i18n/navigation.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Homepage: opens
- Shopper → Gear listing: browses
- Shopper → Dive trips: explores
- Shopper → Learning hub: reads
- Homepage → Product catalog: loads picks (evidence: `src/app/[locale]/page.tsx`)
- Homepage → Product cards: renders (evidence: `src/app/[locale]/page.tsx`)
- Gear listing → Product catalog: loads gear (evidence: `src/app/[locale]/gear/page.tsx`)
- Gear listing → Product cards: renders (evidence: `src/app/[locale]/gear/page.tsx`)
- Gear finder → Product catalog: loads gear (evidence: `src/app/[locale]/gear/finder/page.tsx`)
- Gear finder → Product cards: renders (evidence: `src/app/[locale]/gear/finder/page.tsx`)
- Product cards → Product catalog: reads product data (evidence: `src/components/ProductCard.tsx`)
- Product detail → Product catalog: loads product (evidence: `src/app/[locale]/gear/[slug]/page.tsx`)
- Product detail → Comparison rules: checks category (evidence: `src/app/[locale]/gear/[slug]/page.tsx`)
- Product detail → Video catalog: looks up review (evidence: `src/app/[locale]/gear/[slug]/page.tsx`)
- Product detail → Product cards: renders related gear (evidence: `src/app/[locale]/gear/[slug]/page.tsx`)
- Gear comparison → Product catalog: loads gear (evidence: `src/app/[locale]/gear/compare/[category]/page.tsx`)
- Gear comparison → Comparison rules: uses categories (evidence: `src/app/[locale]/gear/compare/[category]/page.tsx`)
- Cart page → Cart view: renders (evidence: `src/app/[locale]/cart/page.tsx`)
- Cart page → Product catalog: loads cart catalog (evidence: `src/app/[locale]/cart/page.tsx`)
- Cart page → Shop settings: loads settings (evidence: `src/app/[locale]/cart/page.tsx`)
- Cart view → Cart state: reads cart (evidence: `src/components/CartView.tsx`)
- Cart view → Checkout rules: calculates totals (evidence: `src/components/CartView.tsx`)
- Checkout page → Checkout form: renders (evidence: `src/app/[locale]/checkout/page.tsx`)
- Checkout page → Product catalog: loads cart catalog (evidence: `src/app/[locale]/checkout/page.tsx`)
- Checkout page → Shop settings: loads settings (evidence: `src/app/[locale]/checkout/page.tsx`)
- Checkout form → Cart state: reads cart (evidence: `src/components/CheckoutView.tsx`)
- Checkout form → Checkout rules: quotes and validates (evidence: `src/components/CheckoutView.tsx`)
- Checkout form → Cart view: renders summary (evidence: `src/components/CheckoutView.tsx`)
- Checkout form → Shop settings: receives settings (evidence: `src/components/CheckoutView.tsx`)
- Dive trips → Trip inquiry: offers inquiries (evidence: `src/app/[locale]/dive/page.tsx`)
- Dive trips → Product catalog: formats prices (evidence: `src/app/[locale]/dive/page.tsx`)
- Learning hub → Article content: loads articles (evidence: `src/app/[locale]/learn/page.tsx`)
- Learning hub → Video catalog: loads videos (evidence: `src/app/[locale]/learn/page.tsx`)
- Learning article → Article content: loads article (evidence: `src/app/[locale]/learn/[slug]/page.tsx`)
- Learning article → Video catalog: loads videos (evidence: `src/app/[locale]/learn/[slug]/page.tsx`)
- Product detail → Video player: embeds review (evidence: `src/app/[locale]/gear/[slug]/page.tsx`)
- Shop policies → Policy content: loads policy (evidence: `src/app/[locale]/policies/[slug]/page.tsx`)
- LINE ordering → LINE chat links: builds order link (evidence: `src/components/LineOrder.tsx`)
- Locale routing → Localized navigation: configures (evidence: `src/i18n/navigation.ts`)
