Skip to content

Repository files navigation

MindCare AI

🧠 MindCare AI

A Smart Mental Health Counselling System Using Multimodal AI

React Vite FastAPI Python TailwindCSS TensorFlow SQLite License Deployed on Vercel Backend on Hugging Face


MindCare AI is a full-stack intelligent mental health counselling platform that leverages four distinct AI modalities β€” behavioural data, facial emotion recognition, voice emotion detection, and NLP-driven chat analysis β€” to deliver a holistic, real-time mental wellness assessment and a personalized therapeutic experience.



πŸŽ₯ Project Working Demo

Video_Project1.mp4
β–Ά MINDCARE-AI - Complete Project Walkthrough (Click Play to watch)

πŸ“‹ Table of Contents


🌟 Project Overview

Mental health disorders are a global crisis, yet timely and accurate assessment remains a major challenge. Traditional methods rely on subjective self-reporting, which is insufficient for detecting the true severity of a user's mental state.

MindCare AI solves this by combining four independent AI modalities into a single, unified platform. Rather than relying on one signal, the system fuses insights from:

  1. πŸ“Š Behavioural Data β€” Lifestyle and physiological metrics (sleep, BMI, stress, heart rate, BP)
  2. 😐 Facial Emotion β€” Deep learning-based facial expression analysis from a live video feed
  3. πŸŽ™οΈ Voice Emotion β€” Acoustic feature analysis from audio recordings to detect emotional tone
  4. πŸ’¬ Chat Text (NLP) β€” Conversational AI that extracts mental health indicators from natural language

The results are fused into a Final Severity Score (0–100) and a Risk Level (Low / Moderate / High / Critical), powering a personalized wellness dashboard with an AI therapist chatbot, daily tasks, mindfulness exercises, and curated video recommendations.


🌐 Live Demo

The project is fully deployed and accessible online. You can test the multimodal AI features without installing anything locally.

(Note: The backend is hosted on a free Hugging Face Space and may take 1-2 minutes to wake up from sleep upon initial load. The OTP email service is currently in DEMO mode; OTPs are generated and can be viewed in the backend logs or network response).


✨ Key Features

πŸ§ͺ Multimodal Assessment Pipeline

Step Module Technology Output
1 Behavioural Test Scikit-learn (Gradient Boosting) Risk category + Severity score
2 Chat Counselling OpenRouter Sentiment, triggers, intensity score
3 Facial Emotion Detection ResNet (.keras) + OpenCV Dominant emotion + Confidence
4 Voice Emotion Detection CNN (.h5/.json) + Librosa Voice emotion + Stress level
5 Final Severity Report Weighted fusion of all 4 modalities Risk Level (Low β†’ Critical)

🩺 Personalised Wellness Dashboard

  • Real-Time Severity Gauge β€” Animated circular progress bar showing the fused mental health score
  • Risk Level Indicator β€” Color-coded badge (🟒 Low / 🟑 Moderate / 🟠 High / πŸ”΄ Critical)
  • Historical Trends β€” Area chart showing severity score evolution over time
  • Modality Score Breakdown β€” Individual scores for each of the four AI channels
  • Dr. MindCare Chatbot β€” An empathetic AI therapist powered by OpenRouter
  • Daily Wellness Tasks β€” Personalized, severity-adaptive task checklist
  • Mindfulness Breathing Exercises β€” Interactive guided breathing animations
  • YouTube Video Recommendations β€” Curated mental health content based on risk profile
  • User Profile Management β€” Edit demographic info with occupation/gender dropdowns

πŸ” Authentication & Access Control

  • JWT-based authentication with secure token storage
  • Google OAuth 2.0 single sign-on integration
  • 3-Step Password Reset via OTP sent to registered email (SMTP)
  • Route guards β€” All assessment and dashboard routes are protected

