Mental Health AI App

This is a FastAPI + React + MySQL application that helps monitor stress levels, provide coping strategies, and allow event logging & journaling.

Overview

Mental Health AI System

  • Emotion Detection & Analysis: Uses a webcam to detect emotions and analyze text input for signs of stress or emotional distress.
  • Event Logging & Stress Prediction: Users log upcoming events (e.g., exams, meetings), and AI predicts stress levels based on event type. <!-- - Journaling & Self-Reflection: Users can write journal entries related to logged events, tracking mood changes over time. -->
  • Secure Data Storage: Stores emotions, events, and journal entries in a MySQL database for tracking stress trends.
  • AI-Based Text Analysis: Analyzes user input to detect signs of frustration, anxiety, or emotional distress.
  • Privacy & Security: No unnecessary data collection, and user information is protected.

Ethical Considerations

Ethical considerations for the AI assistant prioritize user privacy and data protection, ensuring only essential data is stored with secure encryption and allowing users to control and delete their data. Transparency is maintained by clearly stating that AI-based emotion detection and stress prediction are not medical diagnoses, encouraging users to seek professional help when needed. Bias and fairness are addressed through regular model reviews and the use of open-source models with diverse training data to improve accuracy across demographics. The AI promotes user autonomy by avoiding coercive or manipulative suggestions, offering mental health support as a tool, not a substitute for professional care.

Features

  • Emotion Detection from face scans
  • Text Sentiment Analysis using NLP
  • Event Logging & Predictive Stress Analysis

Local Setup Guide

Follow these steps to run the app locally.

Prerequisites

Python 3.10+
Node.js 18+
MySQL Server
Git Installed

1. Install Required Packages

in terminal run:

pip install -r requirements.txt

1.1 Clone the Repository

git clone https://github.com/yourusername/mental-health-ai.git
cd mental-health-ai

2. Install Backend

Navigate to backend folder

cd backend

Install Dependencies

pip install -r requirements.txt

Run FastAPI Server and Node.js

uvicorn main:app --reload

in a separate terminal but same directory run:

node server.js

The app should be running on: http://127.0.0.1:8000

3. Install Fronted

Navigate to frontend folder

cd ../frontend

Install Dependencies

npm install

Start React App

npm start

The app should be running on: http://localhost:3000

Share this project:

Updates