# dhruvgupta-og/zappit architecture

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

- Interactive diagram: https://gitdiagram.com/dhruvgupta-og/zappit
- Repository: https://github.com/dhruvgupta-og/zappit

## Overview

Zappit is a multi-client food-ordering platform: customers discover stores and place/pay for orders, while store, delivery, and admin users manage fulfillment and platform data. Mobile customer and partner apps, a browser client, and an Express API form the main runtime. The source excerpts show API routing, payment and order handling, and MongoDB models. Many screen implementations and client-to-server request details were not sampled, so those relationships are omitted rather than inferred.

Main entry points: [`web/src/App.jsx`](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/App.jsx) (Web routing), [`backend/server.js`](https://github.com/dhruvgupta-og/zappit/blob/main/backend/server.js) (HTTP server), [`apps/zappit-customer/src/navigation/AppNavigator.tsx`](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/navigation/AppNavigator.tsx) (App navigation), [`backend/database/mongodb.js`](https://github.com/dhruvgupta-og/zappit/blob/main/backend/database/mongodb.js) (MongoDB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer mobile"]
  node_customer_nav["App navigation<br/>[AppNavigator.tsx]"]
  node_customer_auth["Customer auth<br/>[authStore.ts]"]
  node_customer_discovery["Store discovery<br/>[HomeScreen.tsx]"]
  node_customer_store["Store and menu"]
  node_customer_cart["Shopping cart<br/>[cartStore.ts]"]
  node_customer_checkout["Checkout<br/>[CheckoutScreen.tsx]"]
  node_customer_payment_api["Payment client<br/>[payment.ts]"]
  node_customer_orders["Order history<br/>[OrdersScreen.tsx]"]
  node_customer_tracking["Order tracking"]
end

subgraph group_partner["Partner mobile"]
  node_partner_auth["Partner auth<br/>[authStore.ts]"]
  node_partner_store["Store dashboard"]
  node_partner_delivery["Delivery dashboard"]
  node_partner_admin["Partner admin"]
end

subgraph group_web["Browser app"]
  node_web_app["Web routing<br/>[App.jsx]"]
  node_web_cart["Web cart<br/>[CartContext.jsx]"]
  node_web_checkout["Web checkout<br/>[Checkout.jsx]"]
  node_web_admin["Web admin<br/>[AdminDashboard.jsx]"]
  node_web_store["Web store dashboard<br/>[StoreDashboard.jsx]"]
  node_web_delivery["Web delivery dashboard"]
  node_web_tracking["Web order tracking<br/>[OrderTracker.jsx]"]
  node_web_payment_callback["Payment callback"]
  node_web_api["Web API client<br/>[api.js]"]
end

subgraph group_backend["API services"]
  node_api_server["HTTP server<br/>[server.js]"]
  node_api_auth["Request authentication<br/>[authMiddleware.js]"]
  node_api_store["Store catalog routes<br/>[storeRoutes.js]"]
  node_api_orders["Order routes<br/>[orderRoutes.js]"]
  node_api_payment["Payment routes"]
  node_api_admin["Admin routes<br/>[adminRoutes.js]"]
  node_api_users["User routes<br/>[userRoutes.js]"]
  node_api_razorpay["Razorpay integration<br/>[razorpay.js]"]
end

subgraph group_data["Persistence"]
  node_mongo[("MongoDB<br/>[mongodb.js]")]
end

node_customer_actor(("Customer"))
node_partner_actor(("Store and delivery staff"))
node_web_actor(("Browser user"))

node_customer_actor -->|"uses"| node_customer_nav
node_customer_nav -->|"uses"| node_customer_auth
node_customer_nav -->|"routes to"| node_customer_discovery
node_customer_nav -->|"routes to"| node_customer_store
node_customer_nav -->|"routes to"| node_customer_checkout
node_customer_nav -->|"routes to"| node_customer_orders
node_customer_nav -->|"routes to"| node_customer_tracking
node_customer_checkout -->|"reads"| node_customer_cart
node_customer_checkout -->|"reads"| node_customer_auth
node_customer_checkout -->|"calls"| node_customer_payment_api
node_partner_actor -->|"uses"| node_partner_auth
node_partner_auth -.->|"enables"| node_partner_store
node_partner_actor -.->|"manages store"| node_partner_store
node_partner_actor -.->|"fulfills orders"| node_partner_delivery
node_partner_actor -.->|"administers"| node_partner_admin
node_web_actor -->|"uses"| node_web_app
node_web_app -->|"provides"| node_web_cart
node_web_app -->|"routes to"| node_web_checkout
node_web_app -->|"routes to"| node_web_admin
node_web_app -->|"routes to"| node_web_store
node_web_app -->|"routes to"| node_web_delivery
node_web_app -->|"routes to"| node_web_tracking
node_web_app -->|"routes to"| node_web_payment_callback
node_web_admin -->|"calls"| node_web_api
node_api_server -->|"applies"| node_api_auth
node_api_server -->|"mounts"| node_api_store
node_api_server -->|"mounts"| node_api_orders
node_api_server -->|"mounts"| node_api_payment
node_api_server -->|"mounts"| node_api_admin
node_api_server -->|"mounts"| node_api_users
node_api_auth -.->|"queries models"| node_mongo
node_api_store -.->|"reads catalog"| node_mongo
node_api_orders -->|"reads and writes"| node_mongo
node_api_payment -.->|"reads and writes"| node_mongo
node_api_admin -.->|"reads and writes"| node_mongo
node_api_users -->|"reads and writes"| node_mongo
node_api_payment -->|"uses"| node_api_razorpay
node_web_api -.->|"HTTP requests"| node_api_server
node_customer_payment_api -.->|"HTTP requests"| node_api_server

click node_customer_nav "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/navigation/AppNavigator.tsx"
click node_customer_auth "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/store/authStore.ts"
click node_customer_discovery "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/HomeScreen.tsx"
click node_customer_store "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/StoreDetailScreen.tsx"
click node_customer_cart "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/store/cartStore.ts"
click node_customer_checkout "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/CheckoutScreen.tsx"
click node_customer_payment_api "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/api/payment.ts"
click node_customer_orders "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/OrdersScreen.tsx"
click node_customer_tracking "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/OrderTrackerScreen.tsx"
click node_partner_auth "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/store/authStore.ts"
click node_partner_store "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/screens/StoreDashboardScreen.tsx"
click node_partner_delivery "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/screens/DeliveryDashboardScreen.tsx"
click node_partner_admin "https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/screens/AdminDashboardScreen.tsx"
click node_web_app "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/App.jsx"
click node_web_cart "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/CartContext.jsx"
click node_web_checkout "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/Checkout.jsx"
click node_web_admin "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/AdminDashboard.jsx"
click node_web_store "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/StoreDashboard.jsx"
click node_web_delivery "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/DeliveryDashboard.jsx"
click node_web_tracking "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/OrderTracker.jsx"
click node_web_payment_callback "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/PaymentCallback.jsx"
click node_web_api "https://github.com/dhruvgupta-og/zappit/blob/main/web/src/utils/api.js"
click node_api_server "https://github.com/dhruvgupta-og/zappit/blob/main/backend/server.js"
click node_api_auth "https://github.com/dhruvgupta-og/zappit/blob/main/backend/middleware/authMiddleware.js"
click node_api_store "https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/store/storeRoutes.js"
click node_api_orders "https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/order/orderRoutes.js"
click node_api_payment "https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/payment/webPaymentRoutes.js"
click node_api_admin "https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/admin/adminRoutes.js"
click node_api_users "https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/user/userRoutes.js"
click node_api_razorpay "https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/payment/razorpay.js"
click node_mongo "https://github.com/dhruvgupta-og/zappit/blob/main/backend/database/mongodb.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_customer_nav,node_customer_auth,node_customer_discovery,node_customer_store,node_customer_cart,node_customer_checkout,node_customer_payment_api,node_customer_orders,node_customer_tracking,node_web_actor toneBlue
class node_partner_auth,node_partner_store,node_partner_delivery,node_partner_admin toneAmber
class node_web_app,node_web_cart,node_web_checkout,node_web_admin,node_web_store,node_web_delivery,node_web_tracking,node_web_payment_callback,node_web_api toneMint
class node_api_server,node_api_auth,node_api_store,node_api_orders,node_api_payment,node_api_admin,node_api_users,node_api_razorpay toneRose
class node_mongo,node_customer_actor,node_partner_actor toneIndigo
```

## Components

### Customer mobile

- [App navigation](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/navigation/AppNavigator.tsx): `apps/zappit-customer/src/navigation/AppNavigator.tsx`
- [Customer auth](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/store/authStore.ts): `apps/zappit-customer/src/store/authStore.ts`
- [Store discovery](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/HomeScreen.tsx): `apps/zappit-customer/src/screens/HomeScreen.tsx`
- [Store and menu](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/StoreDetailScreen.tsx): `apps/zappit-customer/src/screens/StoreDetailScreen.tsx`
- [Shopping cart](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/store/cartStore.ts): `apps/zappit-customer/src/store/cartStore.ts`
- [Checkout](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/CheckoutScreen.tsx): `apps/zappit-customer/src/screens/CheckoutScreen.tsx`
- [Payment client](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/api/payment.ts): `apps/zappit-customer/src/api/payment.ts`
- [Order history](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/OrdersScreen.tsx): `apps/zappit-customer/src/screens/OrdersScreen.tsx`
- [Order tracking](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-customer/src/screens/OrderTrackerScreen.tsx): `apps/zappit-customer/src/screens/OrderTrackerScreen.tsx`

### Partner mobile

- [Partner auth](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/store/authStore.ts): `apps/zappit-partner/src/store/authStore.ts`
- [Store dashboard](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/screens/StoreDashboardScreen.tsx): `apps/zappit-partner/src/screens/StoreDashboardScreen.tsx`
- [Delivery dashboard](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/screens/DeliveryDashboardScreen.tsx): `apps/zappit-partner/src/screens/DeliveryDashboardScreen.tsx`
- [Partner admin](https://github.com/dhruvgupta-og/zappit/blob/main/apps/zappit-partner/src/screens/AdminDashboardScreen.tsx): `apps/zappit-partner/src/screens/AdminDashboardScreen.tsx`

### Browser app

- [Web routing](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Web cart](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/CartContext.jsx): `web/src/CartContext.jsx`
- [Web checkout](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/Checkout.jsx): `web/src/pages/Checkout.jsx`
- [Web admin](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/AdminDashboard.jsx): `web/src/pages/AdminDashboard.jsx`
- [Web store dashboard](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/StoreDashboard.jsx): `web/src/pages/StoreDashboard.jsx`
- [Web delivery dashboard](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/DeliveryDashboard.jsx): `web/src/pages/DeliveryDashboard.jsx`
- [Web order tracking](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/OrderTracker.jsx): `web/src/pages/OrderTracker.jsx`
- [Payment callback](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/pages/PaymentCallback.jsx): `web/src/pages/PaymentCallback.jsx`
- [Web API client](https://github.com/dhruvgupta-og/zappit/blob/main/web/src/utils/api.js): `web/src/utils/api.js`

### API services

- [HTTP server](https://github.com/dhruvgupta-og/zappit/blob/main/backend/server.js): `backend/server.js`
- [Request authentication](https://github.com/dhruvgupta-og/zappit/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Store catalog routes](https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/store/storeRoutes.js): `backend/services/store/storeRoutes.js`
- [Order routes](https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/order/orderRoutes.js): `backend/services/order/orderRoutes.js`
- [Payment routes](https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/payment/webPaymentRoutes.js): `backend/services/payment/webPaymentRoutes.js`
- [Admin routes](https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/admin/adminRoutes.js): `backend/services/admin/adminRoutes.js`
- [User routes](https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/user/userRoutes.js): `backend/services/user/userRoutes.js`
- [Razorpay integration](https://github.com/dhruvgupta-og/zappit/blob/main/backend/services/payment/razorpay.js): `backend/services/payment/razorpay.js`

### Persistence

- [MongoDB](https://github.com/dhruvgupta-og/zappit/blob/main/backend/database/mongodb.js): `backend/database/mongodb.js`

### Other components

- **Customer**
- **Store and delivery staff**
- **Browser user**

## Connections

- Customer → App navigation: uses
- App navigation → Customer auth: uses (evidence: `apps/zappit-customer/src/navigation/AppNavigator.tsx`)
- App navigation → Store discovery: routes to (evidence: `apps/zappit-customer/src/navigation/AppNavigator.tsx`)
- App navigation → Store and menu: routes to (evidence: `apps/zappit-customer/src/navigation/AppNavigator.tsx`)
- App navigation → Checkout: routes to (evidence: `apps/zappit-customer/src/navigation/AppNavigator.tsx`)
- App navigation → Order history: routes to (evidence: `apps/zappit-customer/src/navigation/AppNavigator.tsx`)
- App navigation → Order tracking: routes to (evidence: `apps/zappit-customer/src/navigation/AppNavigator.tsx`)
- Checkout → Shopping cart: reads (evidence: `apps/zappit-customer/src/screens/CheckoutScreen.tsx`)
- Checkout → Customer auth: reads (evidence: `apps/zappit-customer/src/screens/CheckoutScreen.tsx`)
- Checkout → Payment client: calls (evidence: `apps/zappit-customer/src/screens/CheckoutScreen.tsx`)
- Store and delivery staff → Partner auth: uses
- Partner auth → Store dashboard: enables
- Store and delivery staff → Store dashboard: manages store
- Store and delivery staff → Delivery dashboard: fulfills orders
- Store and delivery staff → Partner admin: administers
- Browser user → Web routing: uses
- Web routing → Web cart: provides (evidence: `web/src/App.jsx`)
- Web routing → Web checkout: routes to (evidence: `web/src/App.jsx`)
- Web routing → Web admin: routes to (evidence: `web/src/App.jsx`)
- Web routing → Web store dashboard: routes to (evidence: `web/src/App.jsx`)
- Web routing → Web delivery dashboard: routes to (evidence: `web/src/App.jsx`)
- Web routing → Web order tracking: routes to (evidence: `web/src/App.jsx`)
- Web routing → Payment callback: routes to (evidence: `web/src/App.jsx`)
- Web admin → Web API client: calls (evidence: `web/src/pages/AdminDashboard.jsx`)
- HTTP server → Request authentication: applies (evidence: `backend/server.js`)
- HTTP server → Store catalog routes: mounts (evidence: `backend/server.js`)
- HTTP server → Order routes: mounts (evidence: `backend/server.js`)
- HTTP server → Payment routes: mounts (evidence: `backend/server.js`)
- HTTP server → Admin routes: mounts (evidence: `backend/server.js`)
- HTTP server → User routes: mounts (evidence: `backend/server.js`)
- Request authentication → MongoDB: queries models
- Store catalog routes → MongoDB: reads catalog
- Order routes → MongoDB: reads and writes (evidence: `backend/services/order/orderRoutes.js`)
- Payment routes → MongoDB: reads and writes
- Admin routes → MongoDB: reads and writes
- User routes → MongoDB: reads and writes (evidence: `backend/services/user/userRoutes.js`)
- Payment routes → Razorpay integration: uses (evidence: `backend/services/payment/webPaymentRoutes.js`)
- Web API client → HTTP server: HTTP requests
- Payment client → HTTP server: HTTP requests
