# kiranwnr98/sliverhub architecture

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

- Interactive diagram: https://gitdiagram.com/kiranwnr98/sliverhub
- Repository: https://github.com/kiranwnr98/sliverhub

## Overview

This repository is a React jewellery storefront: shoppers browse collections and products, save favourites, manage a cart, and see a live silver-rate widget on the home page. The graph follows the routed app through its shared layout to the main shopping stages, then shows product data and cart/wishlist state. It also preserves the standalone product-detail and checkout pages present in the tree, though the sampled router does not register them and checkout is only a placeholder. Source excerpts establish the main calls; unsampled subsystem links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/kiranwnr98/sliverhub/blob/main/src/App.tsx) (App Router), [`src/pages/Home.tsx`](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Home.tsx) (Home Page), [`src/components/ProductCard.tsx`](https://github.com/kiranwnr98/sliverhub/blob/main/src/components/ProductCard.tsx) (Product Card), [`src/pages/Wishlist.tsx`](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Wishlist.tsx) (Wishlist Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_entry["React Entry<br/>[main.tsx]"]
  node_app_router["App Router<br/>[App.tsx]"]
  node_main_layout["Main Layout<br/>[MainLayout.tsx]"]
end

subgraph group_catalog["Storefront Browsing"]
  node_home["Home Page<br/>[Home.tsx]"]
  node_shop["Shop Page<br/>[Shop.tsx]"]
  node_collections["Collections Page<br/>[Collections.tsx]"]
  node_new_arrivals["New Arrivals<br/>[NewArrivals.tsx]"]
  node_about["About Page<br/>[About.tsx]"]
  node_product_details["Product Details<br/>[ProductDetails.tsx]"]
  node_product_card["Product Card<br/>[ProductCard.tsx]"]
  node_category_card["Category Card<br/>[CategoryCard.tsx]"]
  node_product_data["Product Data<br/>[products.ts]"]
  node_collection_data["Collection Data<br/>[collections.ts]"]
  node_category_data["Category Data<br/>[categories.ts]"]
end

subgraph group_shopping["Shopping State"]
  node_cart["Cart Page<br/>[Cart.tsx]"]
  node_wishlist["Wishlist Page<br/>[Wishlist.tsx]"]
  node_cart_state["Cart State<br/>[CartContext.tsx]"]
  node_wishlist_state["Wishlist State"]
  node_checkout["Checkout Placeholder<br/>[Checkout.tsx]"]
end

subgraph group_market["Market Rate"]
  node_silver_hook["Silver Rate Hook<br/>[useSilverRate.ts]"]
  node_silver_widget["Silver Rate Widget"]
  node_silver_function["Rate Function<br/>[silver-rate.mjs]"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens storefront"| node_entry
node_entry -->|"renders app"| node_app_router
node_app_router -->|"wraps routes"| node_main_layout
node_app_router -->|"routes to"| node_home
node_app_router -->|"routes to"| node_shop
node_app_router -->|"routes to"| node_collections
node_app_router -->|"routes to"| node_new_arrivals
node_app_router -->|"routes to"| node_about
node_app_router -->|"routes to"| node_cart
node_app_router -->|"routes to"| node_wishlist
node_home -->|"renders products"| node_product_card
node_shop -->|"renders products"| node_product_card
node_new_arrivals -->|"renders products"| node_product_card
node_wishlist -->|"renders products"| node_product_card
node_collections -->|"renders categories"| node_category_card
node_home -->|"reads products"| node_product_data
node_home -->|"reads arrivals"| node_collection_data
node_shop -->|"reads products"| node_product_data
node_new_arrivals -->|"reads arrivals"| node_collection_data
node_collections -->|"reads categories"| node_category_data
node_wishlist -->|"reads products"| node_product_data
node_wishlist -->|"reads arrivals"| node_collection_data
node_product_details -->|"updates cart"| node_cart_state
node_product_details -->|"updates wishlist"| node_wishlist_state
node_product_card -->|"updates cart"| node_cart_state
node_product_card -->|"updates wishlist"| node_wishlist_state
node_cart -->|"reads and updates"| node_cart_state
node_wishlist -->|"reads wishlist"| node_wishlist_state
node_home -->|"fetches rate"| node_silver_hook
node_home -->|"renders rate"| node_silver_widget
node_silver_hook -->|"fetches endpoint"| node_silver_function

click node_entry "https://github.com/kiranwnr98/sliverhub/blob/main/src/main.tsx"
click node_app_router "https://github.com/kiranwnr98/sliverhub/blob/main/src/App.tsx"
click node_main_layout "https://github.com/kiranwnr98/sliverhub/blob/main/src/layouts/MainLayout.tsx"
click node_home "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Home.tsx"
click node_shop "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Shop.tsx"
click node_collections "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Collections.tsx"
click node_new_arrivals "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/NewArrivals.tsx"
click node_about "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/About.tsx"
click node_product_details "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/ProductDetails.tsx"
click node_product_card "https://github.com/kiranwnr98/sliverhub/blob/main/src/components/ProductCard.tsx"
click node_category_card "https://github.com/kiranwnr98/sliverhub/blob/main/src/components/CategoryCard.tsx"
click node_product_data "https://github.com/kiranwnr98/sliverhub/blob/main/src/data/products.ts"
click node_collection_data "https://github.com/kiranwnr98/sliverhub/blob/main/src/data/collections.ts"
click node_category_data "https://github.com/kiranwnr98/sliverhub/blob/main/src/data/categories.ts"
click node_cart "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Cart.tsx"
click node_wishlist "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Wishlist.tsx"
click node_cart_state "https://github.com/kiranwnr98/sliverhub/blob/main/src/context/CartContext.tsx"
click node_wishlist_state "https://github.com/kiranwnr98/sliverhub/blob/main/src/context/WishlistContext.tsx"
click node_checkout "https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Checkout.tsx"
click node_silver_hook "https://github.com/kiranwnr98/sliverhub/blob/main/src/hooks/useSilverRate.ts"
click node_silver_widget "https://github.com/kiranwnr98/sliverhub/blob/main/src/components/SilverRateWidget.tsx"
click node_silver_function "https://github.com/kiranwnr98/sliverhub/blob/main/netlify/functions/silver-rate.mjs"

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_entry,node_app_router,node_main_layout toneBlue
class node_home,node_shop,node_collections,node_new_arrivals,node_about,node_product_details,node_product_card,node_category_card,node_product_data,node_collection_data,node_category_data toneAmber
class node_cart,node_wishlist,node_cart_state,node_wishlist_state,node_checkout toneMint
class node_silver_hook,node_silver_widget,node_silver_function toneRose
class node_shopper toneIndigo
```

## Components

### Application Shell

- [React Entry](https://github.com/kiranwnr98/sliverhub/blob/main/src/main.tsx): `src/main.tsx`
- [App Router](https://github.com/kiranwnr98/sliverhub/blob/main/src/App.tsx): `src/App.tsx`
- [Main Layout](https://github.com/kiranwnr98/sliverhub/blob/main/src/layouts/MainLayout.tsx): `src/layouts/MainLayout.tsx`

### Storefront Browsing

- [Home Page](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Shop Page](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Shop.tsx): `src/pages/Shop.tsx`
- [Collections Page](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Collections.tsx): `src/pages/Collections.tsx`
- [New Arrivals](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/NewArrivals.tsx): `src/pages/NewArrivals.tsx`
- [About Page](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/About.tsx): `src/pages/About.tsx`
- [Product Details](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/ProductDetails.tsx): `src/pages/ProductDetails.tsx`
- [Product Card](https://github.com/kiranwnr98/sliverhub/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Category Card](https://github.com/kiranwnr98/sliverhub/blob/main/src/components/CategoryCard.tsx): `src/components/CategoryCard.tsx`
- [Product Data](https://github.com/kiranwnr98/sliverhub/blob/main/src/data/products.ts): `src/data/products.ts`
- [Collection Data](https://github.com/kiranwnr98/sliverhub/blob/main/src/data/collections.ts): `src/data/collections.ts`
- [Category Data](https://github.com/kiranwnr98/sliverhub/blob/main/src/data/categories.ts): `src/data/categories.ts`

### Shopping State

- [Cart Page](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Cart.tsx): `src/pages/Cart.tsx`
- [Wishlist Page](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Wishlist.tsx): `src/pages/Wishlist.tsx`
- [Cart State](https://github.com/kiranwnr98/sliverhub/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Wishlist State](https://github.com/kiranwnr98/sliverhub/blob/main/src/context/WishlistContext.tsx): `src/context/WishlistContext.tsx`
- [Checkout Placeholder](https://github.com/kiranwnr98/sliverhub/blob/main/src/pages/Checkout.tsx): `src/pages/Checkout.tsx`

### Market Rate

- [Silver Rate Hook](https://github.com/kiranwnr98/sliverhub/blob/main/src/hooks/useSilverRate.ts): `src/hooks/useSilverRate.ts`
- [Silver Rate Widget](https://github.com/kiranwnr98/sliverhub/blob/main/src/components/SilverRateWidget.tsx): `src/components/SilverRateWidget.tsx`
- [Rate Function](https://github.com/kiranwnr98/sliverhub/blob/main/netlify/functions/silver-rate.mjs): `netlify/functions/silver-rate.mjs`

### Other components

- **Shopper**

## Connections

- Shopper → React Entry: opens storefront
- React Entry → App Router: renders app (evidence: `src/main.tsx`)
- App Router → Main Layout: wraps routes (evidence: `src/App.tsx`)
- App Router → Home Page: routes to (evidence: `src/App.tsx`)
- App Router → Shop Page: routes to (evidence: `src/App.tsx`)
- App Router → Collections Page: routes to (evidence: `src/App.tsx`)
- App Router → New Arrivals: routes to (evidence: `src/App.tsx`)
- App Router → About Page: routes to (evidence: `src/App.tsx`)
- App Router → Cart Page: routes to (evidence: `src/App.tsx`)
- App Router → Wishlist Page: routes to (evidence: `src/App.tsx`)
- Home Page → Product Card: renders products (evidence: `src/pages/Home.tsx`)
- Shop Page → Product Card: renders products (evidence: `src/pages/Shop.tsx`)
- New Arrivals → Product Card: renders products (evidence: `src/pages/NewArrivals.tsx`)
- Wishlist Page → Product Card: renders products (evidence: `src/pages/Wishlist.tsx`)
- Collections Page → Category Card: renders categories (evidence: `src/pages/Collections.tsx`)
- Home Page → Product Data: reads products (evidence: `src/pages/Home.tsx`)
- Home Page → Collection Data: reads arrivals (evidence: `src/pages/Home.tsx`)
- Shop Page → Product Data: reads products (evidence: `src/pages/Shop.tsx`)
- New Arrivals → Collection Data: reads arrivals (evidence: `src/pages/NewArrivals.tsx`)
- Collections Page → Category Data: reads categories (evidence: `src/pages/Collections.tsx`)
- Wishlist Page → Product Data: reads products (evidence: `src/pages/Wishlist.tsx`)
- Wishlist Page → Collection Data: reads arrivals (evidence: `src/pages/Wishlist.tsx`)
- Product Details → Cart State: updates cart (evidence: `src/pages/ProductDetails.tsx`)
- Product Details → Wishlist State: updates wishlist (evidence: `src/pages/ProductDetails.tsx`)
- Product Card → Cart State: updates cart (evidence: `src/components/ProductCard.tsx`)
- Product Card → Wishlist State: updates wishlist (evidence: `src/components/ProductCard.tsx`)
- Cart Page → Cart State: reads and updates (evidence: `src/pages/Cart.tsx`)
- Wishlist Page → Wishlist State: reads wishlist (evidence: `src/pages/Wishlist.tsx`)
- Home Page → Silver Rate Hook: fetches rate (evidence: `src/pages/Home.tsx`)
- Home Page → Silver Rate Widget: renders rate
- Silver Rate Hook → Rate Function: fetches endpoint (evidence: `src/hooks/useSilverRate.ts`)
