# bhimnath/cakeonwheels architecture

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

- Interactive diagram: https://gitdiagram.com/bhimnath/cakeonwheels
- Repository: https://github.com/bhimnath/cakeonwheels

## Overview

Cake on Wheels is a responsive cake marketplace with buyer ordering, seller listing and order management, and administrator oversight. The main buyer flow is browsing and selecting a cake, managing a cart, then checking out with the documented Cash on Delivery option. React page routing and shared application state coordinate the experience; that state uses Supabase when configured and falls back to browser storage. README capabilities include discounts, order-stage tracking, promotions, and logistics controls. The API/server and some dashboard behavior are included as product components, but their internal connections are not inferred from filenames.

Main entry points: [`src/App.jsx`](https://github.com/bhimnath/cakeonwheels/blob/main/src/App.jsx) (Page Router), [`src/context/AppContext.jsx`](https://github.com/bhimnath/cakeonwheels/blob/main/src/context/AppContext.jsx) (Marketplace State), [`src/pages/Home.jsx`](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Home.jsx) (Cake Catalog), [`src/components/CakeCard.jsx`](https://github.com/bhimnath/cakeonwheels/blob/main/src/components/CakeCard.jsx) (Cake Card)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Buyer Shopping"]
  node_app["Page Router<br/>[App.jsx]"]
  node_home["Cake Catalog<br/>[Home.jsx]"]
  node_card["Cake Card<br/>[CakeCard.jsx]"]
  node_details["Cake Details<br/>[CakeDetails.jsx]"]
  node_cart["Shopping Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_buyer_dashboard["Buyer Dashboard<br/>[BuyerDashboard.jsx]"]
end

subgraph group_accounts["Accounts and Operations"]
  node_auth["Buyer Auth<br/>[Auth.jsx]"]
  node_seller_auth["Seller Auth<br/>[SellerAuth.jsx]"]
  node_partner_auth["Partner Portal<br/>[PartnerAuth.jsx]"]
  node_seller_dashboard["Seller Dashboard"]
  node_admin_auth["Admin Auth<br/>[AdminAuth.jsx]"]
  node_admin_dashboard["Admin Dashboard<br/>[AdminDashboard.jsx]"]
end

subgraph group_state["Application State"]
  node_context["Marketplace State<br/>[AppContext.jsx]"]
end

subgraph group_runtime["Runtime Services"]
  node_browser_store[("Browser Storage")]
  node_supabase_client["Supabase Client<br/>[supabaseClient.js]"]
  node_supabase[("Supabase")]
  node_api["API Service<br/>[index.js]"]
  node_server["Server Service<br/>[server.js]"]
end

node_buyer(("Buyer"))

node_buyer -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_seller_auth
node_app -->|"routes to"| node_admin_auth
node_app -->|"routes to"| node_partner_auth
node_app -->|"routes to"| node_buyer_dashboard
node_app -->|"routes to"| node_seller_dashboard
node_app -->|"routes to"| node_admin_dashboard
node_app -->|"provides state"| node_context
node_home -->|"renders"| node_card
node_card -->|"adds to cart"| node_context
node_auth -->|"authenticates via"| node_context
node_seller_auth -->|"authenticates via"| node_context
node_partner_auth -->|"authenticates via"| node_context
node_admin_auth -->|"authenticates via"| node_context
node_buyer_dashboard -->|"uses state"| node_context
node_seller_dashboard -->|"uses state"| node_context
node_admin_dashboard -->|"uses state"| node_context
node_details -->|"uses state"| node_context
node_cart -->|"uses state"| node_context
node_checkout -->|"uses state"| node_context
node_context -->|"uses client"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_context -->|"persists locally"| node_browser_store

click node_app "https://github.com/bhimnath/cakeonwheels/blob/main/src/App.jsx"
click node_home "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Home.jsx"
click node_card "https://github.com/bhimnath/cakeonwheels/blob/main/src/components/CakeCard.jsx"
click node_details "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/CakeDetails.jsx"
click node_cart "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Cart.jsx"
click node_checkout "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Checkout.jsx"
click node_buyer_dashboard "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/BuyerDashboard.jsx"
click node_auth "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Auth.jsx"
click node_seller_auth "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/SellerAuth.jsx"
click node_partner_auth "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/PartnerAuth.jsx"
click node_seller_dashboard "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/SellerDashboard.jsx"
click node_admin_auth "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/AdminAuth.jsx"
click node_admin_dashboard "https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/AdminDashboard.jsx"
click node_context "https://github.com/bhimnath/cakeonwheels/blob/main/src/context/AppContext.jsx"
click node_supabase_client "https://github.com/bhimnath/cakeonwheels/blob/main/src/supabaseClient.js"
click node_api "https://github.com/bhimnath/cakeonwheels/blob/main/api/index.js"
click node_server "https://github.com/bhimnath/cakeonwheels/blob/main/server.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_home,node_card,node_details,node_cart,node_checkout,node_buyer_dashboard toneBlue
class node_auth,node_seller_auth,node_partner_auth,node_seller_dashboard,node_admin_auth,node_admin_dashboard toneAmber
class node_context toneMint
class node_browser_store,node_supabase_client,node_supabase,node_api,node_server toneRose
class node_buyer toneIndigo
```

## Components

### Buyer Shopping

- [Page Router](https://github.com/bhimnath/cakeonwheels/blob/main/src/App.jsx): `src/App.jsx`
- [Cake Catalog](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Cake Card](https://github.com/bhimnath/cakeonwheels/blob/main/src/components/CakeCard.jsx): `src/components/CakeCard.jsx`
- [Cake Details](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/CakeDetails.jsx): `src/pages/CakeDetails.jsx`
- [Shopping Cart](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Cart.jsx): `src/pages/Cart.jsx`
- [Checkout](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Checkout.jsx): `src/pages/Checkout.jsx`
- [Buyer Dashboard](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/BuyerDashboard.jsx): `src/pages/BuyerDashboard.jsx`

### Accounts and Operations

- [Buyer Auth](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/Auth.jsx): `src/pages/Auth.jsx`
- [Seller Auth](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/SellerAuth.jsx): `src/pages/SellerAuth.jsx`
- [Partner Portal](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/PartnerAuth.jsx): `src/pages/PartnerAuth.jsx`
- [Seller Dashboard](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/SellerDashboard.jsx): `src/pages/SellerDashboard.jsx`
- [Admin Auth](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/AdminAuth.jsx): `src/pages/AdminAuth.jsx`
- [Admin Dashboard](https://github.com/bhimnath/cakeonwheels/blob/main/src/pages/AdminDashboard.jsx): `src/pages/AdminDashboard.jsx`

### Application State

- [Marketplace State](https://github.com/bhimnath/cakeonwheels/blob/main/src/context/AppContext.jsx): `src/context/AppContext.jsx`

### Runtime Services

- **Browser Storage**
- [Supabase Client](https://github.com/bhimnath/cakeonwheels/blob/main/src/supabaseClient.js): `src/supabaseClient.js`
- **Supabase**
- [API Service](https://github.com/bhimnath/cakeonwheels/blob/main/api/index.js): `api/index.js`
- [Server Service](https://github.com/bhimnath/cakeonwheels/blob/main/server.js): `server.js`

### Other components

- **Buyer**

## Connections

- Buyer → Page Router: uses
- Page Router → Cake Catalog: routes to (evidence: `src/App.jsx`)
- Page Router → Cake Details: routes to (evidence: `src/App.jsx`)
- Page Router → Shopping Cart: routes to (evidence: `src/App.jsx`)
- Page Router → Checkout: routes to (evidence: `src/App.jsx`)
- Page Router → Buyer Auth: routes to (evidence: `src/App.jsx`)
- Page Router → Seller Auth: routes to (evidence: `src/App.jsx`)
- Page Router → Admin Auth: routes to (evidence: `src/App.jsx`)
- Page Router → Partner Portal: routes to (evidence: `src/App.jsx`)
- Page Router → Buyer Dashboard: routes to (evidence: `src/App.jsx`)
- Page Router → Seller Dashboard: routes to (evidence: `src/App.jsx`)
- Page Router → Admin Dashboard: routes to (evidence: `src/App.jsx`)
- Page Router → Marketplace State: provides state (evidence: `src/App.jsx`)
- Cake Catalog → Cake Card: renders (evidence: `src/pages/Home.jsx`)
- Cake Card → Marketplace State: adds to cart (evidence: `src/components/CakeCard.jsx`)
- Buyer Auth → Marketplace State: authenticates via (evidence: `src/pages/Auth.jsx`)
- Seller Auth → Marketplace State: authenticates via (evidence: `src/pages/SellerAuth.jsx`)
- Partner Portal → Marketplace State: authenticates via (evidence: `src/pages/PartnerAuth.jsx`)
- Admin Auth → Marketplace State: authenticates via (evidence: `src/pages/AdminAuth.jsx`)
- Buyer Dashboard → Marketplace State: uses state (evidence: `src/pages/BuyerDashboard.jsx`)
- Seller Dashboard → Marketplace State: uses state (evidence: `src/pages/SellerDashboard.jsx`)
- Admin Dashboard → Marketplace State: uses state (evidence: `src/pages/AdminDashboard.jsx`)
- Cake Details → Marketplace State: uses state (evidence: `src/pages/CakeDetails.jsx`)
- Shopping Cart → Marketplace State: uses state (evidence: `src/pages/Cart.jsx`)
- Checkout → Marketplace State: uses state (evidence: `src/pages/Checkout.jsx`)
- Marketplace State → Supabase Client: uses client (evidence: `src/context/AppContext.jsx`)
- Supabase Client → Supabase: connects to (evidence: `src/supabaseClient.js`)
- Marketplace State → Browser Storage: persists locally (evidence: `src/context/AppContext.jsx`)
