How cavlord/status-gizi-puga works
This is a web dashboard for monitoring and reporting UPT Puskesmas Pulau Gadang operational and child-nutrition data. Users authenticate, then access dashboard, records, and analytics views with filtering and visual summaries; administrators also have user-management and spreadsheet-import capabilities. The graph reflects documented routes and sampled data/auth/import behavior. Other page internals and the implementation of Google Sheets data fetching were not sampled, so their wiring is kept conservative.
Main entry points: App.tsx Routes and providers · AuthContext.tsx Auth state · UserManagement.tsx User management · index.ts Spreadsheet import
Components 22
Application shell
- React entry
src/main.tsx - Routes and providers
src/App.tsx - Shared layout
src/components/AppLayout.tsx - Application settings
src/pages/Settings.tsx
Health data views
- Dashboard summaries
src/pages/Dashboard.tsx - Record search
src/pages/DataRecords.tsx - Health analytics
src/pages/Analytics.tsx - Health data state
src/contexts/DataContext.tsx - Sheets data access
src/lib/googleSheets.ts
Authentication
- Sign-in and registration
src/pages/Auth.tsx - Auth state
src/contexts/AuthContext.tsx - Login endpoint
supabase/functions/auth-login/index.ts - Registration endpoint
supabase/functions/auth-register/index.ts - OTP verification
supabase/functions/auth-verify-otp/index.ts - OTP resend
supabase/functions/auth-resend-otp/index.ts
Administration
- User management
src/pages/UserManagement.tsx - List users
supabase/functions/admin-get-users/index.ts - Update user
supabase/functions/admin-update-user/index.ts - Spreadsheet import
supabase/functions/import-from-sheets/index.ts
External systems
- Google Sheets
- Supabase database
Other components
- Dashboard user
Connections 21
- Dashboard user → React entry: opens
- React entry → Routes and providers: renders
- Routes and providers → Auth state: provides auth
- Routes and providers → Health data state: provides data
- Routes and providers → Sign-in and registration: routes auth
- Routes and providers → Shared layout: wraps protected views
- Routes and providers → Dashboard summaries: routes dashboard
- Routes and providers → Record search: routes records
- Routes and providers → Health analytics: routes analytics
- Routes and providers → Application settings: routes settings
- Routes and providers → User management: routes users
- Sign-in and registration → Auth state: requests auth
- Auth state → Login endpoint: calls login
- Auth state → Registration endpoint: calls registration
- Auth state → OTP verification: calls verification
- Auth state → OTP resend: calls resend
- Health data state → Sheets data access: fetches records
- User management → List users: requests users
- User management → Update user: updates users
- Spreadsheet import → Google Sheets: reads spreadsheet
- Spreadsheet import → Supabase database: replaces records