Skip to content

mahi0097/Mental_Health_Chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 MindFul β€” AI Mental Health Chatbot

An empathetic AI-powered chatbot for supportive conversation, mental wellness guidance, and emotional well-being.

Status Node.js Express License PRs Welcome

Live Demo Β· Report Bug Β· Request Feature


πŸ“Έ Screenshots

(Coming soon β€” UI in active development)

Chat Interface Wellness Dashboard Mood Tracker
Chat Dashboard Mood

πŸ“– About The Project

MindFul is an AI-powered mental health chatbot designed to provide a safe, judgment-free space for users to express their feelings, receive supportive responses, and access wellness resources.

Unlike generic chatbots, MindFul is built with mental health context in mind β€” detecting emotional intent, responding empathetically, and escalating to professional resources when needed.

⚠️ Disclaimer: This chatbot is not a replacement for professional mental health care. If you are in crisis, please reach out to a licensed mental health professional or a crisis helpline.


✨ Features

Feature Status
πŸ’¬ AI-based empathetic conversation βœ… Done
🎯 Intent detection & response generation βœ… Done
πŸ—‚οΈ RESTful API backend (Node.js + Express) βœ… Done
🧘 Mental wellness support responses πŸ”„ In Progress
πŸ“Š Mood tracking over time πŸ”œ Planned
πŸ” User authentication (JWT) πŸ”œ Planned
🎀 Voice chatbot integration πŸ”œ Planned
πŸ“ˆ Wellness insights dashboard πŸ”œ Planned
πŸ€– RAG-based knowledge retrieval πŸ”œ Planned

πŸ› οΈ Tech Stack

Backend

Technology Purpose
Node.js Runtime environment
Express.js REST API framework
MongoDB Database (planned)
Mongoose ODM for MongoDB
JWT Authentication (planned)
dotenv Environment config

AI / ML

Technology Purpose
RAG Pipeline Context-aware responses (planned)
Intent Detection Classifying user emotions/needs
NLP Model Natural language understanding

Frontend (Planned)

Technology Purpose
React.js UI framework
Tailwind CSS Styling
Socket.io Real-time chat

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CLIENT                           β”‚
β”‚              React Frontend / REST Client               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ HTTP / WebSocket
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    API GATEWAY                          β”‚
β”‚              Express.js (Node.js)                       β”‚
β”‚         Auth Middleware β”‚ Rate Limiting                  β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   MongoDB   β”‚  β”‚           AI Service Layer          β”‚
β”‚  (Users,    β”‚  β”‚  Intent Detection β†’ RAG Pipeline    β”‚
β”‚   Sessions, β”‚  β”‚  β†’ Response Generation              β”‚
β”‚   Moods)    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Folder Structure

mental-health-chatbot/
β”‚
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   └── db.js                  # MongoDB connection
β”‚   β”‚
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ chatController.js      # Chat logic
β”‚   β”‚   β”œβ”€β”€ userController.js      # User management
β”‚   β”‚   └── moodController.js      # Mood tracking
β”‚   β”‚
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”œβ”€β”€ authMiddleware.js      # JWT verification
β”‚   β”‚   └── errorHandler.js        # Global error handling
β”‚   β”‚
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ User.js                # User schema
β”‚   β”‚   β”œβ”€β”€ Session.js             # Chat session schema
β”‚   β”‚   └── Mood.js                # Mood entry schema
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ chatRoutes.js          # /api/chat
β”‚   β”‚   β”œβ”€β”€ userRoutes.js          # /api/user
β”‚   β”‚   └── moodRoutes.js          # /api/mood
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ aiService.js           # AI model integration
β”‚   β”‚   └── intentService.js       # Intent classification
β”‚   β”‚
β”‚   β”œβ”€β”€ .env.example               # Environment variable template
β”‚   β”œβ”€β”€ server.js                  # App entry point
β”‚   └── package.json
β”‚
β”œβ”€β”€ Frontend/                      # (Planned)
β”‚   └── ...
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
└── README.md

βš™οΈ Installation & Setup

Prerequisites

1. Clone the repository

git clone https://github.com/your-username/mental-health-chatbot.git
cd mental-health-chatbot

2. Install dependencies

cd Backend
npm install

3. Configure environment variables

cp .env.example .env

Open .env and fill in your values:

# Server
PORT=5000
NODE_ENV=development

# Database
MONGO_URI=mongodb://localhost:27017/mindful

# Authentication
JWT_SECRET=your_super_secret_key_here
JWT_EXPIRES_IN=7d

# AI Service
AI_API_KEY=your_ai_api_key_here
AI_MODEL=your_model_name

4. Start the server

# Development (with auto-reload)
npm run dev

# Production
npm start

Server runs at http://localhost:5000


πŸ”Œ API Routes

Chat

Method Endpoint Description Auth
POST /api/chat/message Send a message, get AI response βœ…
GET /api/chat/history/:sessionId Get chat history βœ…
DELETE /api/chat/session/:sessionId Delete a session βœ…

User

Method Endpoint Description Auth
POST /api/user/register Register a new user ❌
POST /api/user/login Login and get JWT ❌
GET /api/user/profile Get user profile βœ…

Mood Tracker (Planned)

Method Endpoint Description Auth
POST /api/mood/log Log a mood entry βœ…
GET /api/mood/history Get mood history βœ…

Example Request:

POST /api/chat/message
Content-Type: application/json
Authorization: Bearer <your_token>

{
  "message": "I've been feeling anxious lately",
  "sessionId": "abc123"
}

Example Response:

{
  "success": true,
  "reply": "I'm sorry to hear that. Anxiety can feel overwhelming. Would you like to talk about what's been on your mind?",
  "intent": "anxiety_support",
  "resources": []
}

πŸ—ΊοΈ Future Roadmap

  • v1.0 β€” Core chat with intent detection + MongoDB integration
  • v1.1 β€” User authentication (register/login with JWT)
  • v1.2 β€” React frontend with real-time chat (Socket.io)
  • v1.3 β€” Mood tracker with daily check-ins
  • v2.0 β€” RAG-based AI for accurate, knowledge-grounded responses
  • v2.1 β€” Voice chatbot integration
  • v2.2 β€” Wellness insights dashboard with charts
  • v3.0 β€” Mobile app (React Native)

🀝 Contributing

Contributions are what make the open-source community great. Any contributions you make are greatly appreciated.

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

Please read CONTRIBUTING.md for our code of conduct and contribution guidelines.


πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.


πŸ‘€ Author

Your Name


πŸ™ Acknowledgements


Built with ❀️ to make mental wellness more accessible.

About

this is my first repository

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors