# pheonix-666/soharth architecture

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

- Interactive diagram: https://gitdiagram.com/pheonix-666/soharth
- Repository: https://github.com/pheonix-666/soharth

## Overview

SOHARTH is a fashion-commerce storefront with product browsing, cart and order placement, plus an admin area and WhatsApp order notifications. The graph preserves the major storefront stages and backend capabilities visible in the tree. The README is only the default Next.js template, and several page/API implementations were not excerpted; therefore, uncertain page-to-endpoint connections are omitted rather than inferred.

Main entry points: [`src/components/Navbar.tsx`](https://github.com/pheonix-666/soharth/blob/main/src/components/Navbar.tsx) (Navigation), [`src/components/Footer.tsx`](https://github.com/pheonix-666/soharth/blob/main/src/components/Footer.tsx) (Footer), [`src/app/page.tsx`](https://github.com/pheonix-666/soharth/blob/main/src/app/page.tsx) (Home), [`src/context/CartContext.tsx`](https://github.com/pheonix-666/soharth/blob/main/src/context/CartContext.tsx) (Cart state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home<br/>[page.tsx]"]
  node_catalog["Product catalog<br/>[page.tsx]"]
  node_product["Product detail<br/>[page.tsx]"]
  node_about["About page<br/>[page.tsx]"]
  node_login["Login page<br/>[page.tsx]"]
end

subgraph group_commerce["Commerce"]
  node_cartstate["Cart state<br/>[CartContext.tsx]"]
  node_cartpage["Cart and checkout<br/>[page.tsx]"]
  node_pricing["Price calculation<br/>[pricing.ts]"]
  node_orderapi["Order placement API<br/>[route.ts]"]
end

subgraph group_operations["Operations"]
  node_admin["Admin console<br/>[page.tsx]"]
  node_adminlogin["Admin login API<br/>[route.ts]"]
  node_adminorders["Admin order APIs<br/>[route.ts]"]
  node_adminorder["Admin order detail API<br/>[route.ts]"]
  node_productapi["Product API<br/>[route.ts]"]
  node_productdetailapi["Product detail API<br/>[route.ts]"]
  node_categoryapi["Category API<br/>[route.ts]"]
  node_cartapi["Cart API<br/>[route.ts]"]
  node_reviewsapi["Reviews API<br/>[route.ts]"]
  node_uploadapi["Image upload API<br/>[route.ts]"]
end

subgraph group_messaging["Order messaging"]
  node_whatsappnotify["Notification service"]
  node_whatsappclient["WhatsApp client<br/>[whatsapp-client.js]"]
  node_whatsappservice["Notification HTTP service<br/>[index.js]"]
end

subgraph group_shared["Shared services"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_supabase[("Supabase")]
  node_supabaseclient["Supabase clients<br/>[supabase.ts]"]
  node_supabaseserver["Server Supabase client<br/>[supabase-server.ts]"]
  node_cloudinary["Cloudinary client<br/>[cloudinary.ts]"]
  node_toastcontext["Toast state<br/>[ToastContext.tsx]"]
  node_toast["Toast display<br/>[Toast.tsx]"]
  node_data["Product data helpers<br/>[data.ts]"]
  node_db["Database helpers<br/>[db.ts]"]
end

node_customer(("Shopper"))

node_customer -.->|"browses"| node_home
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_footer
node_home -->|"uses cart"| node_cartstate
node_home -->|"uses pricing"| node_pricing
node_catalog -->|"renders"| node_navbar
node_catalog -->|"renders"| node_footer
node_catalog -->|"uses cart"| node_cartstate
node_catalog -->|"uses pricing"| node_pricing
node_product -->|"renders"| node_navbar
node_product -->|"renders"| node_footer
node_product -->|"uses cart"| node_cartstate
node_product -->|"uses pricing"| node_pricing
node_about -->|"renders"| node_navbar
node_about -->|"renders"| node_footer
node_cartpage -->|"renders"| node_navbar
node_cartpage -->|"renders"| node_footer
node_cartpage -->|"uses cart"| node_cartstate
node_cartpage -->|"uses pricing"| node_pricing
node_navbar -->|"reads count"| node_cartstate
node_toastcontext -->|"renders"| node_toast
node_admin -->|"renders"| node_navbar
node_admin -->|"renders"| node_footer
node_admin -->|"uses toasts"| node_toastcontext
node_productapi -->|"reads and writes"| node_supabase
node_productapi -->|"uses client"| node_supabaseclient
node_productdetailapi -->|"accesses data"| node_supabase
node_productdetailapi -->|"uses client"| node_supabaseclient
node_categoryapi -->|"accesses data"| node_supabase
node_categoryapi -->|"uses client"| node_supabaseclient
node_reviewsapi -->|"accesses data"| node_supabase
node_reviewsapi -->|"uses client"| node_supabaseclient
node_cartapi -->|"accesses data"| node_supabase
node_cartapi -->|"uses client"| node_supabaseserver
node_orderapi -->|"stores order"| node_supabase
node_orderapi -->|"uses client"| node_supabaseserver
node_orderapi -->|"posts notification"| node_whatsappservice
node_whatsappservice -->|"dispatches"| node_whatsappnotify
node_whatsappnotify -->|"sends messages"| node_whatsappclient
node_adminorders -->|"accesses orders"| node_supabase
node_adminorders -->|"uses client"| node_supabaseserver
node_adminorder -->|"accesses order"| node_supabase
node_adminorder -->|"uses client"| node_supabaseserver
node_uploadapi -->|"uploads image"| node_cloudinary
node_db -->|"imports helpers"| node_data

click node_home "https://github.com/pheonix-666/soharth/blob/main/src/app/page.tsx"
click node_catalog "https://github.com/pheonix-666/soharth/blob/main/src/app/products/page.tsx"
click node_product "https://github.com/pheonix-666/soharth/blob/main/src/app/products/%5Bid%5D/page.tsx"
click node_about "https://github.com/pheonix-666/soharth/blob/main/src/app/about/page.tsx"
click node_login "https://github.com/pheonix-666/soharth/blob/main/src/app/login/page.tsx"
click node_navbar "https://github.com/pheonix-666/soharth/blob/main/src/components/Navbar.tsx"
click node_footer "https://github.com/pheonix-666/soharth/blob/main/src/components/Footer.tsx"
click node_cartstate "https://github.com/pheonix-666/soharth/blob/main/src/context/CartContext.tsx"
click node_cartpage "https://github.com/pheonix-666/soharth/blob/main/src/app/cart/page.tsx"
click node_pricing "https://github.com/pheonix-666/soharth/blob/main/src/lib/pricing.ts"
click node_orderapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/orders/route.ts"
click node_admin "https://github.com/pheonix-666/soharth/blob/main/src/app/admin/page.tsx"
click node_adminlogin "https://github.com/pheonix-666/soharth/blob/main/src/app/api/admin-login/route.ts"
click node_adminorders "https://github.com/pheonix-666/soharth/blob/main/src/app/api/admin/orders/route.ts"
click node_adminorder "https://github.com/pheonix-666/soharth/blob/main/src/app/api/admin/orders/%5Bid%5D/route.ts"
click node_productapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/products/route.ts"
click node_productdetailapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/products/%5Bid%5D/route.ts"
click node_categoryapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/categories/route.ts"
click node_cartapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/cart/route.ts"
click node_reviewsapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/reviews/route.ts"
click node_uploadapi "https://github.com/pheonix-666/soharth/blob/main/src/app/api/upload/route.ts"
click node_supabaseclient "https://github.com/pheonix-666/soharth/blob/main/src/lib/supabase.ts"
click node_supabaseserver "https://github.com/pheonix-666/soharth/blob/main/src/lib/supabase-server.ts"
click node_cloudinary "https://github.com/pheonix-666/soharth/blob/main/src/lib/cloudinary.ts"
click node_toastcontext "https://github.com/pheonix-666/soharth/blob/main/src/context/ToastContext.tsx"
click node_toast "https://github.com/pheonix-666/soharth/blob/main/src/components/Toast.tsx"
click node_data "https://github.com/pheonix-666/soharth/blob/main/src/lib/data.ts"
click node_db "https://github.com/pheonix-666/soharth/blob/main/src/lib/db.ts"
click node_whatsappnotify "https://github.com/pheonix-666/soharth/blob/main/whatsapp-service/notification-service.js"
click node_whatsappclient "https://github.com/pheonix-666/soharth/blob/main/whatsapp-service/whatsapp-client.js"
click node_whatsappservice "https://github.com/pheonix-666/soharth/blob/main/whatsapp-service/index.js"

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_catalog,node_product,node_about,node_login toneBlue
class node_cartstate,node_cartpage,node_pricing,node_orderapi toneAmber
class node_admin,node_adminlogin,node_adminorders,node_adminorder,node_productapi,node_productdetailapi,node_categoryapi,node_cartapi,node_reviewsapi,node_uploadapi toneMint
class node_whatsappnotify,node_whatsappclient,node_whatsappservice toneRose
class node_navbar,node_footer,node_supabase,node_supabaseclient,node_supabaseserver,node_cloudinary,node_toastcontext,node_toast,node_data,node_db,node_customer toneIndigo
```

## Components

### Storefront

- [Home](https://github.com/pheonix-666/soharth/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Product catalog](https://github.com/pheonix-666/soharth/blob/main/src/app/products/page.tsx): `src/app/products/page.tsx`
- [Product detail](https://github.com/pheonix-666/soharth/blob/main/src/app/products/%5Bid%5D/page.tsx): `src/app/products/[id]/page.tsx`
- [About page](https://github.com/pheonix-666/soharth/blob/main/src/app/about/page.tsx): `src/app/about/page.tsx`
- [Login page](https://github.com/pheonix-666/soharth/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`

### Commerce

- [Cart state](https://github.com/pheonix-666/soharth/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Cart and checkout](https://github.com/pheonix-666/soharth/blob/main/src/app/cart/page.tsx): `src/app/cart/page.tsx`
- [Price calculation](https://github.com/pheonix-666/soharth/blob/main/src/lib/pricing.ts): `src/lib/pricing.ts`
- [Order placement API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/orders/route.ts): `src/app/api/orders/route.ts`

### Operations

- [Admin console](https://github.com/pheonix-666/soharth/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Admin login API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/admin-login/route.ts): `src/app/api/admin-login/route.ts`
- [Admin order APIs](https://github.com/pheonix-666/soharth/blob/main/src/app/api/admin/orders/route.ts): `src/app/api/admin/orders/route.ts`
- [Admin order detail API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/admin/orders/%5Bid%5D/route.ts): `src/app/api/admin/orders/[id]/route.ts`
- [Product API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/products/route.ts): `src/app/api/products/route.ts`
- [Product detail API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/products/%5Bid%5D/route.ts): `src/app/api/products/[id]/route.ts`
- [Category API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/categories/route.ts): `src/app/api/categories/route.ts`
- [Cart API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/cart/route.ts): `src/app/api/cart/route.ts`
- [Reviews API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/reviews/route.ts): `src/app/api/reviews/route.ts`
- [Image upload API](https://github.com/pheonix-666/soharth/blob/main/src/app/api/upload/route.ts): `src/app/api/upload/route.ts`

### Order messaging

- [Notification service](https://github.com/pheonix-666/soharth/blob/main/whatsapp-service/notification-service.js): `whatsapp-service/notification-service.js`
- [WhatsApp client](https://github.com/pheonix-666/soharth/blob/main/whatsapp-service/whatsapp-client.js): `whatsapp-service/whatsapp-client.js`
- [Notification HTTP service](https://github.com/pheonix-666/soharth/blob/main/whatsapp-service/index.js): `whatsapp-service/index.js`

### Shared services

- [Navigation](https://github.com/pheonix-666/soharth/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Footer](https://github.com/pheonix-666/soharth/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- **Supabase**
- [Supabase clients](https://github.com/pheonix-666/soharth/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Server Supabase client](https://github.com/pheonix-666/soharth/blob/main/src/lib/supabase-server.ts): `src/lib/supabase-server.ts`
- [Cloudinary client](https://github.com/pheonix-666/soharth/blob/main/src/lib/cloudinary.ts): `src/lib/cloudinary.ts`
- [Toast state](https://github.com/pheonix-666/soharth/blob/main/src/context/ToastContext.tsx): `src/context/ToastContext.tsx`
- [Toast display](https://github.com/pheonix-666/soharth/blob/main/src/components/Toast.tsx): `src/components/Toast.tsx`
- [Product data helpers](https://github.com/pheonix-666/soharth/blob/main/src/lib/data.ts): `src/lib/data.ts`
- [Database helpers](https://github.com/pheonix-666/soharth/blob/main/src/lib/db.ts): `src/lib/db.ts`

### Other components

- **Shopper**

## Connections

- Shopper → Home: browses
- Home → Navigation: renders (evidence: `src/app/page.tsx`)
- Home → Footer: renders (evidence: `src/app/page.tsx`)
- Home → Cart state: uses cart (evidence: `src/app/page.tsx`)
- Home → Price calculation: uses pricing (evidence: `src/app/page.tsx`)
- Product catalog → Navigation: renders (evidence: `src/app/products/page.tsx`)
- Product catalog → Footer: renders (evidence: `src/app/products/page.tsx`)
- Product catalog → Cart state: uses cart (evidence: `src/app/products/page.tsx`)
- Product catalog → Price calculation: uses pricing (evidence: `src/app/products/page.tsx`)
- Product detail → Navigation: renders (evidence: `src/app/products/[id]/page.tsx`)
- Product detail → Footer: renders (evidence: `src/app/products/[id]/page.tsx`)
- Product detail → Cart state: uses cart (evidence: `src/app/products/[id]/page.tsx`)
- Product detail → Price calculation: uses pricing (evidence: `src/app/products/[id]/page.tsx`)
- About page → Navigation: renders (evidence: `src/app/about/page.tsx`)
- About page → Footer: renders (evidence: `src/app/about/page.tsx`)
- Cart and checkout → Navigation: renders (evidence: `src/app/cart/page.tsx`)
- Cart and checkout → Footer: renders (evidence: `src/app/cart/page.tsx`)
- Cart and checkout → Cart state: uses cart (evidence: `src/app/cart/page.tsx`)
- Cart and checkout → Price calculation: uses pricing (evidence: `src/app/cart/page.tsx`)
- Navigation → Cart state: reads count (evidence: `src/components/Navbar.tsx`)
- Toast state → Toast display: renders (evidence: `src/context/ToastContext.tsx`)
- Admin console → Navigation: renders (evidence: `src/app/admin/page.tsx`)
- Admin console → Footer: renders (evidence: `src/app/admin/page.tsx`)
- Admin console → Toast state: uses toasts (evidence: `src/app/admin/page.tsx`)
- Product API → Supabase: reads and writes (evidence: `src/app/api/products/route.ts`)
- Product API → Supabase clients: uses client (evidence: `src/app/api/products/route.ts`)
- Product detail API → Supabase: accesses data (evidence: `src/app/api/products/[id]/route.ts`)
- Product detail API → Supabase clients: uses client (evidence: `src/app/api/products/[id]/route.ts`)
- Category API → Supabase: accesses data (evidence: `src/app/api/categories/route.ts`)
- Category API → Supabase clients: uses client (evidence: `src/app/api/categories/route.ts`)
- Reviews API → Supabase: accesses data (evidence: `src/app/api/reviews/route.ts`)
- Reviews API → Supabase clients: uses client (evidence: `src/app/api/reviews/route.ts`)
- Cart API → Supabase: accesses data (evidence: `src/app/api/cart/route.ts`)
- Cart API → Server Supabase client: uses client (evidence: `src/app/api/cart/route.ts`)
- Order placement API → Supabase: stores order (evidence: `src/app/api/orders/route.ts`)
- Order placement API → Server Supabase client: uses client (evidence: `src/app/api/orders/route.ts`)
- Order placement API → Notification HTTP service: posts notification (evidence: `src/app/api/orders/route.ts`)
- Notification HTTP service → Notification service: dispatches (evidence: `whatsapp-service/index.js`)
- Notification service → WhatsApp client: sends messages (evidence: `whatsapp-service/notification-service.js`)
- Admin order APIs → Supabase: accesses orders (evidence: `src/app/api/admin/orders/route.ts`)
- Admin order APIs → Server Supabase client: uses client (evidence: `src/app/api/admin/orders/route.ts`)
- Admin order detail API → Supabase: accesses order (evidence: `src/app/api/admin/orders/[id]/route.ts`)
- Admin order detail API → Server Supabase client: uses client (evidence: `src/app/api/admin/orders/[id]/route.ts`)
- Image upload API → Cloudinary client: uploads image (evidence: `src/app/api/upload/route.ts`)
- Database helpers → Product data helpers: imports helpers (evidence: `src/lib/db.ts`)
