How vaishnavichaubey06/clearing-mental-health-chatbot works
Clearing is a web-based mental wellbeing and self-reflection platform. Users interact through the JavaScript frontend, which calls the FastAPI backend for authentication, chat, tracking, analysis, activities, yoga, and reports. Chat and wellbeing analysis are distinct processing stages; persistence and the configurable LLM are supporting layers. The README documents the feature set, while excerpts and the source index confirm only selected call paths, so unverified links are omitted or marked dashed.
Main entry points: api Feature Endpoints · api.js API Client · main.py FastAPI App · models Wellbeing Records
Components 25
Frontend
- Web Experience
js/app.js - API Client
js/api.js - Chat UI
js/chat.js - Mood UI
js/mood.js - Yoga UI
js/yoga.js
HTTP API
- FastAPI App
backend/app/main.py - Authentication
backend/app/api/auth.py - Chat Endpoint
backend/app/api/chat.py - Feature Endpoints
backend/app/api
AI And Analysis
- Conversation Logic
backend/app/services/chat_service.py - LLM Client
backend/app/ai/llm.py - Emotion Analysis
backend/app/services/emotion_service.py - Wellbeing Assessment
backend/app/services/wellbeing_assessment_service.py - Risk Analysis
backend/app/services/risk_analysis_service.py - Sentiment Analysis
backend/app/services/sentiment_service.py
Wellbeing Features
- Mood And Journal
backend/app/api/moods.py - Activities
backend/app/api/activities.py - Yoga Integration
backend/app/api/yoga.py - Pose Checking
backend/app/yoga/api/main.py - Reports And PDF
backend/app/services/reports_service.py - PDF Generation
backend/app/services/report_pdf_service.py
Persistence
- Database Session
backend/app/db/session.py - Wellbeing Records
backend/app/models
Other components
- User
- LLM Provider
Connections 28
- User → Web Experience: uses
README.md - Web Experience → API Client: requests
README.md - API Client → FastAPI App: calls API
README.md - FastAPI App → Authentication: registers
backend/app/main.py - FastAPI App → Chat Endpoint: registers
backend/app/main.py - FastAPI App → Feature Endpoints: registers
backend/app/main.py - Chat UI → API Client: requests
README.md - Mood UI → API Client: requests
README.md - Yoga UI → API Client: requests
README.md - Authentication → Database Session: uses session
backend/app/api/auth.py - Authentication → Wellbeing Records: registers users
backend/app/api/auth.py - Chat Endpoint → Conversation Logic: delegates
backend/app/api/chat.py - Chat Endpoint → LLM Client: uses client
backend/app/api/chat.py - Conversation Logic → LLM Client: generates replies
- LLM Client → LLM Provider: sends prompt
backend/app/ai/llm.py - Feature Endpoints → Mood And Journal: includes
backend/app/api/moods.py - Feature Endpoints → Activities: includes
backend/app/api/activities.py - Feature Endpoints → Yoga Integration: includes
- Yoga Integration → Pose Checking: uses pose logic
backend/app/yoga/api/main.py - Feature Endpoints → Wellbeing Assessment: assesses
backend/app/api/assessments.py - Feature Endpoints → Risk Analysis: requests analysis
backend/app/api/assessments.py - Wellbeing Assessment → Sentiment Analysis: analyzes text
backend/app/services/wellbeing_assessment_service.py - Wellbeing Assessment → Wellbeing Records: reads records
backend/app/services/wellbeing_assessment_service.py - Feature Endpoints → Emotion Analysis: exposes analysis
- Feature Endpoints → Reports And PDF: provides reports
- Reports And PDF → Wellbeing Records: reads history
backend/app/services/reports_service.py - Reports And PDF → PDF Generation: formats PDF
- Database Session → Wellbeing Records: persists
backend/app/db/session.py