MindSpace is a full-stack web application designed to be a safe and anonymous space for users to monitor their mental well-being. It features mood tracking, guided self-assessments, an empathetic AI chatbot, and a dashboard to visualize progress over time.
- User Authentication: Secure registration and login system.
- Dashboard: A central hub to view mood timelines, recent entries, and assessment score history.
- Mood Tracking: Daily mood check-ins with optional notes.
- Self-Assessments:
- Anxiety Screening (GAD-7)
- Depression Screening (PHQ-9)
- Stress Assessment
- Historical Charts: Visualizes mood and assessment scores over time to track trends.
- AI Chatbot: An empathetic chatbot powered by OpenAI for supportive conversations, with guardrails to stay on topic.
- Wellness Activities: Guided activities like breathing exercises to help users relax.
- Resource Library: Curated links to external mental health resources.
-
Frontend:
- Next.js (React Framework)
- TypeScript
- Tailwind CSS
- shadcn/ui (Component Library)
- Chart.js & react-chartjs-2 (Data Visualization)
- Lucide React (Icons)
-
Backend:
- Python
- Flask (Web Framework)
- SQLAlchemy (ORM)
- OpenAI API (For the AI Chatbot)
- Groq API (For the AI Chatbot)
-
Database:
- [MySQL]
- [MongoDBAtlas]
- [ChromaDB]
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
git clone https://github.com/sadhana6299/MindSpace.git
cd MindSpaceThe backend server runs on Flask and handles API requests, database interactions, and communication with the OpenAI API.
# Navigate to the backend directory
cd backend
# Create and activate a virtual environment
# On Windows
python -m venv venv
.\venv\Scripts\activate
# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
# Install the required Python packages
pip install -r requirements.txt
# Create a .env file in the project root (the parent directory of 'backend')
# and add your API keys.
# The file should be located at 'MentalHealthAgent/.env'
touch ../.envcd backend
# Before executing the app.py make sure to run files from data_pipeline folder
# in this order
```bash
cd data_pipeline
python fetch_from_news.py
python fetch_from_ressearch.py
python merge_data.py
python create_vector_db.py
#Now your vector db is set up for RAG
python app.py
# Start the Flask server (it will run on http://localhost:5000)
The frontend is a Next.js application. Open a new terminal for these steps.
# Navigate to the project root directory
cd MindSpace
# Install the required npm packages
npm install
# Start the development server (it will run on http://localhost:3000)
npm run devOpen http://localhost:3000 in your browser to see the application.
To create a production-optimized build of the frontend:
# Create the production build
npm run build
# Start the production server
npm start