# prajwal471/nayantara-ecommerce-website architecture

> Architecture diagram of the GitHub repository prajwal471/nayantara-ecommerce-website, 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/prajwal471/nayantara-ecommerce-website
- Repository: https://github.com/prajwal471/nayantara-ecommerce-website

## Overview

Nayantara is a Next.js storefront with product browsing, product purchase pages, order-history email, and an administrative area for products and orders. The visible path is customer browsing to a product purchase page; the purchase form and payment completion details are not sampled, so their internal transitions are left out. Admin product listing, order history, email, and database behavior are represented where the source index shows connections. Several README claims, including authentication, cart, search, and filtering, are not corroborated by the tree or sampled relationships.

Main entry points: [`src/app/(customerFacing)/page.tsx`](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/page.tsx) (Home page), [`src/db/db.ts`](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/db/db.ts) (Prisma database), [`src/components/ProductCard.tsx`](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ProductCard.tsx) (Product card), [`src/app/admin/products/page.tsx`](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/page.tsx) (Product management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Storefront"]
  node_home["Home page<br/>[page.tsx]"]
  node_catalog["Product catalog<br/>[page.tsx]"]
  node_productcard["Product card<br/>[ProductCard.tsx]"]
  node_hero["Hero section<br/>[HeroSection.tsx]"]
  node_scrolling["Featured carousel"]
end

subgraph group_orders["Checkout and orders"]
  node_purchase["Purchase page<br/>[page.tsx]"]
  node_checkoutform["Checkout form<br/>[CheckoutForm.tsx]"]
  node_success["Purchase success<br/>[page.tsx]"]
  node_orderaction["Order history action<br/>[orders.tsx]"]
  node_orderspage["Order history page<br/>[page.tsx]"]
  node_historyemail["History email<br/>[OrderHistory.tsx]"]
  node_orderinfo["Order details"]
  node_receipt["Purchase receipt"]
  node_webhook["Stripe webhook<br/>[route.tsx]"]
end

subgraph group_admin["Administration"]
  node_adminproducts["Product management<br/>[page.tsx]"]
  node_productform["Product editor<br/>[ProductForm.tsx]"]
  node_productactions["Product actions<br/>[ProductActions.tsx]"]
  node_adminorders["Order management<br/>[page.tsx]"]
  node_orderactions["Order actions<br/>[OrderActions.tsx]"]
  node_adminusers["User management<br/>[page.tsx]"]
end

subgraph group_shared["Shared services"]
  node_db[("Prisma database<br/>[db.ts]")]
  node_cache["Page cache<br/>[cache.ts]"]
  node_formatters["Formatters<br/>[formatters.ts]"]
  node_button["Button primitive<br/>[button.tsx]"]
  node_card["Card primitive<br/>[card.tsx]"]
  node_dropdown["Dropdown primitive<br/>[dropdown-menu.tsx]"]
  node_table["Table primitive<br/>[table.tsx]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_home
node_customer -->|"browses"| node_catalog
node_customer -->|"starts purchase"| node_purchase
node_home -->|"queries products"| node_db
node_home -->|"caches queries"| node_cache
node_home -->|"renders products"| node_productcard
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_scrolling
node_catalog -->|"queries products"| node_db
node_catalog -->|"uses cache"| node_cache
node_catalog -->|"renders products"| node_productcard
node_productcard -->|"formats price"| node_formatters
node_purchase -->|"loads product"| node_db
node_purchase -->|"renders form"| node_checkoutform
node_orderaction -->|"reads orders"| node_db
node_orderaction -->|"sends email"| node_historyemail
node_historyemail -->|"renders details"| node_orderinfo
node_receipt -->|"renders details"| node_orderinfo
node_webhook -->|"updates orders"| node_db
node_webhook -->|"sends receipt"| node_receipt
node_adminproducts -->|"queries products"| node_db
node_adminproducts -->|"formats values"| node_formatters
node_adminproducts -->|"renders actions"| node_productactions
node_productactions -->|"uses menu"| node_dropdown
node_productactions -.->|"edits through"| node_productform
node_adminorders -->|"queries orders"| node_db
node_adminorders -->|"formats values"| node_formatters
node_adminorders -->|"renders actions"| node_orderactions
node_orderactions -->|"uses menu"| node_dropdown
node_adminusers -->|"queries users"| node_db
node_adminorders -->|"renders table"| node_table
node_adminproducts -->|"renders table"| node_table
node_productcard -->|"uses card"| node_card
node_productcard -->|"uses button"| node_button
node_home -->|"uses button"| node_button
node_orderaction -->|"formats currency"| node_orderinfo

click node_home "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/page.tsx"
click node_catalog "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/products/page.tsx"
click node_productcard "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ProductCard.tsx"
click node_hero "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/HeroSection.tsx"
click node_scrolling "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ScrollingProductSection%20.tsx"
click node_purchase "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/products/%5Bid%5D/purchase/page.tsx"
click node_checkoutform "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/products/%5Bid%5D/purchase/_components/CheckoutForm.tsx"
click node_success "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/stripe/purchase-success/page.tsx"
click node_orderaction "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/actions/orders.tsx"
click node_orderspage "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/orders/page.tsx"
click node_historyemail "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/email/OrderHistory.tsx"
click node_orderinfo "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/email/components/OrderInformation.tsx"
click node_receipt "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/email/PurchaseReceipt.tsx"
click node_webhook "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/webhooks/stripe/route.tsx"
click node_adminproducts "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/page.tsx"
click node_productform "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/_components/ProductForm.tsx"
click node_productactions "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/_components/ProductActions.tsx"
click node_adminorders "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/orders/page.tsx"
click node_orderactions "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/orders/_components/OrderActions.tsx"
click node_adminusers "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/users/page.tsx"
click node_db "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/db/db.ts"
click node_cache "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/lib/cache.ts"
click node_formatters "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/lib/formatters.ts"
click node_button "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/button.tsx"
click node_card "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/card.tsx"
click node_dropdown "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/dropdown-menu.tsx"
click node_table "https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/table.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_catalog,node_productcard,node_hero,node_scrolling toneBlue
class node_purchase,node_checkoutform,node_success,node_orderaction,node_orderspage,node_historyemail,node_orderinfo,node_receipt,node_webhook toneAmber
class node_adminproducts,node_productform,node_productactions,node_adminorders,node_orderactions,node_adminusers toneMint
class node_db,node_cache,node_formatters,node_button,node_card,node_dropdown,node_table toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Home page](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/page.tsx): `src/app/(customerFacing)/page.tsx`
- [Product catalog](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/products/page.tsx): `src/app/(customerFacing)/products/page.tsx`
- [Product card](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`
- [Hero section](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/HeroSection.tsx): `src/components/HeroSection.tsx`
- [Featured carousel](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ScrollingProductSection%20.tsx): `src/components/ScrollingProductSection .tsx`

### Checkout and orders

- [Purchase page](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/products/%5Bid%5D/purchase/page.tsx): `src/app/(customerFacing)/products/[id]/purchase/page.tsx`
- [Checkout form](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/products/%5Bid%5D/purchase/_components/CheckoutForm.tsx): `src/app/(customerFacing)/products/[id]/purchase/_components/CheckoutForm.tsx`
- [Purchase success](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/stripe/purchase-success/page.tsx): `src/app/(customerFacing)/stripe/purchase-success/page.tsx`
- [Order history action](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/actions/orders.tsx): `src/actions/orders.tsx`
- [Order history page](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/(customerFacing)/orders/page.tsx): `src/app/(customerFacing)/orders/page.tsx`
- [History email](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/email/OrderHistory.tsx): `src/email/OrderHistory.tsx`
- [Order details](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/email/components/OrderInformation.tsx): `src/email/components/OrderInformation.tsx`
- [Purchase receipt](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/email/PurchaseReceipt.tsx): `src/email/PurchaseReceipt.tsx`
- [Stripe webhook](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/webhooks/stripe/route.tsx): `src/app/webhooks/stripe/route.tsx`

### Administration

- [Product management](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/page.tsx): `src/app/admin/products/page.tsx`
- [Product editor](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/_components/ProductForm.tsx): `src/app/admin/products/_components/ProductForm.tsx`
- [Product actions](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/products/_components/ProductActions.tsx): `src/app/admin/products/_components/ProductActions.tsx`
- [Order management](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/orders/page.tsx): `src/app/admin/orders/page.tsx`
- [Order actions](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/orders/_components/OrderActions.tsx): `src/app/admin/orders/_components/OrderActions.tsx`
- [User management](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/app/admin/users/page.tsx): `src/app/admin/users/page.tsx`

### Shared services

- [Prisma database](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/db/db.ts): `src/db/db.ts`
- [Page cache](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/lib/cache.ts): `src/lib/cache.ts`
- [Formatters](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/lib/formatters.ts): `src/lib/formatters.ts`
- [Button primitive](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/button.tsx): `src/components/ui/button.tsx`
- [Card primitive](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/card.tsx): `src/components/ui/card.tsx`
- [Dropdown primitive](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/dropdown-menu.tsx): `src/components/ui/dropdown-menu.tsx`
- [Table primitive](https://github.com/prajwal471/nayantara-ecommerce-website/blob/main/src/components/ui/table.tsx): `src/components/ui/table.tsx`

### Other components

- **Customer**

## Connections

- Customer → Home page: browses (evidence: `README.md`)
- Customer → Product catalog: browses (evidence: `README.md`)
- Customer → Purchase page: starts purchase
- Home page → Prisma database: queries products (evidence: `src/app/(customerFacing)/page.tsx`)
- Home page → Page cache: caches queries (evidence: `src/app/(customerFacing)/page.tsx`)
- Home page → Product card: renders products (evidence: `src/app/(customerFacing)/page.tsx`)
- Home page → Hero section: renders (evidence: `src/app/(customerFacing)/page.tsx`)
- Home page → Featured carousel: renders (evidence: `src/app/(customerFacing)/page.tsx`)
- Product catalog → Prisma database: queries products (evidence: `src/app/(customerFacing)/products/page.tsx`)
- Product catalog → Page cache: uses cache (evidence: `src/app/(customerFacing)/products/page.tsx`)
- Product catalog → Product card: renders products (evidence: `src/app/(customerFacing)/products/page.tsx`)
- Product card → Formatters: formats price (evidence: `src/components/ProductCard.tsx`)
- Purchase page → Prisma database: loads product (evidence: `src/app/(customerFacing)/products/[id]/purchase/page.tsx`)
- Purchase page → Checkout form: renders form (evidence: `src/app/(customerFacing)/products/[id]/purchase/page.tsx`)
- Order history action → Prisma database: reads orders (evidence: `src/actions/orders.tsx`)
- Order history action → History email: sends email (evidence: `src/actions/orders.tsx`)
- History email → Order details: renders details (evidence: `src/email/OrderHistory.tsx`)
- Purchase receipt → Order details: renders details (evidence: `src/email/PurchaseReceipt.tsx`)
- Stripe webhook → Prisma database: updates orders (evidence: `src/app/webhooks/stripe/route.tsx`)
- Stripe webhook → Purchase receipt: sends receipt (evidence: `src/app/webhooks/stripe/route.tsx`)
- Product management → Prisma database: queries products (evidence: `src/app/admin/products/page.tsx`)
- Product management → Formatters: formats values (evidence: `src/app/admin/products/page.tsx`)
- Product management → Product actions: renders actions (evidence: `src/app/admin/products/page.tsx`)
- Product actions → Dropdown primitive: uses menu (evidence: `src/app/admin/products/_components/ProductActions.tsx`)
- Product actions → Product editor: edits through
- Order management → Prisma database: queries orders (evidence: `src/app/admin/orders/page.tsx`)
- Order management → Formatters: formats values (evidence: `src/app/admin/orders/page.tsx`)
- Order management → Order actions: renders actions (evidence: `src/app/admin/orders/page.tsx`)
- Order actions → Dropdown primitive: uses menu (evidence: `src/app/admin/orders/_components/OrderActions.tsx`)
- User management → Prisma database: queries users (evidence: `src/app/admin/users/page.tsx`)
- Order management → Table primitive: renders table (evidence: `src/app/admin/orders/page.tsx`)
- Product management → Table primitive: renders table (evidence: `src/app/admin/products/page.tsx`)
- Product card → Card primitive: uses card (evidence: `src/components/ProductCard.tsx`)
- Product card → Button primitive: uses button (evidence: `src/components/ProductCard.tsx`)
- Home page → Button primitive: uses button (evidence: `src/app/(customerFacing)/page.tsx`)
- Order history action → Order details: formats currency (evidence: `src/email/components/OrderInformation.tsx`)
