# anmolpatel009/prakrati-maitri architecture

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

- Interactive diagram: https://gitdiagram.com/anmolpatel009/prakrati-maitri
- Repository: https://github.com/anmolpatel009/prakrati-maitri

## Overview

This is a sustainable-goods storefront with product discovery, cart and checkout, plus account, payment, and custom/bulk enquiry capabilities. Its principal purchase workflow runs from browsing and cart management through checkout preparation, then into order creation and payment. The excerpts verify cart use, checkout preparation, and Supabase access; most other routes are unsampled, so their connections are shown as unverified rather than asserted.

Main entry points: [`lib/supabase/server.ts`](https://github.com/anmolpatel009/prakrati-maitri/blob/main/lib/supabase/server.ts) (Server database client), [`app/checkout/page.tsx`](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/page.tsx) (Checkout details), [`app/checkout/payment/page.tsx`](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/payment/page.tsx) (Payment and review), [`app/api/orders/create/route.ts`](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/orders/create/route.ts) (Order creation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Shop and collections<br/>[ShopClient.tsx]"]
  node_product["Product details<br/>[page.tsx]"]
end

subgraph group_purchase["Purchase flow"]
  node_cart["Cart state<br/>[CartProvider.tsx]"]
  node_checkout["Checkout details<br/>[page.tsx]"]
  node_checkout_prepare["Cart verification and pricing<br/>[route.ts]"]
  node_payment_pages["Payment and review<br/>[page.tsx]"]
  node_order_create["Order creation<br/>[route.ts]"]
  node_payment_api["Razorpay payment routes<br/>[route.ts]"]
  node_payment_verify["Payment verification and webhook<br/>[route.ts]"]
  node_order_success["Order confirmation<br/>[page.tsx]"]
end

subgraph group_accounts["Accounts"]
  node_account["Customer account and orders<br/>[page.tsx]"]
  node_auth["Sign-in and registration<br/>[LoginForm.tsx]"]
end

subgraph group_enquiries["Custom and bulk enquiries"]
  node_bulk_enquiry["Bulk order enquiry<br/>[route.ts]"]
  node_bulk_upload["Bulk reference upload<br/>[route.ts]"]
  node_custom_bags["Custom bag requests<br/>[route.ts]"]
  node_wedding_enquiry["Wedding gift enquiries<br/>[route.ts]"]
end

subgraph group_platform["Data and integrations"]
  node_supabase_client["Server database client<br/>[server.ts]"]
  node_database[("Supabase data store")]
  node_razorpay["Razorpay"]
end

node_shopper(("Shopper"))

node_shopper -.->|"browses"| node_catalog
node_catalog -.->|"opens product"| node_product
node_shopper -.->|"adds items"| node_cart
node_checkout -->|"reads cart"| node_cart
node_checkout -->|"requests verification"| node_checkout_prepare
node_checkout_prepare -->|"creates client"| node_supabase_client
node_supabase_client -.->|"accesses data"| node_database
node_checkout -.->|"continues checkout"| node_payment_pages
node_payment_pages -.->|"submits order"| node_order_create
node_order_create -->|"creates client"| node_supabase_client
node_payment_pages -.->|"starts payment"| node_payment_api
node_payment_api -.->|"creates payment"| node_razorpay
node_payment_verify -.->|"verifies payment"| node_razorpay
node_order_create -.->|"returns order"| node_order_success
node_shopper -.->|"manages orders"| node_account
node_shopper -.->|"signs in"| node_auth
node_shopper -.->|"submits enquiry"| node_bulk_enquiry
node_bulk_upload -.->|"provides reference"| node_bulk_enquiry
node_bulk_enquiry -->|"creates client"| node_supabase_client
node_shopper -.->|"requests customization"| node_custom_bags
node_shopper -.->|"submits enquiry"| node_wedding_enquiry

click node_catalog "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/shop/ShopClient.tsx"
click node_product "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/products/%5Bslug%5D/page.tsx"
click node_cart "https://github.com/anmolpatel009/prakrati-maitri/blob/main/components/cart/CartProvider.tsx"
click node_checkout "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/page.tsx"
click node_checkout_prepare "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/checkout/prepare/route.ts"
click node_payment_pages "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/payment/page.tsx"
click node_order_create "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/orders/create/route.ts"
click node_payment_api "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/payments/razorpay/create/route.ts"
click node_payment_verify "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/payments/razorpay/verify/route.ts"
click node_order_success "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/success/page.tsx"
click node_account "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/account/page.tsx"
click node_auth "https://github.com/anmolpatel009/prakrati-maitri/blob/main/components/auth/LoginForm.tsx"
click node_bulk_enquiry "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/bulk-order/route.ts"
click node_bulk_upload "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/bulk-order/reference-upload/route.ts"
click node_custom_bags "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/custom-bags/route.ts"
click node_wedding_enquiry "https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/wedding-return-gift-enquiries/route.ts"
click node_supabase_client "https://github.com/anmolpatel009/prakrati-maitri/blob/main/lib/supabase/server.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 toneBlue
class node_cart,node_checkout,node_checkout_prepare,node_payment_pages,node_order_create,node_payment_api,node_payment_verify,node_order_success toneAmber
class node_account,node_auth toneMint
class node_bulk_enquiry,node_bulk_upload,node_custom_bags,node_wedding_enquiry toneRose
class node_supabase_client,node_database,node_razorpay,node_shopper toneIndigo
```

## Components

### Storefront

- [Shop and collections](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/shop/ShopClient.tsx): `app/shop/ShopClient.tsx`
- [Product details](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/products/%5Bslug%5D/page.tsx): `app/products/[slug]/page.tsx`

### Purchase flow

- [Cart state](https://github.com/anmolpatel009/prakrati-maitri/blob/main/components/cart/CartProvider.tsx): `components/cart/CartProvider.tsx`
- [Checkout details](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/page.tsx): `app/checkout/page.tsx`
- [Cart verification and pricing](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/checkout/prepare/route.ts): `app/api/checkout/prepare/route.ts`
- [Payment and review](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/payment/page.tsx): `app/checkout/payment/page.tsx`
- [Order creation](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/orders/create/route.ts): `app/api/orders/create/route.ts`
- [Razorpay payment routes](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/payments/razorpay/create/route.ts): `app/api/payments/razorpay/create/route.ts`
- [Payment verification and webhook](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/payments/razorpay/verify/route.ts): `app/api/payments/razorpay/verify/route.ts`
- [Order confirmation](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/checkout/success/page.tsx): `app/checkout/success/page.tsx`

### Accounts

- [Customer account and orders](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/account/page.tsx): `app/account/page.tsx`
- [Sign-in and registration](https://github.com/anmolpatel009/prakrati-maitri/blob/main/components/auth/LoginForm.tsx): `components/auth/LoginForm.tsx`

### Custom and bulk enquiries

- [Bulk order enquiry](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/bulk-order/route.ts): `app/api/bulk-order/route.ts`
- [Bulk reference upload](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/bulk-order/reference-upload/route.ts): `app/api/bulk-order/reference-upload/route.ts`
- [Custom bag requests](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/custom-bags/route.ts): `app/api/custom-bags/route.ts`
- [Wedding gift enquiries](https://github.com/anmolpatel009/prakrati-maitri/blob/main/app/api/wedding-return-gift-enquiries/route.ts): `app/api/wedding-return-gift-enquiries/route.ts`

### Data and integrations

- [Server database client](https://github.com/anmolpatel009/prakrati-maitri/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- **Supabase data store**
- **Razorpay**

### Other components

- **Shopper**

## Connections

- Shopper → Shop and collections: browses
- Shop and collections → Product details: opens product
- Shopper → Cart state: adds items
- Checkout details → Cart state: reads cart (evidence: `app/checkout/page.tsx`)
- Checkout details → Cart verification and pricing: requests verification (evidence: `app/checkout/page.tsx`)
- Cart verification and pricing → Server database client: creates client (evidence: `app/api/checkout/prepare/route.ts`)
- Server database client → Supabase data store: accesses data
- Checkout details → Payment and review: continues checkout
- Payment and review → Order creation: submits order
- Order creation → Server database client: creates client (evidence: `app/api/orders/create/route.ts`)
- Payment and review → Razorpay payment routes: starts payment
- Razorpay payment routes → Razorpay: creates payment
- Payment verification and webhook → Razorpay: verifies payment
- Order creation → Order confirmation: returns order
- Shopper → Customer account and orders: manages orders
- Shopper → Sign-in and registration: signs in
- Shopper → Bulk order enquiry: submits enquiry
- Bulk reference upload → Bulk order enquiry: provides reference
- Bulk order enquiry → Server database client: creates client (evidence: `app/api/bulk-order/route.ts`)
- Shopper → Custom bag requests: requests customization
- Shopper → Wedding gift enquiries: submits enquiry
