How chettyv/sandhya works
Sandhya is an offline-capable daily Hindu learning and practice app. The main user journey starts with onboarding and leads into daily verses and reflections, scripture reading, practices, and supporting features such as saved items, a private journal, and festival guides. The mobile app is the current product; AI answering and challenge purchases are deferred and default off. The graph includes the documented backend and corpus pipeline, but source evidence is incomplete, so uncertain runtime connections are omitted.
Main entry points: src/index.ts RAG runtime · ask/index.ts AI answer endpoint · ingest-prepared.ts Prepared ingestion · engine.ts Onboarding flow
Components 24
Mobile experience
- Onboarding flow
apps/mobile/src/features/onboarding/engine.ts - Onboarding steps
apps/mobile/src/features/onboarding/steps.ts - Daily learning
apps/mobile/app/(tabs)/index.tsx - Scripture reading
apps/mobile/app/read/[chapter].tsx - Practices
apps/mobile/app/practice/[id].tsx - Festival guides
apps/mobile/app/festival/[id].tsx
Personal practice
- Saved items
apps/mobile/app/saved.tsx - Private journal
apps/mobile/src/lib/localJournalStorage.ts - Secure storage
apps/mobile/src/lib/secureStorage.ts - Chunked storage
apps/mobile/src/lib/chunkedStorage.ts
Backend services
- Account service
supabase/functions/account/index.ts - Push registration
supabase/functions/register-push-token/index.ts - Reflection delivery
supabase/functions/send-daily-reflections/index.ts - AI answer endpoint
supabase/functions/ask/index.ts - Retrieval policy
supabase/functions/_shared/retrieval.ts - Question classifier
supabase/functions/_shared/classifier.ts
Corpus and retrieval
- RAG runtime
packages/rag-pipeline/src/index.ts - RAG classifier
packages/rag-pipeline/src/classifier.ts - Model providers
packages/rag-pipeline/src/providers.ts - Answer safety
packages/rag-pipeline/src/safety.ts - Prepared ingestion
packages/rag-pipeline/src/ingest-prepared.ts - Source rights
packages/rag-pipeline/src/source-rights.ts - Supabase REST
packages/rag-pipeline/src/supabase-rest.ts
Other components
- Learner
Connections 17
- Learner → Onboarding flow: starts setup
README.md - Learner → Daily learning: views daily content
README.md - Learner → Scripture reading: reads scripture
README.md - Learner → Practices: uses practices
README.md - Learner → Festival guides: views guides
README.md - Learner → Saved items: saves items
README.md - Learner → Private journal: writes privately
README.md - Onboarding flow → Onboarding steps: uses steps
apps/mobile/src/features/onboarding/engine.ts - Chunked storage → Secure storage: stores chunks
apps/mobile/src/lib/chunkedStorage.ts - Private journal → Secure storage: reads and writes
apps/mobile/src/lib/localJournalStorage.ts - AI answer endpoint → Question classifier: classifies questions
supabase/functions/ask/index.ts - AI answer endpoint → Retrieval policy: uses retrieval policy
supabase/functions/ask/index.ts - RAG runtime → RAG classifier: checks cacheability
packages/rag-pipeline/src/index.ts - RAG runtime → Model providers: validates answers
packages/rag-pipeline/src/index.ts - RAG runtime → Answer safety: applies safety gate
packages/rag-pipeline/src/index.ts - Prepared ingestion → Source rights: checks rights
packages/rag-pipeline/src/ingest-prepared.ts - Prepared ingestion → Supabase REST: writes corpus