# rabin-humagain/nepalbestdeals architecture

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

- Interactive diagram: https://gitdiagram.com/rabin-humagain/nepalbestdeals
- Repository: https://github.com/rabin-humagain/nepalbestdeals

## Overview

Nepal Best Deals is a deal-browsing and affiliate storefront with an admin interface for managing product listings. Shoppers browse featured deals, filter by category, explore price drops or category-based Top 10 guides, and follow affiliate links to Daraz. The pages fetch product records from Supabase; hot deals and Top 10 rankings are derived in the client. Admin product retrieval is visible in the sampled source, but the excerpt does not show the publish/delete database operations. The README is empty, so the map follows the available tree and source excerpts.

Main entry points: [`app/page.tsx`](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/page.tsx) (Featured deals), [`app/hot-deals/page.tsx`](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/hot-deals/page.tsx) (Hot deals), [`app/top-10s/page.tsx`](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/top-10s/page.tsx) (Top 10 guides), [`lib/supabase.ts`](https://github.com/rabin-humagain/nepalbestdeals/blob/master/lib/supabase.ts) (Product model and client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Shopper experience"]
  node_home["Featured deals<br/>[page.tsx]"]
  node_hot["Hot deals<br/>[page.tsx]"]
  node_top10["Top 10 guides<br/>[page.tsx]"]
  node_header["Category header<br/>[sticky-header.tsx]"]
  node_card["Deal card<br/>[product-card.tsx]"]
  node_bottomnav["Bottom navigation<br/>[bottom-nav.tsx]"]
  node_layout["Application layout<br/>[layout.tsx]"]
end

subgraph group_management["Deal management"]
  node_admin["Admin dashboard<br/>[page.tsx]"]
end

subgraph group_data["Data and integration"]
  node_catalog["Product model and client<br/>[supabase.ts]"]
  node_supabase[("Supabase products")]
end

node_shopper(("Shopper"))
node_daraz(("Daraz affiliate"))

node_shopper -->|"browses"| node_home
node_shopper -->|"browses"| node_hot
node_shopper -->|"browses"| node_top10
node_shopper -->|"manages deals"| node_admin
node_home -->|"fetches products"| node_catalog
node_hot -->|"fetches products"| node_catalog
node_top10 -->|"fetches products"| node_catalog
node_admin -->|"fetches products"| node_catalog
node_catalog -->|"queries products"| node_supabase
node_home -->|"renders"| node_header
node_hot -->|"renders"| node_header
node_top10 -->|"renders"| node_header
node_home -->|"renders deals"| node_card
node_hot -->|"renders deals"| node_card
node_card -->|"opens affiliate link"| node_daraz
node_top10 -->|"links to affiliate"| node_daraz
node_layout -->|"wraps page"| node_home
node_layout -->|"wraps page"| node_hot
node_layout -->|"wraps page"| node_top10
node_layout -->|"wraps page"| node_admin

click node_home "https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/page.tsx"
click node_hot "https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/hot-deals/page.tsx"
click node_top10 "https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/top-10s/page.tsx"
click node_header "https://github.com/rabin-humagain/nepalbestdeals/blob/master/components/sticky-header.tsx"
click node_card "https://github.com/rabin-humagain/nepalbestdeals/blob/master/components/product-card.tsx"
click node_bottomnav "https://github.com/rabin-humagain/nepalbestdeals/blob/master/components/bottom-nav.tsx"
click node_admin "https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/admin/page.tsx"
click node_catalog "https://github.com/rabin-humagain/nepalbestdeals/blob/master/lib/supabase.ts"
click node_layout "https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/layout.tsx"

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_hot,node_top10,node_header,node_card,node_bottomnav,node_layout toneBlue
class node_admin toneAmber
class node_catalog,node_supabase toneMint
class node_shopper,node_daraz toneIndigo
```

## Components

### Shopper experience

- [Featured deals](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/page.tsx): `app/page.tsx`
- [Hot deals](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/hot-deals/page.tsx): `app/hot-deals/page.tsx`
- [Top 10 guides](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/top-10s/page.tsx): `app/top-10s/page.tsx`
- [Category header](https://github.com/rabin-humagain/nepalbestdeals/blob/master/components/sticky-header.tsx): `components/sticky-header.tsx`
- [Deal card](https://github.com/rabin-humagain/nepalbestdeals/blob/master/components/product-card.tsx): `components/product-card.tsx`
- [Bottom navigation](https://github.com/rabin-humagain/nepalbestdeals/blob/master/components/bottom-nav.tsx): `components/bottom-nav.tsx`
- [Application layout](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/layout.tsx): `app/layout.tsx`

### Deal management

- [Admin dashboard](https://github.com/rabin-humagain/nepalbestdeals/blob/master/app/admin/page.tsx): `app/admin/page.tsx`

### Data and integration

- [Product model and client](https://github.com/rabin-humagain/nepalbestdeals/blob/master/lib/supabase.ts): `lib/supabase.ts`
- **Supabase products**

### Other components

- **Shopper**
- **Daraz affiliate**

## Connections

- Shopper → Featured deals: browses
- Shopper → Hot deals: browses
- Shopper → Top 10 guides: browses
- Shopper → Admin dashboard: manages deals
- Featured deals → Product model and client: fetches products
- Hot deals → Product model and client: fetches products
- Top 10 guides → Product model and client: fetches products
- Admin dashboard → Product model and client: fetches products
- Product model and client → Supabase products: queries products
- Featured deals → Category header: renders
- Hot deals → Category header: renders
- Top 10 guides → Category header: renders
- Featured deals → Deal card: renders deals
- Hot deals → Deal card: renders deals
- Deal card → Daraz affiliate: opens affiliate link
- Top 10 guides → Daraz affiliate: links to affiliate
- Application layout → Featured deals: wraps page
- Application layout → Hot deals: wraps page
- Application layout → Top 10 guides: wraps page
- Application layout → Admin dashboard: wraps page