🎨 Premium UI / UX

  • Dark Glassmorphism design system throughout
  • Framer Motion cinematic page transitions and micro-animations
  • Three.js/React Three Fiber WebGL background on the landing page
  • GSAP animations for scroll-driven reveals
  • Custom animated cursor across the entire application
  • Responsive layouts for desktop and large screens

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        FRONTEND  (React + Vite)                     β”‚
β”‚                                                                     β”‚
β”‚  Landing β†’ Login/Register β†’ Assessment Pipeline β†’ Dashboard         β”‚
β”‚      β”‚           β”‚               β”‚                    β”‚             β”‚
β”‚  React.js    Google OAuth    4 Modality Pages    Recharts / FM      β”‚
β”‚  WebGL BG    JWT Tokens      (Behaviour, Chat,   Dr. MindCare Bot   β”‚
β”‚                               Face, Voice)       Daily Tasks        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚  HTTP / REST (Axios)
                            β”‚  Port 5173 β†’ 8000
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        BACKEND  (FastAPI + Python)                  β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  /auth   β”‚  β”‚/behaviourβ”‚  β”‚  /chat   β”‚  β”‚/face  β”‚  β”‚ /voice  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚/severity β”‚  β”‚              /dashboard                          β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚                    ML / AI Services Layer                       β”‚β”‚
β”‚  β”‚  ml_loader.py β”‚ ai_service.py β”‚ nlp_service.py β”‚ email_service  β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
           β–Ό                β–Ό                 β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  SQLite DB  β”‚  β”‚ Pre-trainedβ”‚  β”‚  OpenRouter API  β”‚
    β”‚ mindcare.db β”‚  β”‚   Models   β”‚  β”‚  (Gemini LLM)    β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow β€” Assessment Pipeline

User Registers/Logs In
        β”‚
        β–Ό
[Step 1] Behaviour Test  ──► ML Model (Random Forest) ──► Behaviour Severity Score
        β”‚
        β–Ό
[Step 2] Chat Counselling ──► LLM + NLP Analysis ──────► Chat Severity Score
        β”‚
        β–Ό
[Step 3] Facial Emotion  ──► ResNet Deep Learning ─────► Face Severity Score
        β”‚
        β–Ό
[Step 4] Voice Analysis  ──► CNN + Librosa ─────────────► Voice Severity Score
        β”‚
        β–Ό
[Step 5] Final Severity  ──► Weighted Fusion Algorithm ─► Risk Level + Dashboard

πŸ€– AI & Machine Learning Models

Step 1 β€” Behavioural Analysis (Best_Mental_Behaviour_Model.pkl)

  • Type: Scikit-learn ensemble classifier (Gradient Boosting)
  • Input Features: BMI category, sleep hours, sleep quality, physical activity level, stress level, heart rate, daily steps, systolic BP, diastolic BP
  • Output: Risk category (Low / Moderate / High) + confidence score + severity integer (0–100)
  • Encoders: Model_Encoders.pkl β€” handles label encoding and one-hot encoding for categorical inputs

Step 3 β€” Facial Emotion Detection (Resnet_model_version_2.keras)

  • Type: Fine-tuned ResNet Convolutional Neural Network (~303 MB)
  • Input: Video frames captured via the user's webcam, preprocessed with OpenCV
  • Output: Dominant facial emotion (e.g., Sad, Angry, Neutral, Happy, Fear, Disgust, Surprise) with per-class confidence scores
  • Severity Mapping: Emotions are mapped to a severity integer; negative valence emotions score higher

Step 4 β€” Voice Emotion Detection (CNN_model.json + CNN_model.weights.h5)

  • Type: Custom 1D/2D CNN trained on acoustic features
  • Feature Extraction: Librosa extracts MFCCs, chroma, spectral contrast, and mel-spectrogram features
  • Preprocessing: scaler2.pickle (StandardScaler) + encoder2.pickle (LabelEncoder)
  • Output: Voice emotion label + voice stress (Normal / Stressed / Highly Stressed) + voice mood + severity score

Step 2 β€” Chat NLP Analysis (nlp_service.py)

  • Sentiment Analysis: VADER (vaderSentiment) for rapid valence scoring + TextBlob for subjectivity
  • LLM Integration: OpenRouter API (Gemini model) for structured mental health Q&A
  • Extracted Signals: Problem description, duration, triggers, emotions, physical symptoms, coping strategy, support availability, daily life impact, intensity score
  • Risk Flagging: Automatic High/Critical flag for detected crisis indicators

Final Severity Fusion (severity.py)

  • Combines all four modality scores using a weighted average algorithm
  • Calculates overall risk level: Low (0–30) / Moderate (31–55) / High (56–79) / Critical (80–100)
  • Generates a natural language summary note for the dashboard

πŸ› οΈ Tech Stack

Frontend

Technology Version Purpose
React 19.x Core UI framework
Vite 7.x Build tool & dev server
Tailwind CSS 4.x Utility-first styling
Framer Motion 12.x Page transitions & animations
React Router DOM 7.x Client-side routing
Recharts 3.x Dashboard data visualization
Three.js / R3F 0.183 / 9.x WebGL 3D landing page background
GSAP 3.x Scroll-triggered animations
Lucide React 0.575 Icon library
React Hot Toast 2.x Notification system
Axios 1.x HTTP client
@react-oauth/google 0.13 Google OAuth 2.0
react-circular-progressbar 2.x Severity gauge widget
@vladmandic/face-api 1.7 Client-side face detection helper

