# sangralrahul/zyphix architecture

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

- Interactive diagram: https://gitdiagram.com/sangralrahul/zyphix
- Repository: https://github.com/sangralrahul/zyphix

## Overview

Zyphix is a hyperlocal commerce platform for groceries, restaurant meals, pharmacy goods, and neighbourhood partners. The documented customer journey is location setup, nearby discovery, ordering, and fulfilment tracking; the artifact application exposes corresponding discovery, product, cart, checkout, and confirmation screens. Authentication and shared commerce state form an internal application layer. The tree also contains API and Supabase function implementations, but their runtime wiring to the commerce UI is not established by the excerpts, so those links are omitted.

Main entry points: [`artifacts/zyphix/src/App.tsx`](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/App.tsx) (Commerce app), [`artifacts/api-server/src/routes/index.ts`](https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/index.ts) (API router), [`artifacts/zyphix/src/pages/ZyphixNow.tsx`](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ZyphixNow.tsx) (Local discovery), [`artifacts/zyphix/src/pages/ProductDetail.tsx`](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ProductDetail.tsx) (Product detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Customer commerce"]
  node_app["Commerce app<br/>[App.tsx]"]
  node_discovery["Local discovery<br/>[ZyphixNow.tsx]"]
  node_product["Product detail<br/>[ProductDetail.tsx]"]
  node_cart["Cart<br/>[Cart.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_confirmation["Order confirmation"]
  node_eats["Restaurant discovery<br/>[ZyphixEats.tsx]"]
  node_map["Kirana map<br/>[KiranaMap.tsx]"]
end

subgraph group_identity["Identity and state"]
  node_account["Account<br/>[Account.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_authui["Auth modal<br/>[AuthModal.tsx]"]
  node_commerce_state["Commerce state<br/>[CartContext.tsx]"]
end

subgraph group_partners["Partner operations"]
  node_partner["Partner onboarding<br/>[PartnerLanding.tsx]"]
  node_partner_setup["Merchant setup<br/>[MerchantSetup.tsx]"]
  node_partner_dashboard["Partner dashboard"]
end

subgraph group_services["Platform services"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_api_router["API router<br/>[index.ts]"]
  node_otp["Email OTP<br/>[email-otp.ts]"]
  node_notify["Notifications API<br/>[notify.ts]"]
  node_register["Partner registration API"]
end

node_customer(("Customer"))
node_fulfilment(("Local fulfilment"))

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_confirmation
node_app -->|"routes to"| node_eats
node_app -->|"routes to"| node_map
node_app -->|"routes to"| node_partner
node_app -->|"routes to"| node_partner_setup
node_app -->|"routes to"| node_partner_dashboard
node_app -->|"provides state"| node_auth
node_app -->|"provides state"| node_commerce_state
node_app -->|"renders"| node_authui
node_customer -->|"sets location"| node_discovery
node_discovery -->|"selects item"| node_product
node_product -->|"adds to order"| node_cart
node_cart -->|"places order"| node_checkout
node_checkout -->|"confirms order"| node_confirmation
node_confirmation -->|"tracks delivery"| node_fulfilment
node_api_router -->|"dispatches"| node_otp
node_api_router -->|"dispatches"| node_notify
node_api_router -->|"dispatches"| node_register
node_partner -.->|"continues setup"| node_partner_setup

click node_app "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/App.tsx"
click node_discovery "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ZyphixNow.tsx"
click node_product "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ProductDetail.tsx"
click node_cart "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/Cart.tsx"
click node_checkout "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/Checkout.tsx"
click node_confirmation "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/OrderConfirmation.tsx"
click node_eats "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ZyphixEats.tsx"
click node_map "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/KiranaMap.tsx"
click node_account "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/Account.tsx"
click node_auth "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/context/AuthContext.tsx"
click node_authui "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/components/AuthModal.tsx"
click node_commerce_state "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/context/CartContext.tsx"
click node_supabase "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/integrations/supabase/client.ts"
click node_partner "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/PartnerLanding.tsx"
click node_partner_setup "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/MerchantSetup.tsx"
click node_partner_dashboard "https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/PartnerDashboard.tsx"
click node_api_router "https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/index.ts"
click node_otp "https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/email-otp.ts"
click node_notify "https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/notify.ts"
click node_register "https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/partner-register.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_app,node_discovery,node_product,node_cart,node_checkout,node_confirmation,node_eats,node_map toneBlue
class node_account,node_auth,node_authui,node_commerce_state toneAmber
class node_partner,node_partner_setup,node_partner_dashboard toneMint
class node_supabase,node_api_router,node_otp,node_notify,node_register toneRose
class node_customer,node_fulfilment toneIndigo
```

## Components

### Customer commerce

- [Commerce app](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/App.tsx): `artifacts/zyphix/src/App.tsx`
- [Local discovery](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ZyphixNow.tsx): `artifacts/zyphix/src/pages/ZyphixNow.tsx`
- [Product detail](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ProductDetail.tsx): `artifacts/zyphix/src/pages/ProductDetail.tsx`
- [Cart](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/Cart.tsx): `artifacts/zyphix/src/pages/Cart.tsx`
- [Checkout](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/Checkout.tsx): `artifacts/zyphix/src/pages/Checkout.tsx`
- [Order confirmation](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/OrderConfirmation.tsx): `artifacts/zyphix/src/pages/OrderConfirmation.tsx`
- [Restaurant discovery](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/ZyphixEats.tsx): `artifacts/zyphix/src/pages/ZyphixEats.tsx`
- [Kirana map](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/KiranaMap.tsx): `artifacts/zyphix/src/pages/KiranaMap.tsx`

### Identity and state

- [Account](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/Account.tsx): `artifacts/zyphix/src/pages/Account.tsx`
- [Authentication](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/context/AuthContext.tsx): `artifacts/zyphix/src/context/AuthContext.tsx`
- [Auth modal](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/components/AuthModal.tsx): `artifacts/zyphix/src/components/AuthModal.tsx`
- [Commerce state](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/context/CartContext.tsx): `artifacts/zyphix/src/context/CartContext.tsx`

### Partner operations

- [Partner onboarding](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/PartnerLanding.tsx): `artifacts/zyphix/src/pages/PartnerLanding.tsx`
- [Merchant setup](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/MerchantSetup.tsx): `artifacts/zyphix/src/pages/MerchantSetup.tsx`
- [Partner dashboard](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/pages/PartnerDashboard.tsx): `artifacts/zyphix/src/pages/PartnerDashboard.tsx`

### Platform services

- [Supabase client](https://github.com/sangralrahul/zyphix/blob/main/artifacts/zyphix/src/integrations/supabase/client.ts): `artifacts/zyphix/src/integrations/supabase/client.ts`
- [API router](https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/index.ts): `artifacts/api-server/src/routes/index.ts`
- [Email OTP](https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/email-otp.ts): `artifacts/api-server/src/routes/email-otp.ts`
- [Notifications API](https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/notify.ts): `artifacts/api-server/src/routes/notify.ts`
- [Partner registration API](https://github.com/sangralrahul/zyphix/blob/main/artifacts/api-server/src/routes/partner-register.ts): `artifacts/api-server/src/routes/partner-register.ts`

### Other components

- **Customer**
- **Local fulfilment**

## Connections

- Customer → Commerce app: uses (evidence: `README.md`)
- Commerce app → Local discovery: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Product detail: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Cart: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Checkout: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Order confirmation: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Restaurant discovery: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Kirana map: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Partner onboarding: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Merchant setup: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Partner dashboard: routes to (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Authentication: provides state (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Commerce state: provides state (evidence: `artifacts/zyphix/src/App.tsx`)
- Commerce app → Auth modal: renders (evidence: `artifacts/zyphix/src/App.tsx`)
- Customer → Local discovery: sets location (evidence: `README.md`)
- Local discovery → Product detail: selects item (evidence: `README.md`)
- Product detail → Cart: adds to order (evidence: `README.md`)
- Cart → Checkout: places order (evidence: `README.md`)
- Checkout → Order confirmation: confirms order (evidence: `README.md`)
- Order confirmation → Local fulfilment: tracks delivery (evidence: `README.md`)
- API router → Email OTP: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → Notifications API: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- API router → Partner registration API: dispatches (evidence: `artifacts/api-server/src/routes/index.ts`)
- Partner onboarding → Merchant setup: continues setup
