# rajbhokare/sevaconnect-sih-2026 architecture

> Architecture diagram of the GitHub repository rajbhokare/sevaconnect-sih-2026, 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/rajbhokare/sevaconnect-sih-2026
- Repository: https://github.com/rajbhokare/sevaconnect-sih-2026

## Overview

SevaConnect is a cooperative-owned marketplace connecting customers with independent service workers, with cooperative operations for verification, fairness, and demand planning. The main customer journey is service discovery or emergency request, provider selection, booking, and payment; workers manage requests and profiles, while cooperatives oversee workforce operations and provider ranking. The frontend, Express API, Python AI service, and shared state form the main layers. Several UI and controller implementations were not sampled, so those branches reflect documented capabilities and indexed references rather than inspected call details.

Main entry points: [`backend/server.js`](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/server.js) (Express API server), [`frontend/src/App.jsx`](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/App.jsx) (Role-based app), [`frontend/src/services/api.js`](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/services/api.js) (API client), [`ai/main.py`](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/main.py) (Python AI service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace clients"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_discovery["Service discovery"]
  node_emergency["Emergency booking"]
  node_customer_bookings["Customer bookings"]
  node_worker_dashboard["Worker dashboard"]
  node_worker_welfare["Worker welfare<br/>[WorkerWelfare.jsx]"]
  node_ai_operations["AI operations hub<br/>[AiOperations.jsx]"]
  node_federation["Federation dashboard"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Marketplace API"]
  node_server["Express API server<br/>[server.js]"]
  node_auth["Authentication<br/>[authController.js]"]
  node_workers["Worker profiles"]
  node_booking["Booking management"]
  node_matching["FairMatch allocation<br/>[matchController.js]"]
  node_payments["Payments"]
  node_ratings["Ratings and reviews"]
  node_ranking["Provider ranking"]
  node_ai_proxy["AI proxy<br/>[aiProxyRoutes.js]"]
end

subgraph group_ai["AI operations"]
  node_ai_service["Python AI service<br/>[main.py]"]
  node_ai_ranking["AI ranking engine<br/>[ranking.py]"]
  node_forecast["Demand forecasting<br/>[forecast.py]"]
  node_allocation["Workforce planning<br/>[allocation.py]"]
end

subgraph group_state["Marketplace state"]
  node_store[("Demo state store<br/>[store.js]")]
  node_mongo[("MongoDB")]
end

node_customer(("Customer"))
node_coordinator(("Cooperative coordinator"))

node_customer -.->|"uses"| node_app
node_coordinator -.->|"uses"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_emergency
node_app -->|"routes to"| node_customer_bookings
node_app -->|"routes to"| node_worker_dashboard
node_app -->|"routes to"| node_ai_operations
node_app -->|"routes to"| node_federation
node_discovery -->|"requests data"| node_api_client
node_discovery -.->|"starts booking"| node_booking
node_emergency -.->|"requests service"| node_booking
node_customer_bookings -.->|"loads bookings"| node_api_client
node_worker_dashboard -->|"loads work"| node_api_client
node_worker_welfare -.->|"loads welfare"| node_api_client
node_ai_operations -.->|"requests operations"| node_api_client
node_api_client -.->|"calls API"| node_server
node_server -->|"mounts routes"| node_auth
node_server -->|"mounts routes"| node_workers
node_server -->|"mounts routes"| node_booking
node_server -->|"mounts routes"| node_matching
node_server -->|"mounts routes"| node_payments
node_server -->|"mounts routes"| node_ratings
node_server -->|"mounts routes"| node_ranking
node_server -->|"mounts routes"| node_ai_proxy
node_booking -->|"reads and writes"| node_store
node_workers -->|"reads and writes"| node_store
node_auth -->|"reads users"| node_store
node_payments -->|"reads and writes"| node_store
node_ranking -->|"reads and updates"| node_store
node_ranking -->|"requests ranking"| node_ai_service
node_ai_proxy -->|"proxies requests"| node_ai_service
node_ai_service -->|"uses"| node_ai_ranking
node_ai_service -->|"uses"| node_forecast
node_ai_service -->|"uses"| node_allocation
node_server -->|"connects"| node_mongo

click node_app "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/App.jsx"
click node_discovery "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/customer/ServiceDiscovery.jsx"
click node_emergency "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/customer/EmergencyBooking.jsx"
click node_customer_bookings "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/customer/CustomerBookings.jsx"
click node_worker_dashboard "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/worker/WorkerDashboard.jsx"
click node_worker_welfare "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/worker/WorkerWelfare.jsx"
click node_ai_operations "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/cooperative/AiOperations.jsx"
click node_federation "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/cooperative/FederationDashboard.jsx"
click node_api_client "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/server.js"
click node_auth "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/authController.js"
click node_workers "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/workerController.js"
click node_booking "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/bookingController.js"
click node_matching "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/matchController.js"
click node_payments "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/paymentController.js"
click node_ratings "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/ratingController.js"
click node_ranking "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/rankingController.js"
click node_ai_proxy "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/routes/aiProxyRoutes.js"
click node_store "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/config/store.js"
click node_ai_service "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/main.py"
click node_ai_ranking "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/ranking.py"
click node_forecast "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/forecast.py"
click node_allocation "https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/allocation.py"

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_discovery,node_emergency,node_customer_bookings,node_worker_dashboard,node_worker_welfare,node_ai_operations,node_federation,node_api_client toneBlue
class node_server,node_auth,node_workers,node_booking,node_matching,node_payments,node_ratings,node_ranking,node_ai_proxy toneAmber
class node_ai_service,node_ai_ranking,node_forecast,node_allocation toneMint
class node_store,node_mongo toneRose
class node_customer,node_coordinator toneIndigo
```

## Components

### Marketplace clients

- [Role-based app](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Service discovery](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/customer/ServiceDiscovery.jsx): `frontend/src/pages/customer/ServiceDiscovery.jsx`
- [Emergency booking](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/customer/EmergencyBooking.jsx): `frontend/src/pages/customer/EmergencyBooking.jsx`
- [Customer bookings](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/customer/CustomerBookings.jsx): `frontend/src/pages/customer/CustomerBookings.jsx`
- [Worker dashboard](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/worker/WorkerDashboard.jsx): `frontend/src/pages/worker/WorkerDashboard.jsx`
- [Worker welfare](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/worker/WorkerWelfare.jsx): `frontend/src/pages/worker/WorkerWelfare.jsx`
- [AI operations hub](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/cooperative/AiOperations.jsx): `frontend/src/pages/cooperative/AiOperations.jsx`
- [Federation dashboard](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/pages/cooperative/FederationDashboard.jsx): `frontend/src/pages/cooperative/FederationDashboard.jsx`
- [API client](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Marketplace API

- [Express API server](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Worker profiles](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/workerController.js): `backend/controllers/workerController.js`
- [Booking management](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/bookingController.js): `backend/controllers/bookingController.js`
- [FairMatch allocation](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/matchController.js): `backend/controllers/matchController.js`
- [Payments](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/paymentController.js): `backend/controllers/paymentController.js`
- [Ratings and reviews](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/ratingController.js): `backend/controllers/ratingController.js`
- [Provider ranking](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/controllers/rankingController.js): `backend/controllers/rankingController.js`
- [AI proxy](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/routes/aiProxyRoutes.js): `backend/routes/aiProxyRoutes.js`

### AI operations

- [Python AI service](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/main.py): `ai/main.py`
- [AI ranking engine](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/ranking.py): `ai/ranking.py`
- [Demand forecasting](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/forecast.py): `ai/forecast.py`
- [Workforce planning](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/ai/allocation.py): `ai/allocation.py`

### Marketplace state

- [Demo state store](https://github.com/rajbhokare/sevaconnect-sih-2026/blob/main/backend/config/store.js): `backend/config/store.js`
- **MongoDB**

### Other components

- **Customer**
- **Cooperative coordinator**

## Connections

- Customer → Role-based app: uses (evidence: `README.md`)
- Cooperative coordinator → Role-based app: uses (evidence: `README.md`)
- Role-based app → Service discovery: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app → Emergency booking: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app → Customer bookings: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app → Worker dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app → AI operations hub: routes to (evidence: `frontend/src/App.jsx`)
- Role-based app → Federation dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Service discovery → API client: requests data (evidence: `frontend/src/pages/customer/ServiceDiscovery.jsx`)
- Service discovery → Booking management: starts booking (evidence: `README.md`)
- Emergency booking → Booking management: requests service (evidence: `README.md`)
- Customer bookings → API client: loads bookings (evidence: `README.md`)
- Worker dashboard → API client: loads work (evidence: `frontend/src/pages/worker/WorkerDashboard.jsx`)
- Worker welfare → API client: loads welfare (evidence: `README.md`)
- AI operations hub → API client: requests operations (evidence: `README.md`)
- API client → Express API server: calls API (evidence: `README.md`)
- Express API server → Authentication: mounts routes (evidence: `backend/server.js`)
- Express API server → Worker profiles: mounts routes (evidence: `backend/server.js`)
- Express API server → Booking management: mounts routes (evidence: `backend/server.js`)
- Express API server → FairMatch allocation: mounts routes (evidence: `backend/server.js`)
- Express API server → Payments: mounts routes (evidence: `backend/server.js`)
- Express API server → Ratings and reviews: mounts routes (evidence: `backend/server.js`)
- Express API server → Provider ranking: mounts routes (evidence: `backend/server.js`)
- Express API server → AI proxy: mounts routes (evidence: `backend/server.js`)
- Booking management → Demo state store: reads and writes (evidence: `backend/controllers/bookingController.js`)
- Worker profiles → Demo state store: reads and writes (evidence: `backend/controllers/workerController.js`)
- Authentication → Demo state store: reads users (evidence: `backend/controllers/authController.js`)
- Payments → Demo state store: reads and writes (evidence: `backend/controllers/paymentController.js`)
- Provider ranking → Demo state store: reads and updates (evidence: `backend/controllers/rankingController.js`)
- Provider ranking → Python AI service: requests ranking (evidence: `backend/controllers/rankingController.js`)
- AI proxy → Python AI service: proxies requests (evidence: `backend/routes/aiProxyRoutes.js`)
- Python AI service → AI ranking engine: uses (evidence: `ai/main.py`)
- Python AI service → Demand forecasting: uses (evidence: `ai/main.py`)
- Python AI service → Workforce planning: uses (evidence: `ai/main.py`)
- Express API server → MongoDB: connects (evidence: `backend/server.js`)