Backend

Technology Version Purpose
FastAPI 0.115 REST API framework
Uvicorn 0.32 ASGI server
SQLAlchemy 2.0 ORM & database abstraction
SQLite β€” Lightweight local database
TensorFlow / Keras β‰₯2.15 Deep learning inference (Face & Voice)
Scikit-learn 1.6 ML model inference (Behaviour)
Librosa 0.10 Audio feature extraction
OpenCV Headless 4.10 Video frame processing
VADER Sentiment 3.3 NLP sentiment analysis
TextBlob 0.18 NLP subjectivity analysis
Passlib + Bcrypt 1.7 / 4.2 Password hashing
python-jose 3.3 JWT token generation & validation
python-dotenv 1.0 Environment variable management
ReportLab 4.2 PDF generation
Soundfile + Noisereduce 0.12 / 3.0 Audio preprocessing
httpx 0.27 Async HTTP client (OpenRouter API)

Deployment & Infrastructure

Technology Purpose
Vercel Frontend hosting & CI/CD pipeline
Hugging Face Spaces Backend hosting (Dockerized FastAPI)
Docker Containerization for ML backend environment
Git & GitHub Version control and source code management

πŸ“ Project Structure

MindCare-AI/
β”‚
β”œβ”€β”€ backend/                        # FastAPI Python Backend
β”‚   β”œβ”€β”€ main.py                     # App entry point, CORS, lifespan
β”‚   β”œβ”€β”€ database.py                 # SQLAlchemy engine & session
β”‚   β”œβ”€β”€ models.py                   # All ORM table definitions
β”‚   β”œβ”€β”€ ml_loader.py                # Model loading at startup
β”‚   β”œβ”€β”€ ai_service.py               # OpenRouter/Gemini LLM service
β”‚   β”œβ”€β”€ nlp_service.py              # NLP analysis (VADER + TextBlob)
β”‚   β”œβ”€β”€ jwt_handler.py              # JWT encode/decode utilities
β”‚   β”œβ”€β”€ email_service.py            # SMTP OTP email sender
β”‚   β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚   β”œβ”€β”€ mindcare.db                 # SQLite database file
β”‚   β”œβ”€β”€ routers/
β”‚   β”‚   β”œβ”€β”€ auth.py                 # Register, login, Google OAuth, OTP reset
β”‚   β”‚   β”œβ”€β”€ behaviour.py            # Behaviour test submission & history
β”‚   β”‚   β”œβ”€β”€ chat.py                 # Chat counselling & NLP analysis
β”‚   β”‚   β”œβ”€β”€ face.py                 # Facial emotion video upload & inference
β”‚   β”‚   β”œβ”€β”€ voice.py                # Voice audio upload & inference
β”‚   β”‚   β”œβ”€β”€ severity.py             # Final severity fusion & report
β”‚   β”‚   └── dashboard.py            # Dashboard data, tasks, Dr. MindCare chat
β”‚   β”œβ”€β”€ Pre-trained_Models/         # ← Place downloaded models here
β”‚   β”‚   β”œβ”€β”€ Step1_Behaviour/
β”‚   β”‚   β”‚   β”œβ”€β”€ Best_Mental_Behaviour_Model.pkl
β”‚   β”‚   β”‚   └── Model_Encoders.pkl
β”‚   β”‚   β”œβ”€β”€ Step3_Face/
β”‚   β”‚   β”‚   └── Resnet_model_version_2.keras
β”‚   β”‚   └── Step4_Voice/
β”‚   β”‚       β”œβ”€β”€ CNN_model.json
β”‚   β”‚       β”œβ”€β”€ CNN_model.weights.h5
β”‚   β”‚       β”œβ”€β”€ encoder2.pickle
β”‚   β”‚       └── scaler2.pickle
β”‚   └── uploads/                    # Uploaded audio/video files
β”‚
β”œβ”€β”€ frontend/                       # React + Vite Frontend
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ vite.config.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── src/
β”‚       β”œβ”€β”€ App.jsx                 # Root router with protected routes
β”‚       β”œβ”€β”€ main.jsx                # React DOM entry point
β”‚       β”œβ”€β”€ index.css               # Global styles & design tokens
β”‚       β”œβ”€β”€ api.js                  # Axios base URL configuration
β”‚       β”œβ”€β”€ contexts/
β”‚       β”‚   └── AuthContext.jsx     # JWT auth state management
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ Particles.jsx       # Animated particle backdrop
β”‚       β”‚   β”œβ”€β”€ CustomCursor.jsx    # Custom cursor effect
β”‚       β”‚   └── CinematicTransition.jsx  # Page transition wrapper
β”‚       β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚       β”œβ”€β”€ services/               # API service functions
β”‚       └── pages/
β”‚           β”œβ”€β”€ Landing.jsx         # Hero page (Three.js WebGL)
β”‚           β”œβ”€β”€ Login.jsx           # JWT + Google OAuth login
β”‚           β”œβ”€β”€ Register.jsx        # Multi-step registration
β”‚           β”œβ”€β”€ ForgotPassword.jsx  # 3-step OTP password reset
β”‚           β”œβ”€β”€ BehaviourTest.jsx   # Step 1: Lifestyle questionnaire
β”‚           β”œβ”€β”€ ChatCounselling.jsx # Step 2: AI chat assessment
β”‚           β”œβ”€β”€ FaceEmotion.jsx     # Step 3: Webcam facial analysis
β”‚           β”œβ”€β”€ VoiceAnalysis.jsx   # Step 4: Microphone voice analysis
β”‚           β”œβ”€β”€ FinalSeverity.jsx   # Fusion report & severity score
β”‚           └── Dashboard.jsx       # Main wellness dashboard
β”‚
β”œβ”€β”€ model_training/                 # ← Place downloaded training resources here
β”‚   β”œβ”€β”€ (Jupyter notebooks for each modality)
β”‚   └── (Training datasets)
β”‚
β”œβ”€β”€ run_backend.bat                 # One-click backend launcher (Windows)
β”œβ”€β”€ run_frontend.bat                # One-click frontend launcher (Windows)
β”œβ”€β”€ .gitignore
└── README.md

