How vaibhaw1015/care-setu works
CareSetu is a healthcare access platform whose patient workflows span pharmacy ordering, emergency ambulance requests, AI triage, and nearby care discovery, with separate driver and admin operations. The graph follows the app’s documented routes and sampled calls; README-described capabilities without sampled wiring are retained as subsystem nodes, but their unverified links are dashed. The central workflow is pharmacy search through cart, prescription-aware checkout, order placement, and order tracking. Storage is shown as a shared backend rather than inferring undocumented table-level behavior.
Main entry points: supabaseClient.js Supabase backend · App.jsx Route shell · Checkout.jsx Checkout · orderService.js Order service
Components 26
App and identity
- Route shell
src/App.jsx - Identity and roles
src/context/AuthContext.jsx - Supabase backend
src/lib/supabaseClient.js - Healthcare home
src/pages/Home.jsx
Pharmacy and orders
- Medicine search
src/pages/pharmacy/Search.jsx - Product cards
src/components/ProductCard.jsx - Cart state
src/context/CartContext.jsx - Checkout
src/pages/pharmacy/Checkout.jsx - Prescription review upload
src/components/PrescriptionUpload.jsx - Order service
src/lib/orderService.js - Place-order function
supabase/functions/place-order/index.ts - Payment options
src/components/UpiQr.jsx - Mock payment function
supabase/functions/mock-pay/index.ts - Order tracking
src/pages/orders/MyOrders.jsx - Medical equipment
src/pages/equipment/EquipmentList.jsx
Care access
- AI doctor chat
src/pages/ai-doctor/Chat.jsx - Red-flag screening
src/lib/redFlags.js - Groq streaming client
src/lib/groqClient.js - Ambulance dispatch
src/pages/emergency/Emergency.jsx - Location service
src/context/GeolocationContext.jsx - Hospital discovery
src/pages/nearby/Hospitals.jsx - Interactive map
src/components/MapView.jsx - Health camps
src/pages/nearby/Camps.jsx
Service operations
- Driver console
src/pages/driver/DriverDashboard.jsx - Admin operations
src/pages/admin/Dashboard.jsx
Other components
- Patient
Connections 38
- Patient → Route shell: uses
src/App.jsx - Route shell → Healthcare home: routes to
src/App.jsx - Route shell → Medicine search: routes to
src/App.jsx - Route shell → Medical equipment: routes to
src/App.jsx - Route shell → Checkout: protects route
src/App.jsx - Route shell → Ambulance dispatch: routes to
src/App.jsx - Route shell → AI doctor chat: routes to
src/App.jsx - Route shell → Order tracking: protects route
src/App.jsx - Route shell → Driver console: role routes
src/App.jsx - Route shell → Admin operations: role routes
src/App.jsx - Identity and roles → Supabase backend: auth and profiles
src/context/AuthContext.jsx - Medicine search → Supabase backend: fetches catalog
src/pages/pharmacy/Search.jsx - Medicine search → Product cards: renders cards
src/pages/pharmacy/Search.jsx - Product cards → Cart state: adds products
src/components/ProductCard.jsx - Cart state → Identity and roles: reads user
src/context/CartContext.jsx - Cart state → Supabase backend: syncs cart
src/context/CartContext.jsx - Checkout → Cart state: reads cart
src/pages/pharmacy/Checkout.jsx - Checkout → Prescription review upload: uploads prescription
src/pages/pharmacy/Checkout.jsx - Checkout → Payment options: presents payment
src/pages/pharmacy/Checkout.jsx - Checkout → Order service: places order
src/pages/pharmacy/Checkout.jsx - Order service → Place-order function: invokes function
src/lib/orderService.js - Order service → Supabase backend: verifies and stores
src/lib/orderService.js - Order service → Mock payment function: invokes function
src/lib/orderService.js - Order tracking → Supabase backend: reads orders
src/pages/orders/MyOrders.jsx - AI doctor chat → Red-flag screening: screens messages
src/pages/ai-doctor/Chat.jsx - AI doctor chat → Groq streaming client: streams response
src/pages/ai-doctor/Chat.jsx - AI doctor chat → Supabase backend: saves consultations
src/pages/ai-doctor/Chat.jsx - Ambulance dispatch → Location service: uses location
src/pages/emergency/Emergency.jsx - Ambulance dispatch → Supabase backend: dispatches request
src/pages/emergency/Emergency.jsx - Hospital discovery → Location service: uses location
src/pages/nearby/Hospitals.jsx - Hospital discovery → Supabase backend: loads hospitals
src/pages/nearby/Hospitals.jsx - Hospital discovery → Interactive map: renders locations
src/pages/nearby/Hospitals.jsx - Health camps → Supabase backend: loads camps
src/pages/nearby/Camps.jsx - Health camps → Interactive map: renders locations
src/pages/nearby/Camps.jsx - Driver console → Location service: broadcasts GPS
src/pages/driver/DriverDashboard.jsx - Driver console → Supabase backend: updates missions
src/pages/driver/DriverDashboard.jsx - Admin operations → Supabase backend: manages operations
src/pages/admin/Dashboard.jsx - Medical equipment → Supabase backend: loads equipment
src/pages/equipment/EquipmentList.jsx