# vishwanatha01/gofoode architecture

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

- Interactive diagram: https://gitdiagram.com/vishwanatha01/gofoode
- Repository: https://github.com/vishwanatha01/gofoode

## Overview

GoFoode is a multi-role marketplace for restaurant food delivery and adjacent services: groceries, reservations, local pickup/drop, events, offers, and membership. Customers discover services, build a cart or request, check out or book, then follow order/request status; restaurant owners, delivery partners, and administrators handle operations. The React application and Express API are the main product layers, with MongoDB models providing persistence. The API is a large routes module, so several domain nodes share its exact path; unsampled feature links are documented rather than inferred from module names.

Main entry points: [`server/models.js`](https://github.com/vishwanatha01/gofoode/blob/main/server/models.js) (Marketplace records), [`client/src/App.jsx`](https://github.com/vishwanatha01/gofoode/blob/main/client/src/App.jsx) (Marketplace UI), [`server/routes.js`](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js) (API router), [`server/middleware.js`](https://github.com/vishwanatha01/gofoode/blob/main/server/middleware.js) (JWT access control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_frontend["Marketplace UI<br/>[App.jsx]"]
  node_identity_ui["Session and location<br/>[AuthContext.jsx]"]
  node_http_client["API client<br/>[api.js]"]
  node_food_market["Food discovery and cart<br/>[routes.js]"]
  node_food_checkout["Food checkout<br/>[routes.js]"]
  node_mart["Grocery Mart<br/>[routes.js]"]
  node_marketplace_services["Marketplace services<br/>[routes.js]"]
  node_customer_accounts["Customer accounts<br/>[routes.js]"]
end

subgraph group_operations["Partner operations"]
  node_restaurant_ops["Restaurant operations<br/>[routes.js]"]
  node_delivery_ops["Delivery and Genie<br/>[routes.js]"]
  node_admin_ops["Admin operations<br/>[routes.js]"]
end

subgraph group_backend["API and access"]
  node_api_app["HTTP application<br/>[app.js]"]
  node_api_routes["API router<br/>[routes.js]"]
  node_auth_access["JWT access control<br/>[middleware.js]"]
  node_runtime_config["Runtime configuration<br/>[config.js]"]
end

subgraph group_data["Persistence and realtime"]
  node_mongo_models[("Marketplace records<br/>[models.js]")]
  node_socket_runtime["Socket.IO events<br/>[server.js]"]
  node_grocery_catalog["Grocery catalog data<br/>[groceryProducts.js]"]
end

node_customer_actor(("Customer"))
node_maps_service["Maps provider"]
node_payment_provider["Razorpay"]

node_customer_actor -->|"uses"| node_frontend
node_frontend -->|"reads session"| node_identity_ui
node_identity_ui -->|"calls"| node_http_client
node_frontend -->|"uses"| node_http_client
node_api_app -->|"mounts"| node_api_routes
node_api_app -->|"configures"| node_runtime_config
node_api_routes -->|"uses"| node_auth_access
node_api_routes -->|"reads and writes"| node_mongo_models
node_auth_access -->|"loads user"| node_mongo_models
node_auth_access -->|"verifies tokens"| node_runtime_config
node_socket_runtime -->|"serves over HTTP"| node_api_app
node_socket_runtime -->|"loads socket user"| node_mongo_models
node_food_market -->|"reads catalog"| node_mongo_models
node_food_checkout -->|"creates orders"| node_mongo_models
node_mart -.->|"stores grocery orders"| node_mongo_models
node_marketplace_services -.->|"stores service records"| node_mongo_models
node_customer_accounts -.->|"stores account data"| node_mongo_models
node_restaurant_ops -.->|"updates restaurant data"| node_mongo_models
node_delivery_ops -.->|"updates delivery data"| node_mongo_models
node_admin_ops -.->|"manages records"| node_mongo_models
node_grocery_catalog -.->|"provides products"| node_mart
node_frontend -.->|"embeds maps"| node_maps_service
node_food_checkout -.->|"optional payment"| node_payment_provider

click node_frontend "https://github.com/vishwanatha01/gofoode/blob/main/client/src/App.jsx"
click node_identity_ui "https://github.com/vishwanatha01/gofoode/blob/main/client/src/AuthContext.jsx"
click node_http_client "https://github.com/vishwanatha01/gofoode/blob/main/client/src/api.js"
click node_food_market "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_food_checkout "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_mart "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_marketplace_services "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_customer_accounts "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_restaurant_ops "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_delivery_ops "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_admin_ops "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_api_app "https://github.com/vishwanatha01/gofoode/blob/main/server/app.js"
click node_api_routes "https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js"
click node_auth_access "https://github.com/vishwanatha01/gofoode/blob/main/server/middleware.js"
click node_runtime_config "https://github.com/vishwanatha01/gofoode/blob/main/server/config.js"
click node_mongo_models "https://github.com/vishwanatha01/gofoode/blob/main/server/models.js"
click node_socket_runtime "https://github.com/vishwanatha01/gofoode/blob/main/server/server.js"
click node_grocery_catalog "https://github.com/vishwanatha01/gofoode/blob/main/server/groceryProducts.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_frontend,node_identity_ui,node_http_client,node_food_market,node_food_checkout,node_mart,node_marketplace_services,node_customer_accounts toneBlue
class node_restaurant_ops,node_delivery_ops,node_admin_ops toneAmber
class node_api_app,node_api_routes,node_auth_access,node_runtime_config toneMint
class node_mongo_models,node_socket_runtime,node_grocery_catalog toneRose
class node_customer_actor,node_maps_service,node_payment_provider toneIndigo
```

## Components

### Customer experience

- [Marketplace UI](https://github.com/vishwanatha01/gofoode/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session and location](https://github.com/vishwanatha01/gofoode/blob/main/client/src/AuthContext.jsx): `client/src/AuthContext.jsx`
- [API client](https://github.com/vishwanatha01/gofoode/blob/main/client/src/api.js): `client/src/api.js`
- [Food discovery and cart](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [Food checkout](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [Grocery Mart](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [Marketplace services](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [Customer accounts](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`

### Partner operations

- [Restaurant operations](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [Delivery and Genie](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [Admin operations](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`

### API and access

- [HTTP application](https://github.com/vishwanatha01/gofoode/blob/main/server/app.js): `server/app.js`
- [API router](https://github.com/vishwanatha01/gofoode/blob/main/server/routes.js): `server/routes.js`
- [JWT access control](https://github.com/vishwanatha01/gofoode/blob/main/server/middleware.js): `server/middleware.js`
- [Runtime configuration](https://github.com/vishwanatha01/gofoode/blob/main/server/config.js): `server/config.js`

### Persistence and realtime

- [Marketplace records](https://github.com/vishwanatha01/gofoode/blob/main/server/models.js): `server/models.js`
- [Socket.IO events](https://github.com/vishwanatha01/gofoode/blob/main/server/server.js): `server/server.js`
- [Grocery catalog data](https://github.com/vishwanatha01/gofoode/blob/main/server/groceryProducts.js): `server/groceryProducts.js`

### Other components

- **Customer**
- **Maps provider**
- **Razorpay**

## Connections

- Customer → Marketplace UI: uses (evidence: `README.md`)
- Marketplace UI → Session and location: reads session (evidence: `client/src/main.jsx`)
- Session and location → API client: calls (evidence: `client/src/AuthContext.jsx`)
- Marketplace UI → API client: uses (evidence: `client/src/App.jsx`)
- HTTP application → API router: mounts (evidence: `server/app.js`)
- HTTP application → Runtime configuration: configures (evidence: `server/app.js`)
- API router → JWT access control: uses (evidence: `server/routes.js`)
- API router → Marketplace records: reads and writes (evidence: `server/routes.js`)
- JWT access control → Marketplace records: loads user (evidence: `server/middleware.js`)
- JWT access control → Runtime configuration: verifies tokens (evidence: `server/middleware.js`)
- Socket.IO events → HTTP application: serves over HTTP (evidence: `server/server.js`)
- Socket.IO events → Marketplace records: loads socket user (evidence: `server/server.js`)
- Food discovery and cart → Marketplace records: reads catalog (evidence: `server/routes.js`)
- Food checkout → Marketplace records: creates orders (evidence: `server/routes.js`)
- Grocery Mart → Marketplace records: stores grocery orders (evidence: `README.md`)
- Marketplace services → Marketplace records: stores service records (evidence: `README.md`)
- Customer accounts → Marketplace records: stores account data (evidence: `README.md`)
- Restaurant operations → Marketplace records: updates restaurant data (evidence: `README.md`)
- Delivery and Genie → Marketplace records: updates delivery data (evidence: `README.md`)
- Admin operations → Marketplace records: manages records (evidence: `README.md`)
- Grocery catalog data → Grocery Mart: provides products (evidence: `README.md`)
- Marketplace UI → Maps provider: embeds maps (evidence: `client/src/App.jsx`)
- Food checkout → Razorpay: optional payment (evidence: `README.md`)
