How rhea-15/mindscope works
MindScope is a student wellbeing screening app: students submit a guided assessment, receive a stress prediction with explanations and coping suggestions, and can review their results over time. The backend scales inputs, predicts with XGBoost, generates SHAP factors and interventions, and stores assessments in SQLite. The frontend also provides dashboard, printable insights, history management, and a self-help recommendations library. Relationships for the main prediction flow are documented in the README and backend excerpt; unsampled frontend wiring is not inferred.
Main entry points: main.py FastAPI routes · api.ts API client · AssessmentForm.tsx Guided assessment · page.tsx Student dashboard
Components 18
Student experience
- Sign-in entry
frontend/app/page.tsx - Assessment route
frontend/app/student/assessment/page.tsx - Guided assessment
frontend/components/forms/AssessmentForm.tsx - Student dashboard
frontend/app/student/dashboard/page.tsx - Stress insights
frontend/app/student/insights/page.tsx - Assessment history
frontend/app/student/history/page.tsx - Recommendations toolkit
frontend/app/student/recommendations/page.tsx - Charts and metrics
frontend/components/charts/MetricCard.tsx
Frontend services
- API client
frontend/lib/api.ts - Assessment types
frontend/types/index.ts
Assessment engine
- FastAPI routes
backend/main.py - Input scaling
backend/main.py - Stress prediction
backend/main.py - SHAP factors
backend/main.py - Coping suggestions
backend/main.py - Model training
backend/train.py
Assessment records
- SQLite assessments
backend/main.py
Other components
- Student
Connections 25
- Student → Sign-in entry: opens
frontend/app/page.tsx - Sign-in entry → Assessment route: routes to
- Assessment route → Guided assessment: presents
README.md - Guided assessment → API client: submits
README.md - API client → FastAPI routes: POST /predict
README.md - FastAPI routes → Input scaling: scales inputs
backend/main.py - FastAPI routes → Stress prediction: predicts class
backend/main.py - FastAPI routes → SHAP factors: gets factors
backend/main.py - FastAPI routes → Coping suggestions: generates suggestions
backend/main.py - FastAPI routes → SQLite assessments: saves result
backend/main.py - Stress prediction → Model training: uses trained artifacts
- FastAPI routes → SQLite assessments: queries history
backend/main.py - API client → SQLite assessments: history API
README.md - Assessment history → API client: loads and manages
frontend/app/student/history/page.tsx - Student dashboard → API client: loads history
README.md - Stress insights → Charts and metrics: renders gauge
frontend/app/student/insights/page.tsx - Stress insights → Assessment types: uses result types
frontend/app/student/insights/page.tsx - Assessment history → Charts and metrics: renders trend
frontend/app/student/history/page.tsx - Student dashboard → Charts and metrics: shows trend
- Guided assessment → Assessment types: uses input types
- Student → Student dashboard: views wellbeing
README.md - Student → Stress insights: reviews result
README.md - Student → Assessment history: reviews records
README.md - Student → Recommendations toolkit: explores toolkit
README.md - SQLite assessments → SQLite assessments: seeded demo data
backend/main.py