# mallanagowdapatil-commits/donar-sync architecture

> Architecture diagram of the GitHub repository mallanagowdapatil-commits/donar-sync, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mallanagowdapatil-commits/donar-sync
- Repository: https://github.com/mallanagowdapatil-commits/donar-sync

## Overview

DonorSync is a blood-donation coordination platform for donors, receivers, hospitals, blood banks, and administrators. Users can register and sign in, search for available blood, manage donor availability, submit and track emergency requests, and handle inventory. The backend matches requests with nearby donors and dispatches notifications; dashboards also support analytics, administration, and system health. The graph follows the sampled server wiring and matching code; several frontend-to-API connections and unsampled subsystem internals are not shown.

Main entry points: [`client/src/App.jsx`](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/App.jsx) (Web app and routing), [`server/server.js`](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/server.js) (API server), [`server/database/supabase.js`](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/database/supabase.js) (Supabase database), [`server/controllers/requestController.js`](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/requestController.js) (Request lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web app and routing<br/>[App.jsx]"]
  node_authpages["Sign-in and registration<br/>[AuthPages.jsx]"]
  node_search["Blood search<br/>[BloodSearch.jsx]"]
  node_donorreg["Donor registration"]
  node_dashboards["Role dashboards"]
  node_notificationsui["Notification center"]
  node_chatui["Chat assistant UI<br/>[Chatbot.jsx]"]
end

subgraph group_coordination["Donor coordination"]
  node_auth["Account and sessions<br/>[authController.js]"]
  node_donorroutes["Donor routes<br/>[donorRoutes.js]"]
  node_donor["Donor operations<br/>[donorController.js]"]
  node_matchingroutes["Public donor matching<br/>[matchingRoutes.js]"]
  node_requestroutes["Blood request routes<br/>[requestRoutes.js]"]
  node_requests["Request lifecycle"]
  node_matcher["Compatibility matching<br/>[matchingService.js]"]
end

subgraph group_operations["Clinical operations"]
  node_inventoryroutes["Inventory routes<br/>[inventoryRoutes.js]"]
  node_inventory["Stock and expiry management"]
  node_otherops["Admin, organization, analytics, health"]
  node_chat["Clinical assistant endpoint"]
end

subgraph group_platform["Platform services"]
  node_api["API server<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[authRoutes.js]"]
  node_notification["Notification dispatch"]
  node_email["Email delivery<br/>[emailService.js]"]
  node_store[("Supabase database<br/>[supabase.js]")]
  node_memory[("Demo state store<br/>[inMemoryStore.js]")]
end

node_users(("Platform users"))
node_smtp(("SMTP service"))

node_users -->|"use"| node_app
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_donorreg
node_app -->|"routes to"| node_dashboards
node_app -->|"renders"| node_notificationsui
node_app -->|"renders"| node_chatui
node_app -->|"calls"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_donorroutes
node_api -->|"mounts"| node_matchingroutes
node_api -->|"mounts"| node_requestroutes
node_api -->|"mounts"| node_inventoryroutes
node_api -->|"mounts"| node_otherops
node_api -->|"dispatches"| node_chat
node_authroutes -->|"dispatches"| node_auth
node_auth -->|"reads/writes"| node_store
node_auth -->|"fallback reads/writes"| node_memory
node_donorroutes -->|"dispatches"| node_donor
node_donor -->|"reads/writes"| node_store
node_donor -->|"fallback reads/writes"| node_memory
node_matchingroutes -->|"calls"| node_matcher
node_matchingroutes -->|"reads donors"| node_store
node_matchingroutes -->|"fallback reads"| node_memory
node_requestroutes -->|"dispatches"| node_requests
node_requests -->|"calls"| node_matcher
node_requests -->|"reads/writes"| node_store
node_requests -->|"fallback reads/writes"| node_memory
node_requests -->|"alerts matches"| node_notification
node_inventoryroutes -->|"dispatches"| node_inventory
node_inventory -->|"reads/writes"| node_store
node_chat -->|"reads live data"| node_store
node_chat -->|"reads fallback data"| node_memory
node_notification -.->|"sends email"| node_email
node_email -.->|"delivers via"| node_smtp

click node_app "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/App.jsx"
click node_authpages "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/pages/AuthPages.jsx"
click node_search "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/pages/BloodSearch.jsx"
click node_donorreg "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/pages/DonorRegistration.jsx"
click node_dashboards "https://github.com/mallanagowdapatil-commits/donar-sync/tree/main/client/src/pages"
click node_notificationsui "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/components/NotificationCenter.jsx"
click node_chatui "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/components/Chatbot.jsx"
click node_api "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/server.js"
click node_authroutes "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/authRoutes.js"
click node_auth "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/authController.js"
click node_donorroutes "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/donorRoutes.js"
click node_donor "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/donorController.js"
click node_matchingroutes "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/matchingRoutes.js"
click node_requestroutes "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/requestRoutes.js"
click node_requests "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/requestController.js"
click node_matcher "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/services/matchingService.js"
click node_inventoryroutes "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/inventoryRoutes.js"
click node_inventory "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/inventoryController.js"
click node_otherops "https://github.com/mallanagowdapatil-commits/donar-sync/tree/main/server/routes"
click node_chat "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/chatbotController.js"
click node_notification "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/services/notificationService.js"
click node_email "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/services/emailService.js"
click node_store "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/database/supabase.js"
click node_memory "https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/database/inMemoryStore.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_app,node_authpages,node_search,node_donorreg,node_dashboards,node_notificationsui,node_chatui,node_users toneBlue
class node_auth,node_donorroutes,node_donor,node_matchingroutes,node_requestroutes,node_requests,node_matcher toneAmber
class node_inventoryroutes,node_inventory,node_otherops,node_chat toneMint
class node_api,node_authroutes,node_notification,node_email,node_store,node_memory toneRose
class node_smtp toneIndigo
```

## Components

### Web application

- [Web app and routing](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Sign-in and registration](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/pages/AuthPages.jsx): `client/src/pages/AuthPages.jsx`
- [Blood search](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/pages/BloodSearch.jsx): `client/src/pages/BloodSearch.jsx`
- [Donor registration](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/pages/DonorRegistration.jsx): `client/src/pages/DonorRegistration.jsx`
- [Role dashboards](https://github.com/mallanagowdapatil-commits/donar-sync/tree/main/client/src/pages): `client/src/pages`
- [Notification center](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/components/NotificationCenter.jsx): `client/src/components/NotificationCenter.jsx`
- [Chat assistant UI](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/client/src/components/Chatbot.jsx): `client/src/components/Chatbot.jsx`

### Donor coordination

- [Account and sessions](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [Donor routes](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/donorRoutes.js): `server/routes/donorRoutes.js`
- [Donor operations](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/donorController.js): `server/controllers/donorController.js`
- [Public donor matching](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/matchingRoutes.js): `server/routes/matchingRoutes.js`
- [Blood request routes](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/requestRoutes.js): `server/routes/requestRoutes.js`
- [Request lifecycle](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/requestController.js): `server/controllers/requestController.js`
- [Compatibility matching](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/services/matchingService.js): `server/services/matchingService.js`

### Clinical operations

- [Inventory routes](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/inventoryRoutes.js): `server/routes/inventoryRoutes.js`
- [Stock and expiry management](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/inventoryController.js): `server/controllers/inventoryController.js`
- [Admin, organization, analytics, health](https://github.com/mallanagowdapatil-commits/donar-sync/tree/main/server/routes): `server/routes`
- [Clinical assistant endpoint](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/controllers/chatbotController.js): `server/controllers/chatbotController.js`

### Platform services

- [API server](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/server.js): `server/server.js`
- [Authentication routes](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Notification dispatch](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/services/notificationService.js): `server/services/notificationService.js`
- [Email delivery](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/services/emailService.js): `server/services/emailService.js`
- [Supabase database](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/database/supabase.js): `server/database/supabase.js`
- [Demo state store](https://github.com/mallanagowdapatil-commits/donar-sync/blob/main/server/database/inMemoryStore.js): `server/database/inMemoryStore.js`

### Other components

- **Platform users**
- **SMTP service**

## Connections

- Platform users → Web app and routing: use
- Web app and routing → Sign-in and registration: routes to
- Web app and routing → Blood search: routes to
- Web app and routing → Donor registration: routes to
- Web app and routing → Role dashboards: routes to
- Web app and routing → Notification center: renders
- Web app and routing → Chat assistant UI: renders
- Web app and routing → API server: calls
- API server → Authentication routes: mounts
- API server → Donor routes: mounts
- API server → Public donor matching: mounts
- API server → Blood request routes: mounts
- API server → Inventory routes: mounts
- API server → Admin, organization, analytics, health: mounts
- API server → Clinical assistant endpoint: dispatches
- Authentication routes → Account and sessions: dispatches
- Account and sessions → Supabase database: reads/writes
- Account and sessions → Demo state store: fallback reads/writes
- Donor routes → Donor operations: dispatches
- Donor operations → Supabase database: reads/writes
- Donor operations → Demo state store: fallback reads/writes
- Public donor matching → Compatibility matching: calls
- Public donor matching → Supabase database: reads donors
- Public donor matching → Demo state store: fallback reads
- Blood request routes → Request lifecycle: dispatches
- Request lifecycle → Compatibility matching: calls
- Request lifecycle → Supabase database: reads/writes
- Request lifecycle → Demo state store: fallback reads/writes
- Request lifecycle → Notification dispatch: alerts matches
- Inventory routes → Stock and expiry management: dispatches
- Stock and expiry management → Supabase database: reads/writes
- Clinical assistant endpoint → Supabase database: reads live data
- Clinical assistant endpoint → Demo state store: reads fallback data
- Notification dispatch → Email delivery: sends email
- Email delivery → SMTP service: delivers via
