How vinay-ops/mental-health-chatbot-chat-voice- works
MindCare Navigator is a Flask-based mental-health support app. Users reach its pages and APIs through the Flask entry point; the main interaction is submitting a chat message, which the chat route prepares, sends through the AI fallback dispatcher, and can turn into voice using TTS. Other documented capabilities include authentication, multilingual support, community posts, psychologist discovery, and user–psychologist messaging. The database layer persists account, chat, community, and messaging data. Some UI-to-API wiring and unsampled route behavior are not shown, so those connections are omitted rather than inferred.
Main entry points: chat.py AI chat routes · db.py Database operations · __init__.py Blueprint registry · app.py Flask application
Components 20
Web interface
- Page templates
templates - Chat interaction
static/js/chat.js - Language translations
static/js/translations.js
Application routes
- Flask application
app.py - Blueprint registry
backend/routes/__init__.py - Authentication routes
backend/routes/auth.py - AI chat routes
backend/routes/chat.py - Community routes
backend/routes/community.py - Psychologist routes
backend/routes/psychologist.py
Support services
- Configuration
backend/config.py - Auth and text helpers
backend/helpers.py - AI provider fallback
backend/ai/providers.py - Voice synthesis
backend/services/tts.py
Persistence
- Database operations
backend/database/db.py - PostgreSQL client
backend/database/supabase_client.py
Other components
- Visitor
- Supabase PostgreSQL
- AI provider services
- Fish Audio
- OpenStreetMap
Connections 24
- Visitor → Flask application: uses
README.md - Flask application → Blueprint registry: registers
app.py - Blueprint registry → Authentication routes: imports
backend/routes/__init__.py - Blueprint registry → AI chat routes: imports
backend/routes/__init__.py - Blueprint registry → Community routes: imports
backend/routes/__init__.py - Blueprint registry → Psychologist routes: imports
backend/routes/__init__.py - Flask application → Page templates: renders
app.py - Flask application → Database operations: initializes
app.py - Authentication routes → Database operations: reads and writes
backend/routes/auth.py - Authentication routes → Auth and text helpers: hashes and signs
backend/routes/auth.py - AI chat routes → AI provider fallback: generates replies
backend/routes/chat.py - AI chat routes → Voice synthesis: synthesizes speech
backend/routes/chat.py - AI chat routes → Database operations: loads history
backend/routes/chat.py - AI chat routes → Auth and text helpers: formats replies
backend/routes/chat.py - AI chat routes → Configuration: reads settings
backend/routes/chat.py - Community routes → Database operations: reads and writes
backend/routes/community.py - Community routes → Auth and text helpers: extracts identity
backend/routes/community.py - Psychologist routes → Database operations: reads and writes
backend/routes/psychologist.py - Psychologist routes → Auth and text helpers: checks tokens
backend/routes/psychologist.py - Psychologist routes → OpenStreetMap: searches locations
backend/routes/psychologist.py - Database operations → PostgreSQL client: uses client
backend/database/db.py - PostgreSQL client → Supabase PostgreSQL: connects to
backend/database/supabase_client.py - AI provider fallback → AI provider services: calls providers
backend/ai/providers.py - Voice synthesis → Fish Audio: sends synthesis
backend/services/tts.py