# kienkuon2k4/nexhshop architecture

> Architecture diagram of the GitHub repository kienkuon2k4/nexhshop, 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/kienkuon2k4/nexhshop
- Repository: https://github.com/kienkuon2k4/nexhshop

## Overview

NextShop is a client-rendered marketplace prototype. The central workflow starts at the marketplace page: shoppers browse and search products, inspect details, add items to a cart, and access buyer account features; seller and admin views provide separate management workflows. Authentication, conversations, and sample product data are implemented in client-side contexts and modules rather than backed by a documented server or payment integration. The graph reflects documented imports and sampled calls; unsampled behavior is not inferred.

Main entry points: [`src/app/page.tsx`](https://github.com/kienkuon2k4/nexhshop/blob/main/src/app/page.tsx) (Marketplace Entry), [`src/context/AuthContext.tsx`](https://github.com/kienkuon2k4/nexhshop/blob/main/src/context/AuthContext.tsx) (Identity and Account State), [`src/components/pdp/ProductDetailView.tsx`](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/pdp/ProductDetailView.tsx) (Product Details), [`src/components/support/SupportPopup.tsx`](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/support/SupportPopup.tsx) (Support Chat UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Marketplace UI"]
  node_marketplace_page["Marketplace Entry<br/>[page.tsx]"]
  node_header["Navigation and Search<br/>[Header.tsx]"]
  node_footer["Marketplace Footer<br/>[Footer.tsx]"]
  node_hero["Hero Banner<br/>[HeroBanner.tsx]"]
  node_category_cards["Category Cards<br/>[CardQuad.tsx]"]
  node_product_slider["Product Slider<br/>[ProductSlider.tsx]"]
  node_product_grid["Product Grid<br/>[ProductGrid.tsx]"]
  node_product_detail["Product Details"]
  node_buy_box["Purchase Controls<br/>[BuyBox.tsx]"]
  node_cart["Cart and Checkout<br/>[CartView.tsx]"]
end

subgraph group_accounts["Accounts and Support"]
  node_auth_ui["Login and Seller Signup<br/>[LoginModal.tsx]"]
  node_access_denied["Access Denied View"]
  node_support_popup["Support Chat UI<br/>[SupportPopup.tsx]"]
  node_auth_context["Identity and Account State<br/>[AuthContext.tsx]"]
  node_chat_context["Conversation State<br/>[ChatContext.tsx]"]
end

subgraph group_operations["Marketplace Operations"]
  node_buyer_dashboard["Buyer Dashboard<br/>[BuyerDashboard.tsx]"]
  node_seller_dashboard["Seller Dashboard"]
  node_admin_dashboard["Admin Dashboard<br/>[AdminDashboard.tsx]"]
end

subgraph group_shared["Shared Data"]
  node_product_data["Mock Product Catalog<br/>[mockData.ts]"]
  node_format["Price Formatting<br/>[format.ts]"]
end

node_shopper(("Shopper"))
node_local_storage[("Browser Local Storage")]

node_shopper -->|"opens marketplace"| node_marketplace_page
node_marketplace_page -->|"renders"| node_header
node_marketplace_page -->|"renders"| node_footer
node_marketplace_page -->|"renders"| node_hero
node_marketplace_page -->|"renders"| node_category_cards
node_marketplace_page -->|"renders"| node_product_slider
node_marketplace_page -->|"renders"| node_product_grid
node_marketplace_page -->|"renders"| node_product_detail
node_marketplace_page -->|"renders"| node_cart
node_marketplace_page -->|"routes to"| node_buyer_dashboard
node_marketplace_page -->|"routes to"| node_seller_dashboard
node_marketplace_page -->|"routes to"| node_admin_dashboard
node_marketplace_page -->|"renders"| node_auth_ui
node_marketplace_page -->|"renders"| node_access_denied
node_marketplace_page -->|"renders"| node_support_popup
node_product_detail -->|"renders"| node_buy_box
node_product_detail -->|"reads samples"| node_product_data
node_header -->|"reads account state"| node_auth_context
node_auth_ui -->|"uses account actions"| node_auth_context
node_access_denied -->|"reads account state"| node_auth_context
node_buyer_dashboard -->|"uses account state"| node_auth_context
node_cart -->|"uses account state"| node_auth_context
node_seller_dashboard -->|"formats values"| node_format
node_admin_dashboard -->|"uses account state"| node_auth_context
node_admin_dashboard -->|"uses conversations"| node_chat_context
node_support_popup -->|"reads account state"| node_auth_context
node_support_popup -->|"uses conversations"| node_chat_context
node_chat_context -->|"reads current user"| node_auth_context
node_auth_context -->|"reads and writes"| node_local_storage

click node_marketplace_page "https://github.com/kienkuon2k4/nexhshop/blob/main/src/app/page.tsx"
click node_header "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/layout/Header.tsx"
click node_footer "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/layout/Footer.tsx"
click node_hero "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/HeroBanner.tsx"
click node_category_cards "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/CardQuad.tsx"
click node_product_slider "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/ProductSlider.tsx"
click node_product_grid "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/ProductGrid.tsx"
click node_product_detail "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/pdp/ProductDetailView.tsx"
click node_buy_box "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/pdp/BuyBox.tsx"
click node_cart "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/cart/CartView.tsx"
click node_buyer_dashboard "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/buyer/BuyerDashboard.tsx"
click node_seller_dashboard "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/seller/SellerDashboard.tsx"
click node_admin_dashboard "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/admin/AdminDashboard.tsx"
click node_auth_ui "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/auth/LoginModal.tsx"
click node_access_denied "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/auth/AccessDeniedView.tsx"
click node_support_popup "https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/support/SupportPopup.tsx"
click node_auth_context "https://github.com/kienkuon2k4/nexhshop/blob/main/src/context/AuthContext.tsx"
click node_chat_context "https://github.com/kienkuon2k4/nexhshop/blob/main/src/context/ChatContext.tsx"
click node_product_data "https://github.com/kienkuon2k4/nexhshop/blob/main/src/data/mockData.ts"
click node_format "https://github.com/kienkuon2k4/nexhshop/blob/main/src/utils/format.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_marketplace_page,node_header,node_footer,node_hero,node_category_cards,node_product_slider,node_product_grid,node_product_detail,node_buy_box,node_cart toneBlue
class node_auth_ui,node_access_denied,node_support_popup,node_auth_context,node_chat_context,node_local_storage toneAmber
class node_buyer_dashboard,node_seller_dashboard,node_admin_dashboard toneMint
class node_product_data,node_format toneRose
class node_shopper toneIndigo
```

## Components

### Marketplace UI

- [Marketplace Entry](https://github.com/kienkuon2k4/nexhshop/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Navigation and Search](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/layout/Header.tsx): `src/components/layout/Header.tsx`
- [Marketplace Footer](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/layout/Footer.tsx): `src/components/layout/Footer.tsx`
- [Hero Banner](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/HeroBanner.tsx): `src/components/home/HeroBanner.tsx`
- [Category Cards](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/CardQuad.tsx): `src/components/home/CardQuad.tsx`
- [Product Slider](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/ProductSlider.tsx): `src/components/home/ProductSlider.tsx`
- [Product Grid](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/home/ProductGrid.tsx): `src/components/home/ProductGrid.tsx`
- [Product Details](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/pdp/ProductDetailView.tsx): `src/components/pdp/ProductDetailView.tsx`
- [Purchase Controls](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/pdp/BuyBox.tsx): `src/components/pdp/BuyBox.tsx`
- [Cart and Checkout](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/cart/CartView.tsx): `src/components/cart/CartView.tsx`

### Accounts and Support

- [Login and Seller Signup](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/auth/LoginModal.tsx): `src/components/auth/LoginModal.tsx`
- [Access Denied View](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/auth/AccessDeniedView.tsx): `src/components/auth/AccessDeniedView.tsx`
- [Support Chat UI](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/support/SupportPopup.tsx): `src/components/support/SupportPopup.tsx`
- [Identity and Account State](https://github.com/kienkuon2k4/nexhshop/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Conversation State](https://github.com/kienkuon2k4/nexhshop/blob/main/src/context/ChatContext.tsx): `src/context/ChatContext.tsx`

### Marketplace Operations

- [Buyer Dashboard](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/buyer/BuyerDashboard.tsx): `src/components/buyer/BuyerDashboard.tsx`
- [Seller Dashboard](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/seller/SellerDashboard.tsx): `src/components/seller/SellerDashboard.tsx`
- [Admin Dashboard](https://github.com/kienkuon2k4/nexhshop/blob/main/src/components/admin/AdminDashboard.tsx): `src/components/admin/AdminDashboard.tsx`

### Shared Data

- [Mock Product Catalog](https://github.com/kienkuon2k4/nexhshop/blob/main/src/data/mockData.ts): `src/data/mockData.ts`
- [Price Formatting](https://github.com/kienkuon2k4/nexhshop/blob/main/src/utils/format.ts): `src/utils/format.ts`

### Other components

- **Shopper**
- **Browser Local Storage**

## Connections

- Shopper → Marketplace Entry: opens marketplace (evidence: `README.md`)
- Marketplace Entry → Navigation and Search: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Marketplace Footer: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Hero Banner: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Category Cards: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Product Slider: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Product Grid: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Product Details: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Cart and Checkout: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Buyer Dashboard: routes to (evidence: `src/app/page.tsx`)
- Marketplace Entry → Seller Dashboard: routes to (evidence: `src/app/page.tsx`)
- Marketplace Entry → Admin Dashboard: routes to (evidence: `src/app/page.tsx`)
- Marketplace Entry → Login and Seller Signup: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Access Denied View: renders (evidence: `src/app/page.tsx`)
- Marketplace Entry → Support Chat UI: renders (evidence: `src/app/page.tsx`)
- Product Details → Purchase Controls: renders (evidence: `src/components/pdp/ProductDetailView.tsx`)
- Product Details → Mock Product Catalog: reads samples (evidence: `src/components/pdp/ProductDetailView.tsx`)
- Navigation and Search → Identity and Account State: reads account state (evidence: `src/components/layout/Header.tsx`)
- Login and Seller Signup → Identity and Account State: uses account actions (evidence: `src/components/auth/LoginModal.tsx`)
- Access Denied View → Identity and Account State: reads account state (evidence: `src/components/auth/AccessDeniedView.tsx`)
- Buyer Dashboard → Identity and Account State: uses account state (evidence: `src/components/buyer/BuyerDashboard.tsx`)
- Cart and Checkout → Identity and Account State: uses account state (evidence: `src/components/cart/CartView.tsx`)
- Seller Dashboard → Price Formatting: formats values (evidence: `src/components/seller/SellerDashboard.tsx`)
- Admin Dashboard → Identity and Account State: uses account state (evidence: `src/components/admin/AdminDashboard.tsx`)
- Admin Dashboard → Conversation State: uses conversations (evidence: `src/components/admin/AdminDashboard.tsx`)
- Support Chat UI → Identity and Account State: reads account state (evidence: `src/components/support/SupportPopup.tsx`)
- Support Chat UI → Conversation State: uses conversations (evidence: `src/components/support/SupportPopup.tsx`)
- Conversation State → Identity and Account State: reads current user (evidence: `src/context/ChatContext.tsx`)
- Identity and Account State → Browser Local Storage: reads and writes (evidence: `src/context/AuthContext.tsx`)