βš™οΈ Project Setup & Machine Learning Resources

Due to GitHub's file size limits, the large pre-trained multimodal models and the training datasets/scripts are hosted externally on Google Drive. To fully run or explore this project, please download the resource file below:

πŸ“₯ Download MindCare Resources (Models & Training Data)

How to Setup the Downloaded Resources:

Once you download and extract MindCare_Resources.zip, you will find two folders inside. Please place them as instructed below:

  1. Pre-trained_Models/: Move this entire folder directly inside the backend/ directory of this project. (These are the .keras, .h5, and .pkl files required for the FastAPI backend to run).
  2. model_training/: Move this folder to the root directory of the project. (This contains the Jupyter notebooks, scripts, and datasets used to train the multimodal AI models).

πŸš€ Running the Application

Prerequisites

  • Python 3.10 or higher
  • Node.js 18 or higher (with npm)
  • Git
  • A webcam and microphone (required for Face & Voice analysis modules)

1. Clone the Repository

git clone https://github.com/Hashmil-Muhammed/Smart-Mental-Health-Counselling-System-Using-Multimodal-AI.git
cd Smart-Mental-Health-Counselling-System-Using-Multimodal-AI

2. Download & Place ML Resources

Follow the instructions above to download and correctly place the Pre-trained_Models/ folder inside backend/.

3. Backend Setup

cd backend

# Create and activate a virtual environment
python -m venv venv

# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate

# Install all Python dependencies
pip install -r requirements.txt

Configure Backend Environment Variables:

Create a .env file inside the backend/ directory:

SECRET_KEY=your_super_secret_jwt_key_here
DATABASE_URL=sqlite:///./mindcare.db
OPENROUTER_API_KEY=your_openrouter_api_key_here
SMTP_EMAIL=your_gmail_address@gmail.com
SMTP_PASSWORD=your_gmail_app_password
GOOGLE_CLIENT_ID=your_google_oauth_client_id

Start the Backend Server:

uvicorn main:app --host 0.0.0.0 --port 8000 --reload

The API will be live at http://localhost:8000 Interactive API docs available at http://localhost:8000/docs

4. Frontend Setup

cd frontend

# Install Node.js dependencies
npm install

Configure Frontend Environment Variables:

Create a .env file inside the frontend/ directory:

VITE_API_BASE_URL=http://localhost:8000
VITE_GOOGLE_CLIENT_ID=your_google_oauth_client_id

Start the Frontend Dev Server:

