# fahad09belal/delune-fashion- architecture

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

- Interactive diagram: https://gitdiagram.com/fahad09belal/delune-fashion-
- Repository: https://github.com/fahad09belal/delune-fashion-

## Overview

DeLune is a Bangladesh fashion storefront: shoppers browse products, select a variant, and initiate an order; checkout submits delivery-payment details for merchant review and customer notification. Separate branches support catalogue moderation and merchant account/order administration. Supabase stores shared catalogue and commerce data, while the guest cart uses browser storage. The checkout and merchant API calls are shown in excerpts; broader storefront and moderation links rely on README descriptions, and unsampled modules were not inspected.

Main entry points: [`store.js`](https://github.com/fahad09belal/delune-fashion-/blob/main/store.js) (Store Data Access), [`supabase/functions/delune-api/index.ts`](https://github.com/fahad09belal/delune-fashion-/blob/main/supabase/functions/delune-api/index.ts) (Commerce API), [`supabase-schema.sql`](https://github.com/fahad09belal/delune-fashion-/blob/main/supabase-schema.sql) (Supabase Data), [`checkout.js`](https://github.com/fahad09belal/delune-fashion-/blob/main/checkout.js) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Catalogue<br/>[categories.html]"]
  node_product_detail["Product Detail<br/>[app.js]"]
  node_store["Store Data Access<br/>[store.js]"]
  node_cart["Guest Cart<br/>[cart.js]"]
  node_cart_badge["Cart Badge<br/>[cart-ui.js]"]
end

subgraph group_commerce["Order Operations"]
  node_checkout["Checkout<br/>[checkout.js]"]
  node_merchant["Merchant Portal<br/>[merchant.js]"]
end

subgraph group_admin["Administration"]
  node_moderator["Moderator Studio<br/>[moderate.js]"]
  node_creator_ops["Creator Operations<br/>[index.ts]"]
end

subgraph group_platform["Supabase Platform"]
  node_api["Commerce API<br/>[index.ts]"]
  node_database[("Supabase Data")]
end

node_shopper(("Shopper"))
node_whatsapp(("WhatsApp"))
node_supabase(("Supabase"))

node_shopper -->|"browses"| node_catalog
node_shopper -->|"selects product"| node_product_detail
node_product_detail -->|"loads product"| node_store
node_store -->|"reads catalogue"| node_database
node_shopper -.->|"manages items"| node_cart
node_cart_badge -->|"reads cart count"| node_cart
node_shopper -->|"submits payment"| node_checkout
node_checkout -->|"loads product"| node_store
node_checkout -->|"creates order"| node_api
node_api -->|"writes orders"| node_database
node_merchant -->|"reviews orders"| node_api
node_merchant -->|"opens message"| node_whatsapp
node_shopper -->|"enquires"| node_whatsapp
node_moderator -->|"manages catalogue"| node_database
node_creator_ops -->|"manages merchants"| node_database
node_supabase -->|"provides client"| node_store
node_supabase -->|"hosts function"| node_api

click node_catalog "https://github.com/fahad09belal/delune-fashion-/blob/main/categories.html"
click node_product_detail "https://github.com/fahad09belal/delune-fashion-/blob/main/app.js"
click node_store "https://github.com/fahad09belal/delune-fashion-/blob/main/store.js"
click node_cart "https://github.com/fahad09belal/delune-fashion-/blob/main/cart.js"
click node_cart_badge "https://github.com/fahad09belal/delune-fashion-/blob/main/cart-ui.js"
click node_checkout "https://github.com/fahad09belal/delune-fashion-/blob/main/checkout.js"
click node_merchant "https://github.com/fahad09belal/delune-fashion-/blob/main/merchant.js"
click node_moderator "https://github.com/fahad09belal/delune-fashion-/blob/main/moderate.js"
click node_creator_ops "https://github.com/fahad09belal/delune-fashion-/blob/main/supabase/functions/delune-api/index.ts"
click node_api "https://github.com/fahad09belal/delune-fashion-/blob/main/supabase/functions/delune-api/index.ts"
click node_database "https://github.com/fahad09belal/delune-fashion-/blob/main/supabase-schema.sql"

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_detail,node_store,node_cart,node_cart_badge toneBlue
class node_checkout,node_merchant toneAmber
class node_moderator,node_creator_ops toneMint
class node_api,node_database toneRose
class node_shopper,node_whatsapp,node_supabase toneIndigo
```

## Components

### Storefront

- [Catalogue](https://github.com/fahad09belal/delune-fashion-/blob/main/categories.html): `categories.html`
- [Product Detail](https://github.com/fahad09belal/delune-fashion-/blob/main/app.js): `app.js`
- [Store Data Access](https://github.com/fahad09belal/delune-fashion-/blob/main/store.js): `store.js`
- [Guest Cart](https://github.com/fahad09belal/delune-fashion-/blob/main/cart.js): `cart.js`
- [Cart Badge](https://github.com/fahad09belal/delune-fashion-/blob/main/cart-ui.js): `cart-ui.js`

### Order Operations

- [Checkout](https://github.com/fahad09belal/delune-fashion-/blob/main/checkout.js): `checkout.js`
- [Merchant Portal](https://github.com/fahad09belal/delune-fashion-/blob/main/merchant.js): `merchant.js`

### Administration

- [Moderator Studio](https://github.com/fahad09belal/delune-fashion-/blob/main/moderate.js): `moderate.js`
- [Creator Operations](https://github.com/fahad09belal/delune-fashion-/blob/main/supabase/functions/delune-api/index.ts): `supabase/functions/delune-api/index.ts`

### Supabase Platform

- [Commerce API](https://github.com/fahad09belal/delune-fashion-/blob/main/supabase/functions/delune-api/index.ts): `supabase/functions/delune-api/index.ts`
- [Supabase Data](https://github.com/fahad09belal/delune-fashion-/blob/main/supabase-schema.sql): `supabase-schema.sql`

### Other components

- **Shopper**
- **WhatsApp**
- **Supabase**

## Connections

- Shopper → Catalogue: browses (evidence: `README.md`)
- Shopper → Product Detail: selects product (evidence: `README.md`)
- Product Detail → Store Data Access: loads product (evidence: `app.js`)
- Store Data Access → Supabase Data: reads catalogue (evidence: `store.js`)
- Shopper → Guest Cart: manages items
- Cart Badge → Guest Cart: reads cart count (evidence: `cart-ui.js`)
- Shopper → Checkout: submits payment (evidence: `README.md`)
- Checkout → Store Data Access: loads product (evidence: `checkout.js`)
- Checkout → Commerce API: creates order (evidence: `checkout.js`)
- Commerce API → Supabase Data: writes orders (evidence: `supabase/functions/delune-api/index.ts`)
- Merchant Portal → Commerce API: reviews orders (evidence: `merchant.js`)
- Merchant Portal → WhatsApp: opens message (evidence: `merchant.js`)
- Shopper → WhatsApp: enquires (evidence: `README.md`)
- Moderator Studio → Supabase Data: manages catalogue (evidence: `moderate.js`)
- Creator Operations → Supabase Data: manages merchants (evidence: `supabase/functions/delune-api/index.ts`)
- Supabase → Store Data Access: provides client (evidence: `README.md`)
- Supabase → Commerce API: hosts function (evidence: `README.md`)
