How vanshtyagi-01/mentalhealth works
MentalHealth is a browser-based mental-health score estimator backed by a FastAPI prediction service. The main workflow is user input, client-side validation and payload construction, API validation and country grouping, model inference, then score and insight rendering. The model artifact is present in the tree and loaded by the service. Evidence is limited to the README, file tree, and excerpts; the HTML, styling, model internals, and portions of the JavaScript were not inspected.
Main entry points: main.py FastAPI service · script.js Prediction request · index.html Input form · style.css Visual styling
Components 14
Browser experience
- Input form
index.html - Form interaction
script.js - Input validation
script.js - Payload collection
script.js - Prediction request
script.js - Score and insights
script.js - Visual styling
style.css
Prediction service
- FastAPI service
main.py - Request schema
main.py - Country grouping
main.py - Feature frame
main.py - Score response
main.py
Scoring
- Prediction model
Mental_Health_Model.pkl
Other components
- User
Connections 13
- User → Input form: enters data
- Input form → Form interaction: drives controls
- Form interaction → Input validation: validates input
script.js - Input validation → Payload collection: collects fields
script.js - Payload collection → Prediction request: submits payload
script.js - Prediction request → FastAPI service: POST /predict
script.js - FastAPI service → Request schema: validates request
main.py - FastAPI service → Country grouping: groups country
main.py - FastAPI service → Feature frame: builds features
main.py - FastAPI service → Prediction model: predicts score
main.py - FastAPI service → Score response: returns score
main.py - Prediction request → Score and insights: renders response
script.js - Score and insights → Visual styling: uses styles