A compassionate AI-powered Django application designed to provide mental health conversations and support through an intuitive web interface.
Mental Health Partner connects users with an empathetic AI assistant powered by DeepseekAI via OpenRouter, offering a safe space for emotional support and mental wellness discussions. The application focuses on providing accessible mental health support while encouraging professional help when needed.
- AI-Powered Conversations: Real-time supportive conversations with an empathetic mental health assistant
- User Management: Secure authentication and personalized user profiles
- Conversation History: Access to previous conversations and support sessions
- Feedback System: Collect user feedback to improve the quality of support
- Crisis Detection: Identification of potential crisis situations with appropriate resource recommendations
- Topic Organization: Conversations organized by relevant mental health topics
- Analytics Dashboard: Track usage patterns and effectiveness (admin only)
- Backend: Django 4.2+
- Database: PostgreSQL
- AI Integration: DeepseekAI via OpenRouter API
- Frontend: Bootstrap 5, JavaScript
- Deployment: Compatible with Render, Heroku, or similar platforms
-
Clone the repository
git clone https://github.com/gatiella/Mental_Health_Partner.git cd Mental_Health_Partner -
Create a virtual environment
python -m venv venv
-
Activate the virtual environment
- Windows:
venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
cp .env.example .env
Edit
.envto include your PostgreSQL credentials and DeepseekAI API key -
Set up the PostgreSQL database
- Create a database named in your
.envfile - Ensure the user has proper permissions
- Create a database named in your
-
Run migrations
python manage.py migrate
-
Create a superuser
python manage.py createsuperuser
-
Run the server
python manage.py runserver
-
Access the application at
http://localhost:8000
The project consists of three main apps:
-
conversation: Core conversation functionality and AI integration- Manages message exchanges between users and the AI assistant
- Handles the DeepseekAI API integration
- Implements content moderation and safety features
-
users: User management and profiles- Authentication and authorization
- User preferences and settings
- Profile management
-
analytics: Usage tracking and insights (optional)- Conversation metrics and statistics
- Effectiveness reporting
- Usage patterns and trends
The application requires the following environment variables:
-
Database configuration:
DB_NAME,DB_USER,DB_PASSWORD,DB_HOST,DB_PORT
-
Django settings:
SECRET_KEY,DEBUG,ALLOWED_HOSTS
-
DeepseekAI integration:
DEEPSEEK_API_KEY,DEEPSEEK_API_URL,SITE_URL
Contributions to improve Mental Health Partner are welcome. Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This application is not a substitute for professional mental health treatment or crisis intervention. If you or someone you know is experiencing a mental health emergency, please contact your local emergency services or a mental health crisis hotline immediately.
