# prasad2995/flashwheels architecture

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

- Interactive diagram: https://gitdiagram.com/prasad2995/flashwheels
- Repository: https://github.com/prasad2995/flashwheels

## Overview

FlashWheels is a lightweight storefront for electric-vehicle parts, with browser-side cart and order handling, administrative/order-status pages, and Razorpay payment APIs. The apparent customer journey is browsing parts, adding them to a cart, placing an order, and checking its status; the provided excerpts confirm cart/order storage and payment operations but do not show how the HTML pages wire those steps together. A separate Supabase Edge Function provides payment verification, refunds, and payment timelines. Connections involving unsampled page integrations are therefore omitted.

Main entry points: [`cart.js`](https://github.com/prasad2995/flashwheels/blob/main/cart.js) (Cart and checkout), [`server.js`](https://github.com/prasad2995/flashwheels/blob/main/server.js) (Payment API), [`supabase/functions/node-api/index.ts`](https://github.com/prasad2995/flashwheels/blob/main/supabase/functions/node-api/index.ts) (Edge payment API), [`config.js`](https://github.com/prasad2995/flashwheels/blob/main/config.js) (Supabase client setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_parts_catalog["Parts catalog<br/>[parts-data.js]"]
  node_storefront_page["Storefront page<br/>[index.html]"]
  node_cart_page["Cart page<br/>[cart.html]"]
end

subgraph group_orders["Cart and Orders"]
  node_cart_logic["Cart and checkout<br/>[cart.js]"]
  node_browser_storage[("Browser storage")]
  node_order_status["Order status<br/>[order-status.html]"]
end

subgraph group_payments["Payments"]
  node_payment_api["Payment API<br/>[server.js]"]
  node_edge_payment_api["Edge payment API<br/>[index.ts]"]
  node_supabase_client["Supabase client setup<br/>[config.js]"]
end

subgraph group_operations["Operations"]
  node_admin_page["Admin page<br/>[index.html]"]
  node_dashboard["Order dashboard<br/>[dashboard.html]"]
end

node_customer(("Customer"))
node_razorpay["Razorpay"]

node_customer -.->|"browses"| node_storefront_page
node_cart_logic -->|"reads and writes"| node_browser_storage
node_payment_api -->|"creates orders"| node_razorpay
node_edge_payment_api -->|"manages payments"| node_razorpay
node_supabase_client -.-> node_razorpay

click node_parts_catalog "https://github.com/prasad2995/flashwheels/blob/main/parts-data.js"
click node_storefront_page "https://github.com/prasad2995/flashwheels/blob/main/index/index.html"
click node_cart_page "https://github.com/prasad2995/flashwheels/blob/main/cart.html"
click node_cart_logic "https://github.com/prasad2995/flashwheels/blob/main/cart.js"
click node_order_status "https://github.com/prasad2995/flashwheels/blob/main/order-status.html"
click node_admin_page "https://github.com/prasad2995/flashwheels/blob/main/admin/index.html"
click node_dashboard "https://github.com/prasad2995/flashwheels/blob/main/dashboard.html"
click node_payment_api "https://github.com/prasad2995/flashwheels/blob/main/server.js"
click node_edge_payment_api "https://github.com/prasad2995/flashwheels/blob/main/supabase/functions/node-api/index.ts"
click node_supabase_client "https://github.com/prasad2995/flashwheels/blob/main/config.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_parts_catalog,node_storefront_page,node_cart_page toneBlue
class node_cart_logic,node_browser_storage,node_order_status toneAmber
class node_payment_api,node_edge_payment_api,node_supabase_client toneMint
class node_admin_page,node_dashboard toneRose
class node_customer,node_razorpay toneIndigo
```

## Components

### Storefront

- [Parts catalog](https://github.com/prasad2995/flashwheels/blob/main/parts-data.js): `parts-data.js`
- [Storefront page](https://github.com/prasad2995/flashwheels/blob/main/index/index.html): `index/index.html`
- [Cart page](https://github.com/prasad2995/flashwheels/blob/main/cart.html): `cart.html`

### Cart and Orders

- [Cart and checkout](https://github.com/prasad2995/flashwheels/blob/main/cart.js): `cart.js`
- **Browser storage**
- [Order status](https://github.com/prasad2995/flashwheels/blob/main/order-status.html): `order-status.html`

### Payments

- [Payment API](https://github.com/prasad2995/flashwheels/blob/main/server.js): `server.js`
- [Edge payment API](https://github.com/prasad2995/flashwheels/blob/main/supabase/functions/node-api/index.ts): `supabase/functions/node-api/index.ts`
- [Supabase client setup](https://github.com/prasad2995/flashwheels/blob/main/config.js): `config.js`

### Operations

- [Admin page](https://github.com/prasad2995/flashwheels/blob/main/admin/index.html): `admin/index.html`
- [Order dashboard](https://github.com/prasad2995/flashwheels/blob/main/dashboard.html): `dashboard.html`

### Other components

- **Customer**
- **Razorpay**

## Connections

- Customer → Storefront page: browses
- Cart and checkout → Browser storage: reads and writes (evidence: `cart.js`)
- Payment API → Razorpay: creates orders (evidence: `server.js`)
- Edge payment API → Razorpay: manages payments (evidence: `supabase/functions/node-api/index.ts`)
- Supabase client setup → Razorpay
