How geo211/researcha works
CareLink is a role-based health referral system. Staff manage patients, referrals and queues; patients and the public can follow care status, while staff have dashboard and analytics views. The main path runs from the React client through the Express API to Supabase-backed persistence, with referral and queue actions able to trigger SMS. The graph includes documented AI insights, administration and offline support; their detailed implementations or wiring are not fully shown in the excerpts, so uncertain connections are omitted.
Main entry points: app.js API application · App.jsx CareLink app · store.js Supabase data store · smsService.js SMS notifications
Components 29
Client experience
- CareLink app
client/src/App.jsx - API and offline client
client/src/api.js - Offline queue and cache
client/src/lib/offline.js - Patient management
client/src/pages/Patients.jsx - Referral management
client/src/pages/Referrals.jsx - Dashboard
client/src/pages/Dashboard.jsx - Analytics
client/src/pages/Analytics.jsx - Public tracking
client/src/components/ui/public-tracking.jsx
API workflows
- API application
server/src/app.js - Authentication and RBAC
server/src/middleware/auth.js - Patient records
server/src/routes/patientRoutes.js - Referral workflow
server/src/routes/referralRoutes.js - Queue management
server/src/routes/queueRoutes.js - Admin and settings
server/src/routes/userRoutes.js - Public endpoints
server/src/routes/publicRoutes.js - Analytics endpoints
server/src/routes/analyticsRoutes.js - AI insights endpoint
server/src/routes/aiRoutes.js
Domain services
- AI insights
ai/insights.py - Audit logging
server/src/services/auditService.js - SMS notifications
server/src/services/smsService.js - Role permissions
shared/rbac.js
Data and access
- Supabase data store
server/src/lib/supabase/store.js - SQL query layer
server/src/lib/supabase/query.js - Database connection
server/src/config/db.js
Other components
- Staff user
- Patient user
- Public visitor
- UniSMS API
- Supabase PostgreSQL
Connections 36
- Staff user → CareLink app: uses
client/src/App.jsx - Patient user → CareLink app: uses
client/src/App.jsx - Public visitor → CareLink app: opens tracking
README.md - CareLink app → API and offline client: requests data
client/src/App.jsx - CareLink app → Patient management: renders
client/src/App.jsx - CareLink app → Referral management: renders
client/src/App.jsx - CareLink app → Dashboard: renders
client/src/App.jsx - CareLink app → Analytics: renders
client/src/App.jsx - CareLink app → Public tracking: renders
client/src/App.jsx - API and offline client → Offline queue and cache: caches and queues
client/src/api.js - API and offline client → API application: sends API requests
README.md - API application → Patient records: routes requests
server/src/app.js - API application → Referral workflow: routes requests
server/src/app.js - API application → Queue management: routes requests
server/src/app.js - API application → Admin and settings: routes requests
server/src/app.js - API application → Public endpoints: routes requests
server/src/app.js - API application → Analytics endpoints: routes requests
server/src/app.js - API application → AI insights endpoint: routes requests
server/src/app.js - API application → Database connection: checks connection
server/src/app.js - Patient records → Supabase data store: reads and writes
server/src/routes/patientRoutes.js - Patient records → Audit logging: records changes
server/src/routes/patientRoutes.js - Referral workflow → Supabase data store: reads and updates
server/src/routes/referralRoutes.js - Referral workflow → Audit logging: records actions
server/src/routes/referralRoutes.js - Referral workflow → SMS notifications: sends notifications
server/src/routes/referralRoutes.js - Queue management → Supabase data store: reads and updates
server/src/routes/queueRoutes.js - Queue management → SMS notifications: sends notifications
server/src/routes/queueRoutes.js - SMS notifications → Supabase data store: reads patient and settings
server/src/services/smsService.js - SMS notifications → Supabase data store: writes SMS logs
server/src/services/smsService.js - SMS notifications → UniSMS API: sends SMS
server/src/services/smsService.js - Audit logging → Supabase data store: persists audit
server/src/services/auditService.js - Authentication and RBAC → Role permissions: checks permissions
server/src/middleware/auth.js - Supabase data store → SQL query layer: executes queries
server/src/lib/supabase/store.js - SQL query layer → Database connection: uses pool
server/src/lib/supabase/query.js - Database connection → Supabase PostgreSQL: connects to
README.md - AI insights endpoint → Supabase data store: reads care data
server/src/routes/aiRoutes.js - AI insights endpoint → AI insights: invokes insights