Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Mental Stress Assessment

Predict stress levels and get tailored coping suggestions—powered by machine learning.
By Leela Dammalapati, with contributions from Utkarsh Tripathi.

Python 3.11 Flask 3.0 MIT


Try it online

No setup required—use the live app here:
→ mental-stress-assessment on Render


What it does

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.


What’s included

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.

Stack

  • 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

Run it locally

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.py

Then open http://localhost:5000 in your browser.


Repo layout

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

Hosting

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).

Deploy to Render


Roadmap

  • Email alerts when stress is high
  • Export assessment history as PDF
  • Mobile app
  • Wearable / external data integration
  • More languages

People

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages