# ayanjaved/herbiccure architecture

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

- Interactive diagram: https://gitdiagram.com/ayanjaved/herbiccure
- Repository: https://github.com/ayanjaved/herbiccure

## Overview

Herbic Cure is an Ayurvedic hair-care storefront with customer shopping and an admin-managed catalog and content CMS. The main customer journey is browse products, inspect details, manage a cart, check out, then track an order; other documented capabilities include coupon validation, customer accounts, reviews, newsletter signup, and WhatsApp consultation. The graph combines documented features with sampled code relationships; several page-to-API connections and unsampled subsystems are supported by README descriptions rather than inspected implementations.

Main entry points: [`src/components/product/ProductDetailClient.tsx`](https://github.com/ayanjaved/herbiccure/blob/main/src/components/product/ProductDetailClient.tsx) (Product Details), [`src/app/checkout/page.tsx`](https://github.com/ayanjaved/herbiccure/blob/main/src/app/checkout/page.tsx) (Checkout), [`src/app/api/admin`](https://github.com/ayanjaved/herbiccure/tree/main/src/app/api/admin) (Admin Content APIs), [`src/lib/prisma.ts`](https://github.com/ayanjaved/herbiccure/blob/main/src/lib/prisma.ts) (Prisma Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Storefront Shopping"]
  node_catalog["Product Catalog<br/>[page.tsx]"]
  node_product["Product Details"]
  node_collections["Collections"]
  node_offers["Offers<br/>[page.tsx]"]
  node_timer["Offer Countdown"]
end

subgraph group_checkout["Cart And Orders"]
  node_cartstate["Cart State<br/>[CartContext.tsx]"]
  node_cartdrawer["Cart Drawer<br/>[CartDrawer.tsx]"]
  node_checkoutpage["Checkout<br/>[page.tsx]"]
  node_coupon["Coupon Verification<br/>[route.ts]"]
  node_orderapi["Order Creation<br/>[route.ts]"]
  node_tracking["Order Tracking<br/>[page.tsx]"]
end

subgraph group_engagement["Customer Engagement"]
  node_account["Customer Account"]
  node_authstate["Customer Session<br/>[AuthContext.tsx]"]
  node_reviews["Product Reviews<br/>[route.ts]"]
  node_contact["Contact Submissions<br/>[route.ts]"]
  node_newsletter["Newsletter Signup<br/>[route.ts]"]
  node_consult["WhatsApp Consultation"]
end

subgraph group_admin["CMS Administration"]
  node_adminui["Admin Console"]
  node_productform["Product Editor<br/>[ProductForm.tsx]"]
  node_adminapi["Admin Content APIs"]
end

subgraph group_data["Application Data"]
  node_prisma["Prisma Client<br/>[prisma.ts]"]
  node_sqlite[("SQLite Database")]
end

node_customer(("Shopper"))

node_customer -->|"browses"| node_catalog
node_customer -->|"inspects"| node_product
node_catalog -.->|"opens details"| node_product
node_customer -->|"browses"| node_collections
node_customer -->|"views deals"| node_offers
node_product -->|"renders"| node_timer
node_product -->|"adds items"| node_cartstate
node_cartdrawer -->|"reads and updates"| node_cartstate
node_customer -->|"manages cart"| node_cartdrawer
node_customer -->|"checks out"| node_checkoutpage
node_checkoutpage -->|"validates coupon"| node_coupon
node_checkoutpage -->|"creates order"| node_orderapi
node_orderapi -->|"writes order"| node_prisma
node_customer -->|"tracks order"| node_tracking
node_customer -->|"manages account"| node_account
node_account -.->|"uses session"| node_authstate
node_customer -->|"submits review"| node_reviews
node_customer -->|"sends inquiry"| node_contact
node_customer -->|"subscribes"| node_newsletter
node_customer -->|"requests advice"| node_consult
node_adminui -.->|"manages content"| node_adminapi
node_productform -.->|"edits products"| node_adminapi
node_adminapi -->|"reads and writes"| node_prisma
node_prisma -->|"persists data"| node_sqlite

click node_catalog "https://github.com/ayanjaved/herbiccure/blob/main/src/app/products/page.tsx"
click node_product "https://github.com/ayanjaved/herbiccure/blob/main/src/components/product/ProductDetailClient.tsx"
click node_collections "https://github.com/ayanjaved/herbiccure/tree/main/src/app/collections"
click node_offers "https://github.com/ayanjaved/herbiccure/blob/main/src/app/offers/page.tsx"
click node_timer "https://github.com/ayanjaved/herbiccure/blob/main/src/components/ui/OfferCountdownTimer.tsx"
click node_cartstate "https://github.com/ayanjaved/herbiccure/blob/main/src/context/CartContext.tsx"
click node_cartdrawer "https://github.com/ayanjaved/herbiccure/blob/main/src/components/cart/CartDrawer.tsx"
click node_checkoutpage "https://github.com/ayanjaved/herbiccure/blob/main/src/app/checkout/page.tsx"
click node_coupon "https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/coupons/verify/route.ts"
click node_orderapi "https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/orders/create/route.ts"
click node_tracking "https://github.com/ayanjaved/herbiccure/blob/main/src/app/track-order/page.tsx"
click node_account "https://github.com/ayanjaved/herbiccure/tree/main/src/app/account"
click node_authstate "https://github.com/ayanjaved/herbiccure/blob/main/src/context/AuthContext.tsx"
click node_reviews "https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/reviews/route.ts"
click node_contact "https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/contact/route.ts"
click node_newsletter "https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/newsletter/route.ts"
click node_consult "https://github.com/ayanjaved/herbiccure/blob/main/src/components/layout/WhatsAppFloating.tsx"
click node_adminui "https://github.com/ayanjaved/herbiccure/tree/main/src/app/admin"
click node_productform "https://github.com/ayanjaved/herbiccure/blob/main/src/components/admin/ProductForm.tsx"
click node_adminapi "https://github.com/ayanjaved/herbiccure/tree/main/src/app/api/admin"
click node_prisma "https://github.com/ayanjaved/herbiccure/blob/main/src/lib/prisma.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_catalog,node_product,node_collections,node_offers,node_timer toneBlue
class node_cartstate,node_cartdrawer,node_checkoutpage,node_coupon,node_orderapi,node_tracking toneAmber
class node_account,node_authstate,node_reviews,node_contact,node_newsletter,node_consult toneMint
class node_adminui,node_productform,node_adminapi toneRose
class node_prisma,node_sqlite,node_customer toneIndigo
```

## Components

### Storefront Shopping

- [Product Catalog](https://github.com/ayanjaved/herbiccure/blob/main/src/app/products/page.tsx): `src/app/products/page.tsx`
- [Product Details](https://github.com/ayanjaved/herbiccure/blob/main/src/components/product/ProductDetailClient.tsx): `src/components/product/ProductDetailClient.tsx`
- [Collections](https://github.com/ayanjaved/herbiccure/tree/main/src/app/collections): `src/app/collections`
- [Offers](https://github.com/ayanjaved/herbiccure/blob/main/src/app/offers/page.tsx): `src/app/offers/page.tsx`
- [Offer Countdown](https://github.com/ayanjaved/herbiccure/blob/main/src/components/ui/OfferCountdownTimer.tsx): `src/components/ui/OfferCountdownTimer.tsx`

### Cart And Orders

- [Cart State](https://github.com/ayanjaved/herbiccure/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Cart Drawer](https://github.com/ayanjaved/herbiccure/blob/main/src/components/cart/CartDrawer.tsx): `src/components/cart/CartDrawer.tsx`
- [Checkout](https://github.com/ayanjaved/herbiccure/blob/main/src/app/checkout/page.tsx): `src/app/checkout/page.tsx`
- [Coupon Verification](https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/coupons/verify/route.ts): `src/app/api/coupons/verify/route.ts`
- [Order Creation](https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/orders/create/route.ts): `src/app/api/orders/create/route.ts`
- [Order Tracking](https://github.com/ayanjaved/herbiccure/blob/main/src/app/track-order/page.tsx): `src/app/track-order/page.tsx`

### Customer Engagement

- [Customer Account](https://github.com/ayanjaved/herbiccure/tree/main/src/app/account): `src/app/account`
- [Customer Session](https://github.com/ayanjaved/herbiccure/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Product Reviews](https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/reviews/route.ts): `src/app/api/reviews/route.ts`
- [Contact Submissions](https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/contact/route.ts): `src/app/api/contact/route.ts`
- [Newsletter Signup](https://github.com/ayanjaved/herbiccure/blob/main/src/app/api/newsletter/route.ts): `src/app/api/newsletter/route.ts`
- [WhatsApp Consultation](https://github.com/ayanjaved/herbiccure/blob/main/src/components/layout/WhatsAppFloating.tsx): `src/components/layout/WhatsAppFloating.tsx`

### CMS Administration

- [Admin Console](https://github.com/ayanjaved/herbiccure/tree/main/src/app/admin): `src/app/admin`
- [Product Editor](https://github.com/ayanjaved/herbiccure/blob/main/src/components/admin/ProductForm.tsx): `src/components/admin/ProductForm.tsx`
- [Admin Content APIs](https://github.com/ayanjaved/herbiccure/tree/main/src/app/api/admin): `src/app/api/admin`

### Application Data

- [Prisma Client](https://github.com/ayanjaved/herbiccure/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- **SQLite Database**

### Other components

- **Shopper**

## Connections

- Shopper → Product Catalog: browses (evidence: `README.md`)
- Shopper → Product Details: inspects (evidence: `README.md`)
- Product Catalog → Product Details: opens details
- Shopper → Collections: browses (evidence: `README.md`)
- Shopper → Offers: views deals (evidence: `README.md`)
- Product Details → Offer Countdown: renders (evidence: `src/components/product/ProductDetailClient.tsx`)
- Product Details → Cart State: adds items (evidence: `src/components/product/ProductDetailClient.tsx`)
- Cart Drawer → Cart State: reads and updates (evidence: `src/components/cart/CartDrawer.tsx`)
- Shopper → Cart Drawer: manages cart (evidence: `README.md`)
- Shopper → Checkout: checks out (evidence: `README.md`)
- Checkout → Coupon Verification: validates coupon (evidence: `README.md`)
- Checkout → Order Creation: creates order (evidence: `README.md`)
- Order Creation → Prisma Client: writes order (evidence: `src/app/api/orders/create/route.ts`)
- Shopper → Order Tracking: tracks order (evidence: `README.md`)
- Shopper → Customer Account: manages account (evidence: `README.md`)
- Customer Account → Customer Session: uses session
- Shopper → Product Reviews: submits review (evidence: `README.md`)
- Shopper → Contact Submissions: sends inquiry (evidence: `src/app/api/contact/route.ts`)
- Shopper → Newsletter Signup: subscribes (evidence: `src/app/api/newsletter/route.ts`)
- Shopper → WhatsApp Consultation: requests advice (evidence: `README.md`)
- Admin Console → Admin Content APIs: manages content
- Product Editor → Admin Content APIs: edits products
- Admin Content APIs → Prisma Client: reads and writes (evidence: `src/app/api/admin/products/route.ts`)
- Prisma Client → SQLite Database: persists data (evidence: `README.md`)
