Eunoia is an AI-powered mental health web application that offers personalized emotional support, mental well-being tools, and religious therapy. Designed with inclusivity and accessibility in mind, Eunoia provides users with a holistic mental health journey through advanced AI-driven features, gamification, and scalable spiritual guidance.
- Mental Health Tracking: Includes daily journaling, AI-driven sentiment analysis, and mood tracking.
- Personalized Emotional Support: Tailored recommendations and chatbot interactions powered by advanced sentiment analysis.
- AI-Powered Chatbot Assistance: Real-time support to help users manage emotions and stress.
- Personalized Religious Support: Quranic ayaat and religious text recommendations based on emotional states.
- Scalable Spiritual Guidance: Planned expansion to include spiritual texts like the Bible, Torah, and Gita.
- Community Engagement: Peer support forums for anonymous sharing and emotional support.
- Crisis Management: Emergency contact features, crisis hotline information, and automated alerts.
- Interactive Tools: Stress-relief games, habit-building trackers, and progress visualization.
- Gamified Motivation: Achieve mental health goals through rewards and milestones.
- Multi-Language Support: Fully localized for diverse communities.
- Offline Functionality: Key features like journaling available offline.
- Access to Professionals: Connect with certified therapists for online video sessions.
- Advanced Sentiment Analysis: Utilizing the Gemini API and Hugging Face Transformers for NLP.
- Self-Assessment Tools: Insightful self-assessment quizzes (non-diagnostic).
- Framework: React.js
- Framework: Flask
- Database Management System: PostgreSQL
- Sentiment Analysis: Gemini API
- Natural Language Processing: Hugging Face Transformers
Follow these steps to set up and run the application locally:
git clone https://github.com/eunoia-mazz/eunoia-app.git
cd eunoia-app
Navigate to the backend
directory and install dependencies:
cd backend
pip install -r requirements.txt
Start the Flask backend server:
python app.py
Navigate to the frontend
directory and install dependencies:
cd frontend
npm install
Start the React development server:
npm run dev
For users preferring Docker for deployment, you can pull the pre-built Docker images and run them directly:
Pull Docker Images
You will be prompted to enter a passphrase upon pulling the Docker images. Please use the following passphrase:
Pull Docker Images
Frontend
docker pull eunoiamazz/eunoia-frontend:latest
Backend
docker pull eunoiamazz/eunoia-backend:latest
Run Docker Containers
Frontend
docker run -p 5173:5173 eunoiamazz/eunoia-frontend:latest
Backend
docker run -p 5000:5000 eunoiamazz/eunoia-backend:latest
This will start the frontend accessible at http://localhost:5173 and the backend at http://localhost:5000.
Once the backend and frontend are set up and running, you can access the app by navigating to http://localhost:5173
for the frontend and http://localhost:5000
for the backend.
Once both servers are running, you can access the application at:
- Frontend:
http://localhost:5173
- Backend:
http://localhost:5000
The Eunoia App includes a comprehensive test suite to ensure the reliability and functionality of the application. The tests cover various components including authentication, chat functionality, activity tracking, spiritual content, and more.
Tests are organized in the tests/unit/
directory with each module focusing on a specific area of functionality:
- test_auth.py: Tests user authentication (signup, login)
- test_chat.py: Tests chat creation and message generation
- test_activity.py: Tests activity and subactivity models
- test_coupon.py: Tests coupon allocation functionality
- test_spiritual.py: Tests spiritual content features
- test_profile.py: Tests user profile management
- test_journal.py: Tests journal entry functionality
- test_forum.py: Tests forum post and comment features
- test_mood.py: Tests mood tracking functionality
To run the entire test suite:
cd tests
python run_tests.py
To run a specific test file:
cd tests
python -m unittest unit.test_auth
Tests are automatically run on GitHub Actions when code is pushed to the main branch or when a pull request is created. The workflow configuration is defined in .github/workflows/python-tests.yml
.
The tests use SQLite in-memory databases to ensure tests are isolated and don't affect production data. Key areas covered include:
-
Authentication
- User registration
- User login with valid and invalid credentials.
-
Chat Functionality
- Creating new chats
- Generating AI responses (with mocked AI model)
- Retrieving chat history
-
Activities
- Activity model validation
- SubActivity model validation
- Relationship between activities and subactivities
-
Coupons
- Coupon allocation to users
- Validation of coupon limits
-
Spiritual Content
- Creating spiritual guidance chats
- Testing chat creation
-
User Profiles
- Profile retrieval through login
When adding new features, corresponding tests should be created following the existing patterns:
- Create a new test class that inherits from
unittest.TestCase
- Implement
setUp
andtearDown
methods - Add test methods that start with
test_
- Update
run_tests.py
to include your new test case
For tests that involve external services (like AI models), we use Python's unittest.mock
to create mock responses:
@patch('app.model.generate_content')
def test_some_ai_feature(self, mock_generate_content):
# Set up the mock
mock_response = MagicMock()
mock_response.text = "This is a mock response"
mock_generate_content.return_value = mock_response
# Test code that uses the AI model
This project is licensed under the MIT License - see the LICENSE file for details.
- Religious Texts Expansion: Include spiritual guidance based on the Bible, Torah, Gita, and other religious texts.
- Advanced AI Features: Enhance emotional support with more advanced AI-driven insights.
- Mobile App: Launch a native mobile application for both iOS and Android.
- Global Outreach: Further language localization and accessibility improvements.
- Religious Text Expansion: Incorporate additional spiritual texts, including the Bible, Torah, and Gita.
- Advanced AI Features: Develop more sophisticated AI-driven insights for emotional support.
- Mobile App: Launch native iOS and Android applications.
- Global Outreach: Expand localization to support additional languages and accessibility features.
This project is licensed under the MIT License.
For support or inquiries, please email: team.eunoia.ai@gmail.com.
Elevate your mental health journey with Eunoia, where technology, emotional support, and spirituality converge. π