PeaceMindAI

PeaceMindAI is an AI-powered mental health support platform designed to offer accessible, personalized, and stigma-free emotional care. Built around an advanced Large Language Model (LLM) chatbot, the system helps individuals manage stress, anxiety, depression, and PTSD through meaningful conversations, cognitive behavioral therapy techniques, mindfulness practices, and supportive counseling.

Table of Contents

Key Features

Technologies Used

Purpose

The platform aims to address the growing need for accessible mental health support by providing:

Setup and Installation

Prerequisites

Installation Steps

  1. Clone the repository:
git clone https://github.com/yourusername/PeaceMindAI.git
cd PeaceMindAI
  1. Create and activate a virtual environment:
python -m venv venv
# On Windows
venv\Scripts\activate
# On Unix or MacOS
source venv/bin/activate
  1. Install required packages:
pip install -r requirements.txt
  1. Install frontend dependencies:
cd peacemindai/theme/static_src
npm install
npm run build
  1. Initialize the database:
python manage.py migrate
  1. Run the development server:
python manage.py runserver

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

Running with WebSocket Support

For WebSocket support (required for chat functionality), use Daphne:

daphne -b 127.0.0.1 -p 8000 peacemindai.asgi:application

Environment Variables

Create a .env file in the project root with the following variables:

# Required
API_KEY=your_groq_api_key
SECRET_KEY=your_django_secret_key
DEBUG=True  # Set to False in production

# Optional
DATABASE_URL=sqlite:///db.sqlite3  # Default SQLite database
ALLOWED_HOSTS=localhost,127.0.0.1
CSRF_TRUSTED_ORIGINS=http://localhost:8000

Development Commands

  1. Initialize the database:
python manage.py makemigrations
python manage.py migrate
  1. Create a superuser (admin):
python manage.py createsuperuser
  1. Run the development server:
python manage.py runserver
  1. Run with WebSocket support (required for chat):
daphne -b 127.0.0.1 -p 8000 peacemindai.asgi:application
  1. Run tests:
python manage.py test

The application will be available at:

Project Structure

The project is organized as follows:

PeaceMindAI/
├── README.md               # Project documentation
├── requirements.txt        # Python dependencies
├── peacemindai/            # Main project folder
│   ├── db.sqlite3          # SQLite database (default)
│   ├── manage.py           # Django management script
│   ├── chat/               # Chat application
│   │   ├── consumers.py    # WebSocket consumers
│   │   ├── models.py       # Chat data models
│   │   ├── routing.py      # WebSocket routing
│   │   ├── utils.py        # Utility functions
│   │   ├── views.py        # Chat views
│   │   ├── data_source/    # Data sources for AI
│   │   │   ├── Huggingface-mental-health-data.json
│   │   │   ├── Intents.json
│   │   │   └── mental_health_Document.pdf
│   │   ├── templates/      # Chat-specific templates
│   │   └── chroma_db/      # Vector database for AI
│   ├── main_app/           # Core application
│   │   ├── models.py       # Core data models
│   │   ├── views.py        # Main views
│   │   ├── templates/      # Core templates
│   │   └── migrations/     # Database migrations
│   ├── users/              # User management
│   │   ├── forms.py        # User forms
│   │   ├── models.py       # User models
│   │   ├── templates/      # User-specific templates
│   │   └── migrations/     # Database migrations
│   ├── templates/          # Global templates
│   ├── static/             # Static files
│   │   └── images/         # Image assets
│   ├── theme/              # TailwindCSS theme
│   │   ├── static_src/     # Source files for TailwindCSS
│   │   └── templates/      # Theme templates
│   ├── settings.py         # Django settings
│   ├── urls.py             # URL configuration
│   ├── asgi.py             # ASGI configuration
│   └── wsgi.py             # WSGI configuration

Workflow Diagram

The following diagram illustrates the workflow of the PeaceMindAI system:

These visuals provide a clearer understanding of the project structure and workflow. For more details, refer to the respective sections in this documentation.

AI and Chat System

Chat Architecture

The chat system uses a real-time WebSocket connection to enable instant communication between users and the AI. Key components include:

Training Data

The system is trained on carefully curated mental health datasets:

AI Capabilities

Data Privacy and Security

User Interface and Features

Home Page

The landing page showcases key features and benefits:

Authentication

Chat Interface

Therapeutic Features

  1. Guided Sessions:

    • Structured therapeutic conversations
    • Progress tracking and mood monitoring
    • Customized exercise recommendations
    • Mindfulness and relaxation techniques
  2. Resource Library:

    • Self-help articles and guides
    • Mindfulness exercises
    • Coping strategies
    • Crisis management resources
  3. Progress Tracking:

    • Mood tracking functionality
    • Session history review
    • Progress visualization
    • Goal setting and achievement tracking

Design Principles

Development Guidelines

Code Style

Best Practices

Testing

To run the test suite:

python manage.py test

For coverage report:

coverage run manage.py test
coverage report

Contributing

We welcome contributions to PeaceMindAI! Here’s how you can help:

  1. Fork the repository
  2. Create a 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

Areas for Contribution

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Screenshots

Home Page

alt text alt text alt text alt text

Registeration Page

alt text alt text

Login Page

alt text

Profile Update

alt text

About Page

alt text alt text

Chat Section

alt text alt text

Feedback Section

alt text alt text

Support

For support, please:

Disclaimer

PeaceMindAI is not a substitute for professional mental health treatment. If you’re experiencing a mental health crisis, please contact emergency services or a mental health professional immediately.