# manish01101/resqplate architecture

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

- Interactive diagram: https://gitdiagram.com/manish01101/resqplate
- Repository: https://github.com/manish01101/resqplate

## Overview

ResQPlate connects food donors with verified NGOs and volunteers: users register and verify, donors post geolocated surplus food, nearby organizations discover and request it, donors approve requests, and pickup is tracked through handoff and completion. Matching ranks volunteers by distance, urgency, and reliability; scheduled expiry keeps listings current. The map, chat, ratings, notifications, assistant, and admin controls are additional product capabilities. Edges reflect the README and shown imports/calls; several frontend pages and backend routes were not sampled, so their internal wiring is not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/manish01101/resqplate/blob/main/frontend/src/App.jsx) (App routing), [`backend/index.js`](https://github.com/manish01101/resqplate/blob/main/backend/index.js) (HTTP server), [`frontend/src/utils/api.js`](https://github.com/manish01101/resqplate/blob/main/frontend/src/utils/api.js) (API client), [`backend/routes/donations.js`](https://github.com/manish01101/resqplate/blob/main/backend/routes/donations.js) (Donation management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_frontend["App routing<br/>[App.jsx]"]
  node_auth_ui["Auth context<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_dashboard["Role dashboards<br/>[DashboardPage.jsx]"]
  node_donate_ui["Donation posting<br/>[DonatePage.jsx]"]
  node_find_food["Food discovery map<br/>[FindFoodPage.jsx]"]
  node_claims_ui["Claims management<br/>[MyClaimsPage.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminPage.jsx]"]
  node_bot_ui["ResQBot assistant<br/>[ResQBot.jsx]"]
  node_pickup_map["Live pickup map"]
  node_routing_machine["Route rendering<br/>[RoutingMachine.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Authentication routes<br/>[auth.js]"]
  node_auth_middleware["JWT authorization<br/>[auth.js]"]
  node_user_model[("User and reliability<br/>[user.js]")]
end

subgraph group_rescue["Food rescue workflow"]
  node_donation_routes["Donation management<br/>[donations.js]"]
  node_donation_model[("Donation records<br/>[donation.js]")]
  node_matching["Volunteer matching<br/>[algorithms.js]"]
  node_claim_routes["Claim and handoff<br/>[claims.js]"]
  node_claim_model[("Claim records<br/>[claim.js]")]
end

subgraph group_engagement["Live services"]
  node_chat_routes["Claim chat<br/>[chat.js]"]
  node_chat_model[("Chat messages<br/>[chatMessage.js]")]
  node_rating_routes["Ratings<br/>[ratings.js]"]
  node_rating_model[("Rating records<br/>[rating.js]")]
  node_notification_routes["Notification inbox<br/>[notifications.js]"]
  node_notification_model[("Notification records<br/>[notification.js]")]
end

subgraph group_platform["Platform operations"]
  node_backend_entry["HTTP server<br/>[index.js]"]
  node_expiry_job["Donation expiry<br/>[donationJobs.js]"]
  node_admin_routes["Admin controls<br/>[admin.js]"]
end

node_donor(("Donor"))
node_ngo(("NGO / volunteer"))
node_admin(("Admin"))
node_browser(("Web browser"))
node_osrm["OSRM routing"]
node_groq["Groq API"]

node_donor -->|"uses"| node_frontend
node_ngo -->|"uses"| node_frontend
node_admin -->|"uses"| node_frontend
node_browser -->|"loads"| node_frontend
node_frontend -->|"provides"| node_auth_ui
node_frontend -->|"routes to"| node_dashboard
node_frontend -->|"routes to"| node_donate_ui
node_frontend -->|"routes to"| node_find_food
node_frontend -->|"routes to"| node_claims_ui
node_frontend -->|"routes to"| node_admin_ui
node_frontend -->|"renders"| node_bot_ui
node_auth_ui -.->|"calls"| node_api_client
node_donate_ui -->|"calls"| node_api_client
node_admin_ui -->|"calls"| node_api_client
node_dashboard -.->|"calls"| node_api_client
node_find_food -.->|"calls"| node_api_client
node_claims_ui -.->|"calls"| node_api_client
node_api_client -.->|"HTTP requests"| node_backend_entry
node_backend_entry -->|"mounts"| node_auth_routes
node_backend_entry -->|"mounts"| node_donation_routes
node_backend_entry -->|"mounts"| node_claim_routes
node_backend_entry -->|"mounts"| node_admin_routes
node_backend_entry -->|"mounts"| node_chat_routes
node_backend_entry -->|"mounts"| node_rating_routes
node_backend_entry -->|"mounts"| node_notification_routes
node_auth_routes -->|"reads/writes"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_donation_routes -->|"protects routes"| node_auth_middleware
node_claim_routes -->|"protects routes"| node_auth_middleware
node_donation_routes -->|"reads/writes"| node_donation_model
node_donation_routes -->|"queries volunteers"| node_user_model
node_donation_routes -->|"ranks volunteers"| node_matching
node_donation_routes -.->|"notifies matches"| node_claim_routes
node_claim_routes -->|"creates/updates"| node_claim_model
node_claim_routes -->|"updates status"| node_donation_model
node_claim_routes -.->|"updates reliability"| node_user_model
node_expiry_job -->|"expires listings"| node_donation_model
node_admin_routes -.->|"manages accounts"| node_user_model
node_admin_routes -.->|"moderates listings"| node_donation_model
node_chat_routes -.->|"stores messages"| node_chat_model
node_rating_routes -.->|"stores ratings"| node_rating_model
node_notification_routes -.->|"reads inbox"| node_notification_model
node_pickup_map -.->|"renders route"| node_routing_machine
node_routing_machine -.->|"requests route"| node_osrm
node_bot_ui -.->|"asks assistant"| node_groq

click node_frontend "https://github.com/manish01101/resqplate/blob/main/frontend/src/App.jsx"
click node_auth_ui "https://github.com/manish01101/resqplate/blob/main/frontend/src/context/AuthContext.jsx"
click node_api_client "https://github.com/manish01101/resqplate/blob/main/frontend/src/utils/api.js"
click node_dashboard "https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_donate_ui "https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/DonatePage.jsx"
click node_find_food "https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/FindFoodPage.jsx"
click node_claims_ui "https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/MyClaimsPage.jsx"
click node_admin_ui "https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/AdminPage.jsx"
click node_bot_ui "https://github.com/manish01101/resqplate/blob/main/frontend/src/components/ResQBot.jsx"
click node_pickup_map "https://github.com/manish01101/resqplate/blob/main/frontend/src/components/ActivePickupMap.jsx"
click node_routing_machine "https://github.com/manish01101/resqplate/blob/main/frontend/src/components/RoutingMachine.jsx"
click node_backend_entry "https://github.com/manish01101/resqplate/blob/main/backend/index.js"
click node_auth_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/auth.js"
click node_auth_middleware "https://github.com/manish01101/resqplate/blob/main/backend/middleware/auth.js"
click node_user_model "https://github.com/manish01101/resqplate/blob/main/backend/models/user.js"
click node_donation_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/donations.js"
click node_donation_model "https://github.com/manish01101/resqplate/blob/main/backend/models/donation.js"
click node_matching "https://github.com/manish01101/resqplate/blob/main/backend/utils/algorithms.js"
click node_claim_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/claims.js"
click node_claim_model "https://github.com/manish01101/resqplate/blob/main/backend/models/claim.js"
click node_expiry_job "https://github.com/manish01101/resqplate/blob/main/backend/jobs/donationJobs.js"
click node_admin_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/admin.js"
click node_chat_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/chat.js"
click node_chat_model "https://github.com/manish01101/resqplate/blob/main/backend/models/chatMessage.js"
click node_rating_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/ratings.js"
click node_rating_model "https://github.com/manish01101/resqplate/blob/main/backend/models/rating.js"
click node_notification_routes "https://github.com/manish01101/resqplate/blob/main/backend/routes/notifications.js"
click node_notification_model "https://github.com/manish01101/resqplate/blob/main/backend/models/notification.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_auth_ui,node_api_client,node_dashboard,node_donate_ui,node_find_food,node_claims_ui,node_admin_ui,node_bot_ui,node_pickup_map,node_routing_machine,node_browser toneBlue
class node_auth_routes,node_auth_middleware,node_user_model toneAmber
class node_donation_routes,node_donation_model,node_matching,node_claim_routes,node_claim_model,node_groq toneMint
class node_chat_routes,node_chat_model,node_rating_routes,node_rating_model,node_notification_routes,node_notification_model toneRose
class node_backend_entry,node_expiry_job,node_admin_routes,node_donor,node_ngo,node_admin,node_osrm toneIndigo
```

## Components

### Web client

- [App routing](https://github.com/manish01101/resqplate/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth context](https://github.com/manish01101/resqplate/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/manish01101/resqplate/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [Role dashboards](https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Donation posting](https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/DonatePage.jsx): `frontend/src/pages/DonatePage.jsx`
- [Food discovery map](https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/FindFoodPage.jsx): `frontend/src/pages/FindFoodPage.jsx`
- [Claims management](https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/MyClaimsPage.jsx): `frontend/src/pages/MyClaimsPage.jsx`
- [Admin dashboard](https://github.com/manish01101/resqplate/blob/main/frontend/src/pages/AdminPage.jsx): `frontend/src/pages/AdminPage.jsx`
- [ResQBot assistant](https://github.com/manish01101/resqplate/blob/main/frontend/src/components/ResQBot.jsx): `frontend/src/components/ResQBot.jsx`
- [Live pickup map](https://github.com/manish01101/resqplate/blob/main/frontend/src/components/ActivePickupMap.jsx): `frontend/src/components/ActivePickupMap.jsx`
- [Route rendering](https://github.com/manish01101/resqplate/blob/main/frontend/src/components/RoutingMachine.jsx): `frontend/src/components/RoutingMachine.jsx`

### Identity and access

- [Authentication routes](https://github.com/manish01101/resqplate/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [JWT authorization](https://github.com/manish01101/resqplate/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User and reliability](https://github.com/manish01101/resqplate/blob/main/backend/models/user.js): `backend/models/user.js`

### Food rescue workflow

- [Donation management](https://github.com/manish01101/resqplate/blob/main/backend/routes/donations.js): `backend/routes/donations.js`
- [Donation records](https://github.com/manish01101/resqplate/blob/main/backend/models/donation.js): `backend/models/donation.js`
- [Volunteer matching](https://github.com/manish01101/resqplate/blob/main/backend/utils/algorithms.js): `backend/utils/algorithms.js`
- [Claim and handoff](https://github.com/manish01101/resqplate/blob/main/backend/routes/claims.js): `backend/routes/claims.js`
- [Claim records](https://github.com/manish01101/resqplate/blob/main/backend/models/claim.js): `backend/models/claim.js`

### Live services

- [Claim chat](https://github.com/manish01101/resqplate/blob/main/backend/routes/chat.js): `backend/routes/chat.js`
- [Chat messages](https://github.com/manish01101/resqplate/blob/main/backend/models/chatMessage.js): `backend/models/chatMessage.js`
- [Ratings](https://github.com/manish01101/resqplate/blob/main/backend/routes/ratings.js): `backend/routes/ratings.js`
- [Rating records](https://github.com/manish01101/resqplate/blob/main/backend/models/rating.js): `backend/models/rating.js`
- [Notification inbox](https://github.com/manish01101/resqplate/blob/main/backend/routes/notifications.js): `backend/routes/notifications.js`
- [Notification records](https://github.com/manish01101/resqplate/blob/main/backend/models/notification.js): `backend/models/notification.js`

### Platform operations

- [HTTP server](https://github.com/manish01101/resqplate/blob/main/backend/index.js): `backend/index.js`
- [Donation expiry](https://github.com/manish01101/resqplate/blob/main/backend/jobs/donationJobs.js): `backend/jobs/donationJobs.js`
- [Admin controls](https://github.com/manish01101/resqplate/blob/main/backend/routes/admin.js): `backend/routes/admin.js`

### Other components

- **Donor**
- **NGO / volunteer**
- **Admin**
- **Web browser**
- **OSRM routing**
- **Groq API**

## Connections

- Donor → App routing: uses
- NGO / volunteer → App routing: uses
- Admin → App routing: uses
- Web browser → App routing: loads
- App routing → Auth context: provides (evidence: `frontend/src/App.jsx`)
- App routing → Role dashboards: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Donation posting: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Food discovery map: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Claims management: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routing → ResQBot assistant: renders (evidence: `frontend/src/App.jsx`)
- Auth context → API client: calls
- Donation posting → API client: calls (evidence: `frontend/src/pages/DonatePage.jsx`)
- Admin dashboard → API client: calls (evidence: `frontend/src/pages/AdminPage.jsx`)
- Role dashboards → API client: calls
- Food discovery map → API client: calls
- Claims management → API client: calls
- API client → HTTP server: HTTP requests
- HTTP server → Authentication routes: mounts (evidence: `backend/index.js`)
- HTTP server → Donation management: mounts (evidence: `backend/index.js`)
- HTTP server → Claim and handoff: mounts (evidence: `backend/index.js`)
- HTTP server → Admin controls: mounts (evidence: `backend/index.js`)
- HTTP server → Claim chat: mounts (evidence: `backend/index.js`)
- HTTP server → Ratings: mounts (evidence: `backend/index.js`)
- HTTP server → Notification inbox: mounts (evidence: `backend/index.js`)
- Authentication routes → User and reliability: reads/writes (evidence: `backend/routes/auth.js`)
- JWT authorization → User and reliability: loads user (evidence: `backend/middleware/auth.js`)
- Donation management → JWT authorization: protects routes (evidence: `backend/routes/donations.js`)
- Claim and handoff → JWT authorization: protects routes (evidence: `backend/routes/claims.js`)
- Donation management → Donation records: reads/writes (evidence: `backend/routes/donations.js`)
- Donation management → User and reliability: queries volunteers (evidence: `backend/routes/donations.js`)
- Donation management → Volunteer matching: ranks volunteers (evidence: `backend/routes/donations.js`)
- Donation management → Claim and handoff: notifies matches
- Claim and handoff → Claim records: creates/updates (evidence: `backend/routes/claims.js`)
- Claim and handoff → Donation records: updates status (evidence: `backend/routes/claims.js`)
- Claim and handoff → User and reliability: updates reliability (evidence: `backend/routes/claims.js`)
- Donation expiry → Donation records: expires listings (evidence: `backend/jobs/donationJobs.js`)
- Admin controls → User and reliability: manages accounts
- Admin controls → Donation records: moderates listings
- Claim chat → Chat messages: stores messages
- Ratings → Rating records: stores ratings
- Notification inbox → Notification records: reads inbox
- Live pickup map → Route rendering: renders route
- Route rendering → OSRM routing: requests route
- ResQBot assistant → Groq API: asks assistant
