How rizz-vizz/kutumbh-care works
Purpose and Runtime
Kutumbh Care is a Vite/React/TypeScript healthcare PWA concept serving patient/family, clinician, and maternity-care workflows. Browser startup is src/main.tsx, which mounts the application in src/App.tsx; production static output is under build/. The UI is component-driven rather than organized as a separate backend service.
Application Shell and Cross-Cutting State
src/App.tsx is the likely orchestration boundary for portal/screen selection. Context providers centralize session/demo behavior, language, theme, offline state, and speech support:
• src/components/auth-context.tsx
• src/components/offline-context.tsx
• src/components/speech-recognition-context.tsx
This layer separates shared browser/session capabilities from individual medical workflows.
Identity, Onboarding, and Environment Setup
Authentication and demo access are handled in the client-facing auth/onboarding flow, with database setup utilities for bootstrap or recovery:
• src/components/auth-screen.tsx
• src/components/demo-auth-provider.tsx
• src/components/database-setup.tsx
Supabase client connection and setup are isolated under src/utils/supabase/client.tsx and src/utils/supabase/auto-setup.tsx. The repository includes SQL schemas and fixes, indicating PostgreSQL/Supabase is the persistence and authorization boundary.
Patient and Family Care Portal
The patient-facing surface composes household management, records, vitals, consultations, prescription intake, health discovery, pharmacy, and emergency actions:
• src/components/patient-dashboard.tsx
• src/components/family-card.tsx
• src/components/vitals-tracker.tsx
Supporting flows include teleconsultation.tsx, patient-records.tsx, prescription-upload.tsx, pharmacy-finder.tsx, and emergency-panel.tsx. These components form the primary patient data-entry and care-navigation path.
Clinical and Maternal Workspaces
Clinician workflows are grouped around dashboard alerts, patient history, consultations, and prescription authoring:
• src/components/doctor-dashboard.tsx
• src/components/doctor-alert-form.tsx
• src/components/prescription-pad.tsx
Specialized reproductive-health workflows are represented separately by src/components/pregnancy-dashboard.tsx, src/components/period-care.tsx, and related restored/fixed variants. The component naming suggests iterative UI versions coexist, so consumers should identify which variants App.tsx actually mounts.
Voice, Accessibility, and Offline Boundaries
Voice-driven navigation and symptom capture are isolated from the core portals:
• src/components/voice-interface.tsx
• src/components/voice-symptom-checker.tsx
• src/components/microphone-permission-guard.tsx
Offline behavior is represented by offline-context.tsx and offline-medical-records.tsx. Browser APIs—microphone/speech recognition, local storage/IndexedDB as described by the README, and connectivity state—are a client-runtime boundary; synchronization requires Supabase-facing code.
Supabase Data and Server Functions
Database schema, migration/fix scripts, and edge/server functions are colocated in src/supabase/:
• src/supabase/basic-schema.sql
• src/supabase/comprehensive-schema-fix.sql
• src/supabase/functions/server/index.tsx
Dedicated functions serve survey submission, health checks, demo-user provisioning, and Supercoins administration/user queries. Survey calls are abstracted through src/utils/survey-api.ts. Material external infrastructure is Supabase/PostgreSQL with RLS; the README also claims WebRTC, wearable APIs, OCR/NLP, and TensorFlow-based predictive analysis, but corresponding Python/ML or integration source is not present in this tree.
Main entry points: App.tsx Application shell · client.tsx Supabase client · auth-context.tsx Shared contexts · auth-screen.tsx Auth and onboarding
Components 19
Browser PWA
- Browser startup
src/main.tsx - Application shell · Selects portal and screen flows.
src/App.tsx - Shared contexts · Auth, offline, and speech capabilities are shared here.
src/components/auth-context.tsx - Auth and onboarding
src/components/auth-screen.tsx - Demo access
src/components/demo-auth-provider.tsx - Database setup
src/components/database-setup.tsx - Voice interface · Voice navigation and symptom capture are isolated from portals.
src/components/voice-interface.tsx - Offline medical records
src/components/offline-medical-records.tsx
Care Workspaces
- Patient care portal · Household, records, vitals, care navigation, and emergency actions.
src/components/patient-dashboard.tsx - Family and vitals
src/components/family-card.tsx - Clinician workspace · Patient history, alerts, consultations, and prescriptions.
src/components/doctor-dashboard.tsx - Alerts and prescriptions
src/components/prescription-pad.tsx - Maternal care workspace
src/components/pregnancy-dashboard.tsx
Supabase Data Services
- Supabase client
src/utils/supabase/client.tsx - Supabase auto-setup
src/utils/supabase/auto-setup.tsx - Survey API
src/utils/survey-api.ts - Server functions · Provides survey, health check, demo-user, and Supercoins operations.
src/supabase/functions/server/index.tsx - PostgreSQL with RLS · Schema and fixes define the data and authorization boundary.
src/supabase/basic-schema.sql
Other components
- Production static output
Connections 21
- Browser startup → Application shell: mounts
- Application shell → Shared contexts: uses
- Application shell → Auth and onboarding: routes to
- Auth and onboarding → Demo access: supports
- Application shell → Patient care portal: selects
- Patient care portal → Family and vitals: composes
- Application shell → Clinician workspace: selects
- Clinician workspace → Alerts and prescriptions: composes
- Application shell → Maternal care workspace: selects
- Shared contexts → Voice interface: provides speech state
- Shared contexts → Offline medical records: provides offline state
- Auth and onboarding → Supabase client: authenticates through
- Database setup → Supabase auto-setup: uses
- Supabase auto-setup → Supabase client: configures
- Patient care portal → Supabase client: reads and writes care data
- Clinician workspace → Supabase client: reads and writes clinical data
- Offline medical records → Supabase client: synchronizes with
- Survey API → Server functions: submits surveys
- Supabase client → PostgreSQL with RLS: accesses under RLS
- Server functions → PostgreSQL with RLS: queries and administers
- Application shell → Production static output: bundled into