How ujjvxl/saathi works
Saathi is a shared elder-care application centered on a care circle. Members join and manage profiles, medication schedules, appointments and dose decisions; scheduled reminders escalate unconfirmed doses to responsible people and the wider circle, while activity and insights make care visible. The graph includes the documented voice-first elder mode and prescription scanning. Some subsystems are represented at their exact directory path because their source was not sampled; those links rely on README descriptions rather than inspected implementation.
Main entry points: db.ts Application database · dal.ts Session and membership access · reminders.ts Reminder and escalation engine · page.tsx Profile overview
Components 23
Identity and care circle
- Sign in and join
src/app/(auth)/login/page.tsx - Session and membership access
src/lib/auth/dal.ts - Care profiles and roles
src/app/actions/profiles.ts - Application database
src/lib/db.ts
Care operations
- Care dashboard
src/app/(app)/dashboard/page.tsx - Profile overview
src/app/(app)/p/[profileId]/page.tsx - Medication schedules
src/app/(app)/p/[profileId]/medications/page.tsx - Dose decisions
src/app/actions/doses.ts - Doctor appointments
src/app/(app)/p/[profileId]/appointments/page.tsx - Circle and responsibilities
src/app/(app)/p/[profileId]/circle/page.tsx - Prescription scanning
src/app/api/profiles/[profileId]/scan/route.ts - Gemini AI services
src/lib/ai/gemini.ts - Dose scheduling rules
src/lib/schedule.ts
Reminders and accountability
- Reminder scheduler
src/app/api/cron/reminders/route.ts - Reminder and escalation engine
src/lib/reminders.ts - Alert acknowledgement
src/app/alerts/ack/page.tsx - Accountability timeline
src/app/(app)/p/[profileId]/timeline/page.tsx
Insights and elder access
- Health insights
src/app/(app)/p/[profileId]/insights/page.tsx - Adherence calculations
src/lib/insights-core.ts - Weekly summary email
src/lib/email/weekly-summary.ts - Voice-first elder mode
src/components/elder/elder-mode.tsx
Other components
- Elders and care circle
- Email delivery
Connections 29
- Elders and care circle → Sign in and join: sign in or join
- Sign in and join → Session and membership access: establishes session
- Session and membership access → Application database: checks membership
src/lib/auth/dal.ts - Care dashboard → Session and membership access: loads member
src/app/(app)/dashboard/page.tsx - Care dashboard → Application database: loads care data
- Care profiles and roles → Application database: manages profiles
- Profile overview → Session and membership access: requires membership
src/app/(app)/p/[profileId]/page.tsx - Profile overview → Application database: loads profile data
- Medication schedules → Application database: manages schedules
- Medication schedules → Prescription scanning: requests scan
- Prescription scanning → Session and membership access: checks membership
src/app/api/profiles/[profileId]/scan/route.ts - Prescription scanning → Gemini AI services: reads prescription
src/app/api/profiles/[profileId]/scan/route.ts - Gemini AI services → Email delivery: calls Gemini
src/lib/ai/gemini.ts - Dose decisions → Application database: records decisions
- Profile overview → Dose scheduling rules: computes dose state
src/app/(app)/p/[profileId]/page.tsx - Doctor appointments → Application database: manages visits
- Circle and responsibilities → Application database: loads circle data
- Reminder scheduler → Reminder and escalation engine: runs reminders
src/app/api/cron/reminders/route.ts - Reminder and escalation engine → Application database: reads and updates care data
src/lib/reminders.ts - Reminder and escalation engine → Email delivery: sends email
- Elders and care circle → Alert acknowledgement: acknowledges follow-up
- Alert acknowledgement → Reminder and escalation engine: records acknowledgement
- Accountability timeline → Application database: shows care activity
- Health insights → Adherence calculations: summarizes dose history
src/app/(app)/p/[profileId]/insights/page.tsx - Health insights → Gemini AI services: requests optional summary
src/app/(app)/p/[profileId]/insights/page.tsx - Weekly summary email → Adherence calculations: summarizes adherence
- Weekly summary email → Email delivery: sends weekly email
- Voice-first elder mode → Dose decisions: records confirmed doses
- Elders and care circle → Voice-first elder mode: uses elder mode