Predict stress levels and get tailored coping suggestions—powered by machine learning.
By Leela Dammalapati, with contributions from Utkarsh Tripathi.
No setup required—use the live app here:
→ mental-stress-assessment on Render
This web app helps students understand their current stress level and suggests evidence-based coping strategies. You sign up, complete a short assessment (demographics, habits, academic load, support, etc.), and receive:
- A stress classification (Low / Medium / High) with confidence scores
- Top 5 coping mechanisms recommended for people with similar profiles
Everything is stored per user, so you can track how your stress and recommendations change over time.
| Area | Description |
|---|---|
| Auth & profiles | Sign up, log in, and manage multiple profiles (e.g. for different family members). |
| Predictions | Random Forest model predicts stress level from ~20 input features. |
| Recommendations | k-NN model suggests coping mechanisms from similar users (k=50). |
| History | View past assessments and trends. |
| UI | Responsive, gradient-style interface that works on desktop and mobile. |
- Server: Flask 3.0, SQLAlchemy, Flask-Login; production DB: PostgreSQL
- ML: scikit-learn (Random Forest + k-NN), pandas, numpy, joblib
- Client: HTML5, CSS3, JavaScript; no heavy frameworks
You need: Python 3.11+ and pip.
# Get the repo
git clone https://github.com/utkarsh9630/mental-stress-assessment.git
cd mental-stress-assessment
# Isolate dependencies
python -m venv venv
source venv/bin/activate # on Windows: venv\Scripts\activate
# Install and configure
pip install -r requirements.txt
cp .env.example .env # then edit .env as needed
# Start the app
python app.pyThen open http://localhost:5000 in your browser.
mental-stress-assessment/
├── app.py # Flask app and routes
├── models.py # SQLAlchemy models
├── forms.py # WTForms
├── templates/ # HTML (base, auth, dashboard, assess)
├── models/ # Trained artifacts (rf_model, knn_model, scaler, *.json)
├── data/ # train_recs.csv etc.
├── requirements.txt
├── Procfile # for Render
└── README.md
The demo runs on Render with a PostgreSQL database. To deploy your own instance, use the button below (or follow Render’s docs for Flask + Postgres).
- Email alerts when stress is high
- Export assessment history as PDF
- Mobile app
- Wearable / external data integration
- More languages
- Leela Dammalapati — original author
- Utkarsh Tripathi — contributor
We’re open to pull requests and ideas. See the repo:
github.com/utkarsh9630/mental-stress-assessment
Contact: Leela Dammalapati (original author); Utkarsh Tripathi — tripathiutkarsh46@gmail.com
License: MIT — see the LICENSE file.