# vishreastudio-dev/vishreastudio-v1 architecture

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

- Interactive diagram: https://gitdiagram.com/vishreastudio-dev/vishreastudio-v1
- Repository: https://github.com/vishreastudio-dev/vishreastudio-v1

## Overview

Vishrea Studio is a React storefront backed by an Express API and PostgreSQL for curated one-of-one womenswear and the Walkin Wardrobe membership. The customer path runs from browsing/search and account access through checkout and verified payment to orders; separate branches cover membership, gifts, exchanges and admin operations. The README documents these capabilities, while the excerpts and source index establish only selected internal calls, so unsampled subsystem links are omitted rather than inferred.

Main entry points: [`server.js`](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/server.js) (HTTP Server), [`lib/payments.js`](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/payments.js) (Payment Processing), [`lib/db.js`](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/db.js) (PostgreSQL), [`api/search.js`](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/search.js) (Search API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Storefront"]
  node_app["React App<br/>[App.jsx]"]
  node_storefront["Storefront Pages"]
  node_searchui["Search Overlay<br/>[SearchOverlay.jsx]"]
  node_clientapi["API Client<br/>[api.js]"]
end

subgraph group_api["API and Commerce"]
  node_server["HTTP Server<br/>[server.js]"]
  node_authapi["Authentication API<br/>[auth.js]"]
  node_catalogueapi["Catalogue API<br/>[catalogue.js]"]
  node_searchapi["Search API<br/>[search.js]"]
  node_checkoutapi["Checkout API<br/>[checkout.js]"]
  node_ordersapi["Orders API<br/>[orders.js]"]
  node_webhook["Razorpay Webhook<br/>[razorpay.js]"]
  node_payments["Payment Processing<br/>[payments.js]"]
  node_inventory["Inventory Holds<br/>[inventory.js]"]
end

subgraph group_member["Membership and Admin"]
  node_adminapi["Admin Operations<br/>[ops.js]"]
  node_billing["Membership Billing<br/>[billing.js]"]
  node_membership["Membership Engine<br/>[membership.js]"]
end

subgraph group_core["Platform Services"]
  node_settings["Business Settings<br/>[settings.js]"]
  node_database[("PostgreSQL<br/>[db.js]")]
  node_storage["Media Storage<br/>[storage.js]"]
end

node_customer(("Shopper"))
node_razorpay{{"Razorpay"}}
node_email{{"Email Provider"}}

node_customer -->|"browses"| node_app
node_app -->|"routes to"| node_storefront
node_storefront -->|"requests data"| node_clientapi
node_searchui -->|"queries"| node_clientapi
node_clientapi -->|"calls API"| node_server
node_server -->|"mounts routes"| node_authapi
node_server -.->|"mounts routes"| node_catalogueapi
node_server -.->|"mounts routes"| node_searchapi
node_server -.->|"mounts routes"| node_checkoutapi
node_server -.->|"mounts routes"| node_ordersapi
node_server -.->|"mounts routes"| node_webhook
node_server -.->|"mounts routes"| node_adminapi
node_searchapi -->|"queries"| node_database
node_searchapi -->|"uses catalogue logic"| node_catalogueapi
node_checkoutapi -.->|"holds stock"| node_inventory
node_checkoutapi -.->|"creates payment"| node_payments
node_webhook -->|"verifies payment"| node_payments
node_payments -->|"commits reservations"| node_inventory
node_payments -.->|"updates orders"| node_database
node_billing -.->|"runs billing"| node_razorpay
node_billing -->|"advances membership"| node_membership
node_membership -->|"reads rules"| node_settings
node_adminapi -->|"manages settings"| node_settings
node_adminapi -->|"queries"| node_database
node_authapi -.->|"sends codes"| node_email
node_storage -.->|"records media"| node_database

click node_app "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/vishrea-react/src/App.jsx"
click node_storefront "https://github.com/vishreastudio-dev/vishreastudio-v1/tree/main/vishrea-react/src/pages"
click node_searchui "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/vishrea-react/src/components/SearchOverlay.jsx"
click node_clientapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/vishrea-react/src/lib/api.js"
click node_server "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/server.js"
click node_authapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/auth.js"
click node_catalogueapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/catalogue.js"
click node_searchapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/search.js"
click node_checkoutapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/checkout.js"
click node_ordersapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/orders.js"
click node_webhook "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/webhooks/razorpay.js"
click node_adminapi "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/admin/ops.js"
click node_billing "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/billing.js"
click node_membership "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/membership.js"
click node_payments "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/payments.js"
click node_inventory "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/inventory.js"
click node_settings "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/settings.js"
click node_database "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/db.js"
click node_storage "https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/storage.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_app,node_storefront,node_searchui,node_clientapi toneBlue
class node_server,node_authapi,node_catalogueapi,node_searchapi,node_checkoutapi,node_ordersapi,node_webhook,node_payments,node_inventory toneAmber
class node_adminapi,node_billing,node_membership toneMint
class node_settings,node_database,node_storage toneRose
class node_customer,node_razorpay,node_email toneIndigo
```

## Components

### Storefront

- [React App](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/vishrea-react/src/App.jsx): `vishrea-react/src/App.jsx`
- [Storefront Pages](https://github.com/vishreastudio-dev/vishreastudio-v1/tree/main/vishrea-react/src/pages): `vishrea-react/src/pages`
- [Search Overlay](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/vishrea-react/src/components/SearchOverlay.jsx): `vishrea-react/src/components/SearchOverlay.jsx`
- [API Client](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/vishrea-react/src/lib/api.js): `vishrea-react/src/lib/api.js`

### API and Commerce

- [HTTP Server](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/server.js): `server.js`
- [Authentication API](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/auth.js): `api/auth.js`
- [Catalogue API](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/catalogue.js): `api/catalogue.js`
- [Search API](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/search.js): `api/search.js`
- [Checkout API](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/checkout.js): `api/checkout.js`
- [Orders API](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/orders.js): `api/orders.js`
- [Razorpay Webhook](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/webhooks/razorpay.js): `api/webhooks/razorpay.js`
- [Payment Processing](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/payments.js): `lib/payments.js`
- [Inventory Holds](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/inventory.js): `lib/inventory.js`

### Membership and Admin

- [Admin Operations](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/api/admin/ops.js): `api/admin/ops.js`
- [Membership Billing](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/billing.js): `lib/billing.js`
- [Membership Engine](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/membership.js): `lib/membership.js`

### Platform Services

- [Business Settings](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/settings.js): `lib/settings.js`
- [PostgreSQL](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/db.js): `lib/db.js`
- [Media Storage](https://github.com/vishreastudio-dev/vishreastudio-v1/blob/main/lib/storage.js): `lib/storage.js`

### Other components

- **Shopper**
- **Razorpay**
- **Email Provider**

## Connections

- Shopper → React App: browses (evidence: `README.md`)
- React App → Storefront Pages: routes to (evidence: `vishrea-react/src/App.jsx`)
- Storefront Pages → API Client: requests data (evidence: `README.md`)
- Search Overlay → API Client: queries (evidence: `vishrea-react/src/components/SearchOverlay.jsx`)
- API Client → HTTP Server: calls API (evidence: `README.md`)
- HTTP Server → Authentication API: mounts routes (evidence: `server.js`)
- HTTP Server → Catalogue API: mounts routes
- HTTP Server → Search API: mounts routes
- HTTP Server → Checkout API: mounts routes
- HTTP Server → Orders API: mounts routes
- HTTP Server → Razorpay Webhook: mounts routes (evidence: `server.js`)
- HTTP Server → Admin Operations: mounts routes
- Search API → PostgreSQL: queries (evidence: `api/search.js`)
- Search API → Catalogue API: uses catalogue logic (evidence: `api/search.js`)
- Checkout API → Inventory Holds: holds stock
- Checkout API → Payment Processing: creates payment
- Razorpay Webhook → Payment Processing: verifies payment (evidence: `api/webhooks/razorpay.js`)
- Payment Processing → Inventory Holds: commits reservations (evidence: `lib/payments.js`)
- Payment Processing → PostgreSQL: updates orders (evidence: `lib/payments.js`)
- Membership Billing → Razorpay: runs billing
- Membership Billing → Membership Engine: advances membership (evidence: `lib/billing.js`)
- Membership Engine → Business Settings: reads rules (evidence: `lib/membership.js`)
- Admin Operations → Business Settings: manages settings (evidence: `api/admin/ops.js`)
- Admin Operations → PostgreSQL: queries (evidence: `api/admin/ops.js`)
- Authentication API → Email Provider: sends codes
- Media Storage → PostgreSQL: records media (evidence: `lib/storage.js`)
