Mental Health Chatbot Using Machine Learning and Flask | Source Code
LIMITED TIME
Get Source Code ₹99
Open Live Demo
Real project UI Full source included Opens in new tab

Tap to open live demo

Interactive live demo — verify the project before you buy

Mental Health Chatbot Using Machine Learning and Flask

Live Demo

Complete final-year project source code with frontend, backend, database, and setup guide. Instant download after secure payment.

  • MACHINE-LEARNING Stack
  • Instant Download
Secure CCAvenue payment Instant download link WhatsApp support

Choose your plan

Source Code Only

Full ZIP with frontend, backend, database & documentation.

₹99 one-time
  • Complete project source files
  • Database script included
  • How-to-run guide

What's in your download

Review features, setup steps, and credentials before you pay.

Project Overview

Description, tech stack, and what is included

Full source Frontend + backend
Database .sql file
Setup guide README included

MindCare is a mental health chatbot web application built with Python Flask and Machine Learning. It helps users with mental wellness support, mood tracking, self-assessments, chat history, and emotional analysis. The system uses NLP, TF-IDF, Logistic Regression, and rule-based response selection to generate chatbot replies from local training data. It also includes a powerful admin panel to manage users, chatbot training data, emotion labels, assessments, reports, and wellness content.

This Flask mental health project is designed for academic projects, final year projects, portfolio websites, and machine learning demos. OpenAI integration is optional and can be enabled in code for AI-generated responses.

Technical snapshot

Project
Mental Health Chatbot Using Machine Learning and Flask
Stack
MACHINE-LEARNING
Includes
Code, DB, README
License
Academic submission
Secure CCAvenue payment · Instant download · Need help? WhatsApp us

Ready to download?Pay once · Use for submission & viva

Admin Features

Modules and controls available to administrators

  • Separate admin login system
  • Admin dashboard with user, chat, mood, assessment, and feedback statistics
  • User management with search, edit, delete, activate, and deactivate options
  • Training data management for chatbot patterns, intents, emotions, and responses
  • Train and retrain ML models directly from admin panel
  • Emotion label management
  • Chat record monitoring with filters by user, date, and emotion
  • Mood record management
  • Assessment question management
  • Assessment result filtering
  • Suggestions and motivational quote management
  • Emergency help content management
  • Feedback management
  • CSV export and PDF report generation
  • Admin profile update and password change
  • Secure admin logout

User Features

What end users can do in this application

  • User registration with validation
  • User login using username or email
  • Forgot password with token-based reset flow
  • User profile management
  • Mental wellness chatbot with AJAX chat interface
  • Chat history with search and delete options
  • Daily mood tracker
  • Mood history
  • Self-assessment questionnaire
  • Assessment history
  • Feedback submission
  • Emergency help page
  • Secure logout

Other Features

Additional capabilities included in the project

  • Built with Python 3 and Flask 3
  • Uses Flask-SQLAlchemy for database operations
  • Supports SQLite by default, with optional MySQL/PostgreSQL
  • Implements Flask-Login authentication
  • Uses Werkzeug password hashing
  • Frontend created with HTML, CSS, JavaScript, and Bootstrap 5
  • Natural Language Processing with NLTK
  • Text preprocessing with stopword removal, tokenization, and stemming
  • TF-IDF vectorization with up to 5,000 features and 1–2 gram support
  • Logistic Regression classification for intent and emotion prediction
  • Pattern-first response matching
  • Keyword-based heuristic overrides for better chatbot accuracy
  • Joblib model saving and loading
  • Optional OpenAI API integration
  • PDF report export using ReportLab
  • Environment configuration with python-dotenv
  • Suitable for major project, mini project, capstone project, and portfolio showcase

How to Run

Step-by-step setup on your laptop or PC

Prerequisites

  • Python 3.10+
  • pip

Steps to run


 

cd "path/to/Mental HEalth Chatbot Using ML"
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt

Optional environment setup

Create a .env file in the project root:


 

SECRET_KEY=your-secret-key-for-production
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4o-mini

Seed database


 

python seed_database.py

Start project


 

python run.py

Open in browser


 

http://127.0.0.1:5000

Login Credentials

Default demo accounts for testing after setup

Admin Login

  • URL: http://127.0.0.1:5000/admin/login
  • Username: admin
  • Password: admin123

Demo User Login

  • URL: http://127.0.0.1:5000/login

Demo accounts:

  • alice / password123
  • bob / password123
  • carol / password123
  • david / password123
  • emma / password123
  • frank / password123
  • grace / password123
  • henry / password123

License

Usage terms for academic and personal projects

Related Tags

Search terms and categories for this source code

Mental Health Chatbot Using Machine Learning and Flask Source Code Final Year MACHINE-LEARNING Project Ready-to-Run Code With Database File Plagiarism-Free Faculty Approved mental health chatbot mental health chatbot using machine learning flask chatbot project python mental health project machine learning chatbot NLP chatbot using Flask scikit-learn chatbot