How magnusinst84-sudo/empath-hackathon works
Empath.ai is a mental-wellness application combining empathetic chat, mood tracking and analytics, account/settings management, and self-guided wellness activities. The principal workflow is a user entering a chat message, the Flask backend analyzing its emotion and conversation context, and the chatbot returning a safety-aware response; the backend also persists conversations and mood data. The graph includes documented capabilities whose source was not sampled, but omits uncertain connections among them. Backend excerpts are partial, so some endpoint wiring is necessarily left unspecified.
Main entry points: App.tsx App shell · app.py Flask API · fetchWrapper.ts HTTP wrapper · database.py Persistence operations
Components 30
Web experience
- App shell
frontend/src/App.tsx - Login and registration
frontend/src/pages/Login.tsx - Chat interface
frontend/src/pages/ChatInterface.tsx - Mood dashboard
frontend/src/pages/MoodDashboard.tsx - History viewer
frontend/src/pages/HistoryViewer.tsx - Daily check-in
frontend/src/components/DailyCheckIn.tsx - Quick mood log
frontend/src/components/QuickMoodLog.tsx - Authentication state
frontend/src/context/AuthContext.tsx - Settings state
frontend/src/context/SettingsContext.tsx - Auth API client
frontend/src/api-int/auth.ts - Mood API client
frontend/src/api-int/moodApi.ts - Settings API client
frontend/src/api-int/settingsApi.ts - HTTP wrapper
frontend/src/lib/fetchWrapper.ts
Wellness activities
- Onboarding
frontend/src/pages/Onboarding.tsx - Self-care activities
frontend/src/pages/Meditation.tsx - Calming sounds
frontend/src/pages/CalmingSounds.tsx - Gratitude practice
frontend/src/pages/GratitudePractice.tsx - Coping strategies
frontend/src/pages/CopingStrategies.tsx - Journaling
frontend/src/pages/Journaling.tsx - Sleep wellness
frontend/src/pages/SleepWellness.tsx - Eating habits
frontend/src/pages/EatingHabits.tsx - Mindful break
frontend/src/pages/MindfulBreak.tsx
Application backend
- Flask API
backend/app.py - Persistence operations
backend/database.py - SQLite data
Conversation intelligence
- Emotion analyzer
mlmodel/emotion_analyzer.py - Response and safety
mlmodel/chatbot.py - Response selector
mlmodel/ml_response_selector.py
Other components
- User
- External sentiment service
Connections 32
- User → App shell: uses
- App shell → Login and registration: shows
- App shell → Chat interface: shows
- App shell → Mood dashboard: shows
- App shell → History viewer: shows
- App shell → Daily check-in: shows
- App shell → Quick mood log: shows
- App shell → Onboarding: shows
- App shell → Self-care activities: shows
- App shell → Calming sounds: shows
- App shell → Gratitude practice: shows
- App shell → Mindful break: shows
- User → Coping strategies: uses
- User → Journaling: uses
- User → Sleep wellness: uses
- User → Eating habits: uses
- Login and registration → Auth API client: requests auth
- Authentication state → Auth API client: checks session
- Authentication state → Settings API client: loads settings
- Settings state → Settings API client: syncs settings
- Auth API client → HTTP wrapper: sends requests
- Mood API client → HTTP wrapper: sends requests
- Settings API client → HTTP wrapper: sends requests
- HTTP wrapper → Flask API: HTTP requests
- Chat interface → Flask API: submits chat
- Flask API → Persistence operations: reads and writes
- Persistence operations → SQLite data: queries
- Flask API → Emotion analyzer: analyzes emotion
- Flask API → Response and safety: generates response
- Flask API → Persistence operations: loads chat history
- Flask API → External sentiment service: tries sentiment analysis
- Flask API → Persistence operations: stores mood data