# pranav-ns/catherbridge architecture

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

- Interactive diagram: https://gitdiagram.com/pranav-ns/catherbridge
- Repository: https://github.com/pranav-ns/catherbridge

## Overview

CaterBridge is a catering and tiffin marketplace. Customers register or sign in, discover caterers, save favourites, request catering, review providers, plan subscriptions, and use wallet/payment features; caterers manage profiles and respond to requests. React pages and components use a shared Axios client to reach an Express API, whose route handlers implement the domain operations and persist marketplace records. The README documents major features beyond the sampled excerpts; those are represented where the tree provides paths, but their internal call chains are not inferred.

Main entry points: [`backend/server.js`](https://github.com/pranav-ns/catherbridge/blob/main/backend/server.js) (Express API), [`frontend/src/App.jsx`](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/App.jsx) (App routing), [`frontend/src/services/api.js`](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/services/api.js) (API client), [`backend/routes/auth.routes.js`](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/auth.routes.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer experience"]
  node_react["App routing<br/>[App.jsx]"]
  node_discovery["Caterer discovery<br/>[Home.jsx]"]
  node_customer_pages["Customer pages"]
  node_market_widgets["Marketplace components"]
  node_chat_widget["Chat assistant UI<br/>[ChatbotWidget.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_provider["Caterer experience"]
  node_provider_dashboard["Provider dashboard"]
end

subgraph group_api["Marketplace API"]
  node_server["Express API<br/>[server.js]"]
  node_auth_routes["Authentication<br/>[auth.routes.js]"]
  node_caterer_routes["Caterer profiles<br/>[caterer.routes.js]"]
  node_request_routes["Catering requests<br/>[request.routes.js]"]
  node_review_routes["Reviews<br/>[review.routes.js]"]
  node_subscription_routes["Tiffin subscriptions"]
  node_user_routes["Favourites and referrals<br/>[user.routes.js]"]
  node_wallet_routes["Wallet<br/>[wallet.routes.js]"]
  node_payment_routes["Payments<br/>[payment.routes.js]"]
  node_chat_routes["Chat endpoint<br/>[chat.routes.js]"]
  node_chat_controller["Gemini chat handler<br/>[chat.controller.js]"]
  node_auth_middleware["JWT protection<br/>[auth.js]"]
end

subgraph group_data["Domain data"]
  node_user_model[("Client accounts<br/>[User.js]")]
  node_caterer_model[("Caterer records<br/>[Caterer.js]")]
  node_request_model[("Request records<br/>[Request.js]")]
  node_review_model[("Review records<br/>[Review.js]")]
  node_subscription_model[("Subscription records<br/>[Subscription.js]")]
end

node_customer(("Customers"))
node_caterers(("Caterers"))
node_gemini["Gemini API"]

node_customer -->|"uses"| node_react
node_caterers -->|"manages profile"| node_provider_dashboard
node_react -->|"routes to"| node_discovery
node_react -->|"routes to"| node_customer_pages
node_react -->|"renders"| node_market_widgets
node_react -->|"renders"| node_chat_widget
node_discovery -->|"calls"| node_api_client
node_customer_pages -->|"calls"| node_api_client
node_provider_dashboard -->|"calls"| node_api_client
node_chat_widget -->|"calls"| node_api_client
node_api_client -->|"sends API requests"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_caterer_routes
node_server -->|"mounts"| node_request_routes
node_server -->|"mounts"| node_review_routes
node_server -->|"mounts"| node_subscription_routes
node_server -->|"mounts"| node_user_routes
node_server -->|"mounts"| node_wallet_routes
node_server -->|"mounts"| node_payment_routes
node_server -->|"mounts"| node_chat_routes
node_auth_routes -->|"creates and queries"| node_user_model
node_auth_routes -->|"creates and queries"| node_caterer_model
node_caterer_routes -->|"queries and updates"| node_caterer_model
node_request_routes -->|"creates and updates"| node_request_model
node_review_routes -->|"creates and queries"| node_review_model
node_review_routes -->|"updates rating"| node_caterer_model
node_subscription_routes -->|"manages"| node_subscription_model
node_user_routes -->|"updates and reads"| node_user_model
node_wallet_routes -->|"reads and updates"| node_user_model
node_request_routes -->|"protects routes"| node_auth_middleware
node_auth_routes -.->|"protects routes"| node_auth_middleware
node_chat_routes -->|"dispatches to"| node_chat_controller
node_chat_controller -->|"generates replies"| node_gemini

click node_react "https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/App.jsx"
click node_discovery "https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/pages/Home.jsx"
click node_customer_pages "https://github.com/pranav-ns/catherbridge/tree/main/frontend/src/pages"
click node_market_widgets "https://github.com/pranav-ns/catherbridge/tree/main/frontend/src/components"
click node_chat_widget "https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/components/ChatbotWidget.jsx"
click node_provider_dashboard "https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/pages/CatererDashboard.jsx"
click node_api_client "https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/pranav-ns/catherbridge/blob/main/backend/server.js"
click node_auth_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/auth.routes.js"
click node_caterer_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/caterer.routes.js"
click node_request_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/request.routes.js"
click node_review_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/review.routes.js"
click node_subscription_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/subscription.routes.js"
click node_user_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/user.routes.js"
click node_wallet_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/wallet.routes.js"
click node_payment_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/payment.routes.js"
click node_chat_routes "https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/chat.routes.js"
click node_chat_controller "https://github.com/pranav-ns/catherbridge/blob/main/backend/controllers/chat.controller.js"
click node_user_model "https://github.com/pranav-ns/catherbridge/blob/main/backend/models/User.js"
click node_caterer_model "https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Caterer.js"
click node_request_model "https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Request.js"
click node_review_model "https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Review.js"
click node_subscription_model "https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Subscription.js"
click node_auth_middleware "https://github.com/pranav-ns/catherbridge/blob/main/backend/middleware/auth.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_react,node_discovery,node_customer_pages,node_market_widgets,node_chat_widget,node_api_client toneBlue
class node_provider_dashboard toneAmber
class node_server,node_auth_routes,node_caterer_routes,node_request_routes,node_review_routes,node_subscription_routes,node_user_routes,node_wallet_routes,node_payment_routes,node_chat_routes,node_chat_controller,node_auth_middleware,node_gemini toneMint
class node_user_model,node_caterer_model,node_request_model,node_review_model,node_subscription_model toneRose
class node_customer,node_caterers toneIndigo
```

## Components

### Customer experience

- [App routing](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Caterer discovery](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Customer pages](https://github.com/pranav-ns/catherbridge/tree/main/frontend/src/pages): `frontend/src/pages`
- [Marketplace components](https://github.com/pranav-ns/catherbridge/tree/main/frontend/src/components): `frontend/src/components`
- [Chat assistant UI](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/components/ChatbotWidget.jsx): `frontend/src/components/ChatbotWidget.jsx`
- [API client](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Caterer experience

- [Provider dashboard](https://github.com/pranav-ns/catherbridge/blob/main/frontend/src/pages/CatererDashboard.jsx): `frontend/src/pages/CatererDashboard.jsx`

### Marketplace API

- [Express API](https://github.com/pranav-ns/catherbridge/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/auth.routes.js): `backend/routes/auth.routes.js`
- [Caterer profiles](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/caterer.routes.js): `backend/routes/caterer.routes.js`
- [Catering requests](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/request.routes.js): `backend/routes/request.routes.js`
- [Reviews](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/review.routes.js): `backend/routes/review.routes.js`
- [Tiffin subscriptions](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/subscription.routes.js): `backend/routes/subscription.routes.js`
- [Favourites and referrals](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/user.routes.js): `backend/routes/user.routes.js`
- [Wallet](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/wallet.routes.js): `backend/routes/wallet.routes.js`
- [Payments](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/payment.routes.js): `backend/routes/payment.routes.js`
- [Chat endpoint](https://github.com/pranav-ns/catherbridge/blob/main/backend/routes/chat.routes.js): `backend/routes/chat.routes.js`
- [Gemini chat handler](https://github.com/pranav-ns/catherbridge/blob/main/backend/controllers/chat.controller.js): `backend/controllers/chat.controller.js`
- [JWT protection](https://github.com/pranav-ns/catherbridge/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Domain data

- [Client accounts](https://github.com/pranav-ns/catherbridge/blob/main/backend/models/User.js): `backend/models/User.js`
- [Caterer records](https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Caterer.js): `backend/models/Caterer.js`
- [Request records](https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Request.js): `backend/models/Request.js`
- [Review records](https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Review.js): `backend/models/Review.js`
- [Subscription records](https://github.com/pranav-ns/catherbridge/blob/main/backend/models/Subscription.js): `backend/models/Subscription.js`

### Other components

- **Customers**
- **Caterers**
- **Gemini API**

## Connections

- Customers → App routing: uses (evidence: `README.md`)
- Caterers → Provider dashboard: manages profile (evidence: `README.md`)
- App routing → Caterer discovery: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Customer pages: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Marketplace components: renders (evidence: `frontend/src/App.jsx`)
- App routing → Chat assistant UI: renders (evidence: `frontend/src/App.jsx`)
- Caterer discovery → API client: calls (evidence: `frontend/src/pages/Home.jsx`)
- Customer pages → API client: calls (evidence: `frontend/src/pages/Dashboard.jsx`)
- Provider dashboard → API client: calls (evidence: `frontend/src/pages/CatererDashboard.jsx`)
- Chat assistant UI → API client: calls (evidence: `frontend/src/components/ChatbotWidget.jsx`)
- API client → Express API: sends API requests (evidence: `README.md`)
- Express API → Authentication: mounts (evidence: `backend/server.js`)
- Express API → Caterer profiles: mounts (evidence: `backend/server.js`)
- Express API → Catering requests: mounts (evidence: `backend/server.js`)
- Express API → Reviews: mounts (evidence: `backend/server.js`)
- Express API → Tiffin subscriptions: mounts (evidence: `backend/server.js`)
- Express API → Favourites and referrals: mounts (evidence: `backend/server.js`)
- Express API → Wallet: mounts (evidence: `backend/server.js`)
- Express API → Payments: mounts (evidence: `backend/server.js`)
- Express API → Chat endpoint: mounts (evidence: `backend/server.js`)
- Authentication → Client accounts: creates and queries (evidence: `backend/routes/auth.routes.js`)
- Authentication → Caterer records: creates and queries (evidence: `backend/routes/auth.routes.js`)
- Caterer profiles → Caterer records: queries and updates (evidence: `backend/routes/caterer.routes.js`)
- Catering requests → Request records: creates and updates (evidence: `backend/routes/request.routes.js`)
- Reviews → Review records: creates and queries (evidence: `backend/routes/review.routes.js`)
- Reviews → Caterer records: updates rating (evidence: `backend/routes/review.routes.js`)
- Tiffin subscriptions → Subscription records: manages (evidence: `backend/routes/subscription.routes.js`)
- Favourites and referrals → Client accounts: updates and reads (evidence: `backend/routes/user.routes.js`)
- Wallet → Client accounts: reads and updates (evidence: `backend/routes/wallet.routes.js`)
- Catering requests → JWT protection: protects routes (evidence: `backend/routes/request.routes.js`)
- Authentication → JWT protection: protects routes
- Chat endpoint → Gemini chat handler: dispatches to (evidence: `backend/routes/chat.routes.js`)
- Gemini chat handler → Gemini API: generates replies (evidence: `backend/controllers/chat.controller.js`)
