An end-to-end Machine Learning web application that analyzes an individual's social media usage habits, sleep patterns, exercise routines, and daily stress levels to predict an overall Mental Health Score (0 - 10).
Built with a FastAPI REST backend, a scikit-learn Machine Learning pipeline, and a modern React + Vite + Tailwind CSS glassmorphism frontend featuring a real-time dynamic semi-circle gauge meter.
- Real-time Prediction: Calculates mental health scores based on daily screen time, phone unlocks, sleep, study, and physical activity.
- Interactive Dashboard: Modern dark-mode UI with dynamic semi-circle gauge meter and score evaluation badges (Optimal, Moderate, High Distress Risk).
- Robust Backend: FastAPI server with strict Pydantic input validation and CORS middleware configured.
- Decoupled Architecture: Clean separation between Frontend and Backend, supporting environment variables (
.env).
- Python 3.12 / 3.13
- FastAPI (REST API Framework)
- Scikit-Learn (ML Pipeline & Data Preprocessing)
- Pandas & Joblib (Data Manipulation & Model Persistence)
- Uvicorn (ASGI Web Server)
- React 18 + Vite
- Tailwind CSS (Styling & Responsive UI)
- Lucide React (Modern Icon Sets)
MENTAL HEALTH SCORE FROM SOCIAL MEDIA/
│
├── Backend/
│ ├── main.py # FastAPI server & prediction routes
│ ├── Mental_Health_Model.pkl # Trained Scikit-Learn Model Pipeline
│ ├── requirements.txt # Python dependencies
│ └── .env # Backend environment variables
│
└── Frontend/
├── src/
│ ├── components/ # React components (Form & Gauge Meter)
│ ├── App.jsx # Main application component
│ └── main.jsx
├── package.json # Frontend dependencies & scripts
├── .env # Vite environment variables (API Base URL)
└── vite.config.js