How useriswild7099/zen works
Zen AI is a privacy-focused mental-wellness desktop/web application: users check in, chat with a specialized support persona, receive emotional or crisis guidance, and can use grounding exercises and a private journal. The frontend communicates with a stateless FastAPI backend for chat, analysis, navigation, translation, and optional score-only Sahayak triage; local Ollama supplies inference. Journal storage is client-side. The README documents capabilities beyond the sampled source, so those branches are shown at subsystem level without guessing internal call chains.
Main entry points: main.py FastAPI Entry · api.ts API Client · page.tsx Sanctuary UI · chat.py Chat API
Components 25
User Sanctuary
- Sanctuary UI
frontend/src/app/page.tsx - Chat Support
frontend/src/components/ChatInterface.tsx - Voice Input
frontend/src/hooks/useWhisper.ts - PII Scrubbing
frontend/src/lib/privacy.ts - Grounding Tools
frontend/src/components/BreathingExercise.tsx - Journal Features
frontend/src/components/EnhancedJournal.tsx - Local Journal
frontend/src/lib/storage.ts - API Client
frontend/src/lib/api.ts
Support Services
- FastAPI Entry
backend/main.py - Chat API
backend/routers/chat.py - Sentiment API
backend/routers/sentiment.py - Sia Navigator
backend/routers/sia.py - Translation API
backend/routers/translate.py - Journal API
backend/routers/journal.py - Sahayak API
backend/routers/sahayak.py - Emotion Analysis
backend/services/nlp_engine.py - Crisis Detection
backend/services/crisis_detector.py - Care Interventions
backend/services/intervention_engine.py - Support Knowledge
backend/services/knowledge_base.py - Score Sync
backend/services/sahayak_sync.py
Local Inference
- Model Client
backend/services/ollama_client.py
Sahayak Triage
- Reviewer Portal
- Anonymous Scores
backend/routers/sahayak.py
Other components
- Person
- Ollama
Connections 28
- Person → Sanctuary UI: uses
- Sanctuary UI → Chat Support: opens
- Sanctuary UI → Grounding Tools: offers
- Sanctuary UI → Journal Features: opens
- Sanctuary UI → API Client: requests
- Chat Support → Voice Input: captures speech
- Chat Support → PII Scrubbing: scrubs text
- PII Scrubbing → API Client: sends payload
- Journal Features → Local Journal: reads/writes
- FastAPI Entry → Chat API: dispatches
- FastAPI Entry → Sentiment API: dispatches
- FastAPI Entry → Sia Navigator: dispatches
- FastAPI Entry → Translation API: dispatches
- FastAPI Entry → Journal API: dispatches
- FastAPI Entry → Sahayak API: dispatches
- API Client → Chat API: calls
- API Client → Sentiment API: calls
- API Client → Sia Navigator: calls
- API Client → Translation API: calls
- Chat API → Model Client: generates replies
- Sentiment API → Emotion Analysis: analyzes emotion
- Sentiment API → Crisis Detection: checks risk
- Sia Navigator → Support Knowledge: finds resources
- Chat API → Care Interventions: selects care
- Model Client → Ollama: runs local models
- Sahayak API → Score Sync: syncs scores
- Score Sync → Anonymous Scores: stores scores
- Reviewer Portal → Anonymous Scores: reviews scores