npm run dev

The application will be available at http://localhost:5173

5. Quick Launch (Windows)

For convenience, use the provided batch scripts from the project root:

# Terminal 1 β€” Start Backend
run_backend.bat

# Terminal 2 β€” Start Frontend
run_frontend.bat

πŸ”Œ API Reference

The FastAPI backend automatically generates interactive documentation. Once the server is running, visit:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Core Endpoint Summary

Method Endpoint Description Auth
POST /auth/register Register a new user account ❌
POST /auth/login Login with email/password β†’ JWT ❌
POST /auth/google Login with Google OAuth ❌
POST /auth/forgot-password Request OTP for password reset ❌
POST /auth/verify-otp Verify OTP code ❌
POST /auth/reset-password Set new password ❌
POST /behaviour/submit Submit behavioural assessment βœ…
GET /behaviour/history Get past behaviour results βœ…
POST /chat/send Send message to AI counsellor βœ…
GET /chat/history Retrieve chat message history βœ…
POST /face/analyze Upload video β†’ facial emotion βœ…
POST /voice/analyze Upload audio β†’ voice emotion βœ…
GET /severity/final Get fused final severity report βœ…
GET /dashboard/summary Full dashboard data payload βœ…
GET /dashboard/tasks Get daily wellness tasks βœ…
POST /dashboard/tasks/complete Mark a task as completed βœ…
POST /dashboard/doctor-chat Chat with Dr. MindCare bot βœ…
GET /health Backend & model health check ❌

βœ… = Requires Authorization: Bearer <token> header


πŸ—ƒοΈ Database Schema

The SQLite database (mindcare.db) is managed by SQLAlchemy and contains the following tables:

Table Description
register_database User profiles (name, age, gender, occupation, email, Google ID)
behaviour_results Behavioural test submissions with ML predictions
chat_messages Raw chat counselling message history
chat_analysis Structured NLP analysis results from counselling sessions
face_results Facial emotion detection results with emotion distribution
voice_results Voice emotion results with stress and mood labels
final_severity_results Fused severity scores and risk level per session
emergency_events High-severity / crisis trigger event log
suggestions Personalized recommendations stored per severity level
daily_tasks Daily wellness task list with completion tracking
doctor_chat_messages Dr. MindCare AI therapist conversation history
password_reset_otps Time-limited OTP records for password reset flow

πŸ–₯️ Application Screens

Screen Route Description
Landing Page / Hero page with Three.js WebGL background, GSAP scroll animations, and feature showcase
Login /login JWT + Google OAuth sign-in with glassmorphic card
Register /register Multi-step registration with profile details
Forgot Password /forgot-password 3-step OTP-based password reset via email
Behaviour Test /behaviour Lifestyle questionnaire form β†’ ML prediction
Chat Counselling /chat NLP-powered AI chat assessment session
Facial Emotion /face Live webcam capture β†’ ResNet emotion analysis
Voice Analysis /voice Microphone recording β†’ CNN emotion analysis
Final Severity /severity Fused multimodal report with risk level
Dashboard /dashboard Main wellness hub with charts, tasks, Dr. MindCare, and video recommendations

Here is a glimpse of the MindCare AI platform in action:

Landing Page
Landing Page
Register Account Login
Register Login
Behaviour Test Input Behaviour Test Result
Behaviour Input Behaviour Result
AI Chat Counselling Chat Summary
Chat Counselling Chat Summary
Face Emotion (Recording) Face Emotion (Result)
Face Recording Face Result
Voice Stress (Recording) Voice Stress (Result)
Voice Recording Voice Result
Final Assessment Report Main Dashboard
Final Report Main Dashboard

πŸ”’ Security & Authentication

  • Password Hashing: Bcrypt via passlib β€” passwords are never stored in plaintext
  • JWT Tokens: Signed with python-jose, validated on every protected route
  • Google OAuth 2.0: Token verified server-side using Google's public key infrastructure
  • OTP Expiry: Password reset OTPs are time-limited and invalidated after use
  • CORS: Configured to allow only specified frontend origins
  • Environment Variables: All secrets (API keys, SMTP credentials, JWT secret) are stored in .env files β€” never committed to version control

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'feat: add some feature'
  4. Push to the branch: git push origin feature/your-feature-name
  5. Open a Pull Request

Please ensure your code follows the existing project structure and styling conventions.


Built with ❀️ for better mental wellness

MindCare AI β€” Because your mind matters.

Releases

Packages

Contributors

Languages