# dhruval12098/hod architecture

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

- Interactive diagram: https://gitdiagram.com/dhruval12098/hod
- Repository: https://github.com/dhruval12098/hod

## Overview

House of Diams is a jewellery commerce storefront with product discovery, configurable products, cart, checkout, customer accounts, and editorial and brand content. The checkout excerpts establish order preparation, payment creation, verification, and finalization; the tree identifies wider storefront and content capabilities. Several page and API implementations were not sampled, so uncertain wiring between them is omitted.

Main entry points: [`lib/razorpay.ts`](https://github.com/dhruval12098/hod/blob/main/lib/razorpay.ts) (Razorpay integration), [`lib/server-supabase.ts`](https://github.com/dhruval12098/hod/blob/main/lib/server-supabase.ts) (Supabase data and auth), [`app/api/checkout/place/route.ts`](https://github.com/dhruval12098/hod/blob/main/app/api/checkout/place/route.ts) (Place order), [`app/api/payments/verify/route.ts`](https://github.com/dhruval12098/hod/blob/main/app/api/payments/verify/route.ts) (Payment verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home storefront<br/>[page.tsx]"]
  node_cart["Cart<br/>[page.tsx]"]
  node_cart_api["Cart API<br/>[route.ts]"]
end

subgraph group_catalog["Product discovery"]
  node_shop["Shop and categories<br/>[page.tsx]"]
  node_category["Category pages"]
  node_product["Product detail<br/>[page.tsx]"]
  node_product_ui["Product configurator"]
  node_catalog_api["Product APIs<br/>[route.ts]"]
  node_search_api["Search and recommendations<br/>[route.ts]"]
end

subgraph group_checkout["Checkout and payments"]
  node_checkout_ui["Checkout flow"]
  node_place["Place order<br/>[route.ts]"]
  node_order_logic["Order preparation<br/>[checkout-order.ts]"]
  node_pricing["Checkout pricing"]
  node_razorpay["Razorpay integration<br/>[razorpay.ts]"]
  node_payment_verify["Payment verification<br/>[route.ts]"]
  node_webhook["Payment webhook<br/>[route.ts]"]
  node_payment_recovery["Payment recovery"]
  node_confirmation["Order confirmation<br/>[route.ts]"]
end

subgraph group_account["Customer accounts"]
  node_profile["Profile and orders<br/>[route.ts]"]
  node_auth_ui["Sign-in and profile UI<br/>[AuthForm.tsx]"]
end

subgraph group_content["Brand and editorial"]
  node_brand_content["Brand and bespoke<br/>[page.tsx]"]
  node_editorial["Blog and education<br/>[page.tsx]"]
  node_contact["Contact and enquiries<br/>[route.ts]"]
end

node_shopper(("Shopper"))
node_supabase[("Supabase data and auth<br/>[server-supabase.ts]")]
node_razorpay_service{{"Razorpay"}}

node_shopper -->|"browses"| node_home
node_shopper -->|"explores"| node_shop
node_shopper -->|"filters"| node_category
node_shopper -->|"views"| node_product
node_shopper -->|"manages"| node_cart
node_shopper -->|"checks out"| node_checkout_ui
node_shopper -->|"signs in"| node_auth_ui
node_shopper -->|"learns about"| node_brand_content
node_shopper -->|"reads"| node_editorial
node_product -->|"configures"| node_product_ui
node_place -->|"prepares order"| node_order_logic
node_place -->|"prepares quote"| node_pricing
node_place -->|"records attempt"| node_supabase
node_place -->|"creates payment order"| node_razorpay
node_razorpay -->|"calls"| node_razorpay_service
node_payment_verify -->|"verifies and captures"| node_razorpay
node_payment_verify -->|"finalizes payment"| node_order_logic
node_payment_verify -->|"recovers capture"| node_payment_recovery
node_payment_verify -->|"checks order"| node_supabase
node_webhook -->|"verifies and captures"| node_razorpay
node_webhook -->|"finalizes payment"| node_order_logic
node_webhook -->|"recovers capture"| node_payment_recovery
node_webhook -->|"records events"| node_supabase
node_confirmation -->|"checks payment"| node_razorpay
node_confirmation -->|"finalizes payment"| node_order_logic
node_confirmation -->|"reads order details"| node_supabase
node_profile -->|"reads and updates profile"| node_supabase

click node_home "https://github.com/dhruval12098/hod/blob/main/app/page.tsx"
click node_shop "https://github.com/dhruval12098/hod/blob/main/app/shop/page.tsx"
click node_category "https://github.com/dhruval12098/hod/blob/main/app/%5BcategorySlug%5D/CategoryCollectionPageContent.tsx"
click node_product "https://github.com/dhruval12098/hod/blob/main/app/shop/%5Bslug%5D/page.tsx"
click node_product_ui "https://github.com/dhruval12098/hod/blob/main/components/product/ProductConfigurator.jsx"
click node_catalog_api "https://github.com/dhruval12098/hod/blob/main/app/api/public/products/route.ts"
click node_search_api "https://github.com/dhruval12098/hod/blob/main/app/api/public/products/search/route.ts"
click node_cart "https://github.com/dhruval12098/hod/blob/main/app/cart/page.tsx"
click node_cart_api "https://github.com/dhruval12098/hod/blob/main/app/api/public/products/cart/route.ts"
click node_checkout_ui "https://github.com/dhruval12098/hod/blob/main/components/checkout/CheckoutPageClient.tsx"
click node_place "https://github.com/dhruval12098/hod/blob/main/app/api/checkout/place/route.ts"
click node_order_logic "https://github.com/dhruval12098/hod/blob/main/lib/checkout-order.ts"
click node_pricing "https://github.com/dhruval12098/hod/blob/main/lib/checkout-pricing.ts"
click node_razorpay "https://github.com/dhruval12098/hod/blob/main/lib/razorpay.ts"
click node_payment_verify "https://github.com/dhruval12098/hod/blob/main/app/api/payments/verify/route.ts"
click node_webhook "https://github.com/dhruval12098/hod/blob/main/app/api/payments/webhook/route.ts"
click node_payment_recovery "https://github.com/dhruval12098/hod/blob/main/lib/payment-recovery.ts"
click node_confirmation "https://github.com/dhruval12098/hod/blob/main/app/api/checkout/success/route.ts"
click node_supabase "https://github.com/dhruval12098/hod/blob/main/lib/server-supabase.ts"
click node_profile "https://github.com/dhruval12098/hod/blob/main/app/api/profile/route.ts"
click node_auth_ui "https://github.com/dhruval12098/hod/blob/main/components/auth/AuthForm.tsx"
click node_brand_content "https://github.com/dhruval12098/hod/blob/main/app/bespoke/page.tsx"
click node_editorial "https://github.com/dhruval12098/hod/blob/main/app/blog/page.tsx"
click node_contact "https://github.com/dhruval12098/hod/blob/main/app/api/public/contact/submit/route.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_cart,node_cart_api toneBlue
class node_shop,node_category,node_product,node_product_ui,node_catalog_api,node_search_api,node_supabase toneAmber
class node_checkout_ui,node_place,node_order_logic,node_pricing,node_razorpay,node_payment_verify,node_webhook,node_payment_recovery,node_confirmation toneMint
class node_profile,node_auth_ui toneRose
class node_brand_content,node_editorial,node_contact,node_shopper,node_razorpay_service toneIndigo
```

## Components

### Storefront

- [Home storefront](https://github.com/dhruval12098/hod/blob/main/app/page.tsx): `app/page.tsx`
- [Cart](https://github.com/dhruval12098/hod/blob/main/app/cart/page.tsx): `app/cart/page.tsx`
- [Cart API](https://github.com/dhruval12098/hod/blob/main/app/api/public/products/cart/route.ts): `app/api/public/products/cart/route.ts`

### Product discovery

- [Shop and categories](https://github.com/dhruval12098/hod/blob/main/app/shop/page.tsx): `app/shop/page.tsx`
- [Category pages](https://github.com/dhruval12098/hod/blob/main/app/%5BcategorySlug%5D/CategoryCollectionPageContent.tsx): `app/[categorySlug]/CategoryCollectionPageContent.tsx`
- [Product detail](https://github.com/dhruval12098/hod/blob/main/app/shop/%5Bslug%5D/page.tsx): `app/shop/[slug]/page.tsx`
- [Product configurator](https://github.com/dhruval12098/hod/blob/main/components/product/ProductConfigurator.jsx): `components/product/ProductConfigurator.jsx`
- [Product APIs](https://github.com/dhruval12098/hod/blob/main/app/api/public/products/route.ts): `app/api/public/products/route.ts`
- [Search and recommendations](https://github.com/dhruval12098/hod/blob/main/app/api/public/products/search/route.ts): `app/api/public/products/search/route.ts`

### Checkout and payments

- [Checkout flow](https://github.com/dhruval12098/hod/blob/main/components/checkout/CheckoutPageClient.tsx): `components/checkout/CheckoutPageClient.tsx`
- [Place order](https://github.com/dhruval12098/hod/blob/main/app/api/checkout/place/route.ts): `app/api/checkout/place/route.ts`
- [Order preparation](https://github.com/dhruval12098/hod/blob/main/lib/checkout-order.ts): `lib/checkout-order.ts`
- [Checkout pricing](https://github.com/dhruval12098/hod/blob/main/lib/checkout-pricing.ts): `lib/checkout-pricing.ts`
- [Razorpay integration](https://github.com/dhruval12098/hod/blob/main/lib/razorpay.ts): `lib/razorpay.ts`
- [Payment verification](https://github.com/dhruval12098/hod/blob/main/app/api/payments/verify/route.ts): `app/api/payments/verify/route.ts`
- [Payment webhook](https://github.com/dhruval12098/hod/blob/main/app/api/payments/webhook/route.ts): `app/api/payments/webhook/route.ts`
- [Payment recovery](https://github.com/dhruval12098/hod/blob/main/lib/payment-recovery.ts): `lib/payment-recovery.ts`
- [Order confirmation](https://github.com/dhruval12098/hod/blob/main/app/api/checkout/success/route.ts): `app/api/checkout/success/route.ts`

### Customer accounts

- [Profile and orders](https://github.com/dhruval12098/hod/blob/main/app/api/profile/route.ts): `app/api/profile/route.ts`
- [Sign-in and profile UI](https://github.com/dhruval12098/hod/blob/main/components/auth/AuthForm.tsx): `components/auth/AuthForm.tsx`

### Brand and editorial

- [Brand and bespoke](https://github.com/dhruval12098/hod/blob/main/app/bespoke/page.tsx): `app/bespoke/page.tsx`
- [Blog and education](https://github.com/dhruval12098/hod/blob/main/app/blog/page.tsx): `app/blog/page.tsx`
- [Contact and enquiries](https://github.com/dhruval12098/hod/blob/main/app/api/public/contact/submit/route.ts): `app/api/public/contact/submit/route.ts`

### Other components

- **Shopper**
- [Supabase data and auth](https://github.com/dhruval12098/hod/blob/main/lib/server-supabase.ts): `lib/server-supabase.ts`
- **Razorpay**

## Connections

- Shopper → Home storefront: browses
- Shopper → Shop and categories: explores
- Shopper → Category pages: filters
- Shopper → Product detail: views
- Shopper → Cart: manages
- Shopper → Checkout flow: checks out
- Shopper → Sign-in and profile UI: signs in
- Shopper → Brand and bespoke: learns about
- Shopper → Blog and education: reads
- Product detail → Product configurator: configures
- Place order → Order preparation: prepares order
- Place order → Checkout pricing: prepares quote
- Place order → Supabase data and auth: records attempt
- Place order → Razorpay integration: creates payment order
- Razorpay integration → Razorpay: calls
- Payment verification → Razorpay integration: verifies and captures
- Payment verification → Order preparation: finalizes payment
- Payment verification → Payment recovery: recovers capture
- Payment verification → Supabase data and auth: checks order
- Payment webhook → Razorpay integration: verifies and captures
- Payment webhook → Order preparation: finalizes payment
- Payment webhook → Payment recovery: recovers capture
- Payment webhook → Supabase data and auth: records events
- Order confirmation → Razorpay integration: checks payment
- Order confirmation → Order preparation: finalizes payment
- Order confirmation → Supabase data and auth: reads order details
- Profile and orders → Supabase data and auth: reads and updates profile
