MindMate is an AI-powered mental wellness companion that helps users reflect on their emotions through intelligent journaling. Using advanced NLP and sentiment analysis, MindMate provides personalized insights and supportive reflections.
- 📝 Smart Journaling - Write or speak your thoughts
- 🧠 Emotion Detection - AI analyzes your emotional state using transformers
- 💬 AI Reflections - Get personalized, supportive feedback from Gemini or OpenAI
- 📊 Mood Tracking - Visualize your emotional journey with charts and analytics
- 🎤 Voice Input - Record and transcribe your thoughts
- 🔄 Provider Switching - Toggle between Gemini (testing) and OpenAI (production)
- 🔒 Privacy First - Your data stays secure
- Python 3.10+ (Python 3.12 recommended)
- Node.js 18+ (Node.js 20+ recommended)
- pip (Python package manager)
- npm (Node package manager)
-
Navigate to backend directory
cd backend -
Create virtual environment
python -m venv venv
-
Activate virtual environment
- macOS/Linux:
source venv/bin/activate - Windows:
venv\Scripts\activate
- macOS/Linux:
-
Install dependencies
pip install -r requirements.txt
⚠️ Note: This may take several minutes as it downloads PyTorch and transformers models (~2-3GB) -
Configure environment variables
# The .env file should already exist, but verify it has your API keys # Edit backend/.env and add: GEMINI_API_KEY=your_gemini_key_here OPENAI_API_KEY=your_openai_key_here # Optional but recommended
-
Run the backend server
python -m app.main
The backend will start on
http://localhost:8000You should see:
- ✅ Emotion analyzer loaded successfully
- ✅ Gemini/OpenAI initialized
- INFO: Uvicorn running on http://0.0.0.0:8000
-
Navigate to frontend directory (in a new terminal)
cd frontend -
Install dependencies
npm install
-
Create environment file (if not exists)
# Create .env file with: echo "VITE_API_URL=http://localhost:8000" > .env
-
Run the frontend development server
npm run dev
The frontend will start on
http://localhost:3000You should see:
- VITE ready in XXX ms
- ➜ Local: http://localhost:3000/
cd backend
source venv/bin/activate # Windows: venv\Scripts\activate
python -m app.maincd frontend
npm run dev- Open
http://localhost:3000in your browser - The frontend will automatically connect to the backend API
MindMate/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI application entry point
│ │ ├── config.py # Configuration settings
│ │ ├── database.py # Database connection
│ │ ├── models.py # SQLAlchemy models
│ │ ├── schemas.py # Pydantic schemas
│ │ ├── routes/ # API routes
│ │ │ ├── journal.py # Journal endpoints
│ │ │ ├── mood.py # Mood analytics
│ │ │ ├── analysis.py # AI analysis endpoints
│ │ │ └── settings.py # Settings/provider switching
│ │ ├── services/ # AI services
│ │ │ ├── emotion_analyzer.py
│ │ │ ├── reflection_generator.py
│ │ │ └── speech_to_text.py
│ │ └── utils/ # Utility functions
│ ├── tests/ # Test files
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables
│
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── common/ # Reusable components
│ │ │ ├── journal/ # Journal components
│ │ │ ├── layout/ # Layout components
│ │ │ └── mood/ # Mood analytics components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API services
│ │ └── utils/ # Utility functions
│ ├── package.json # Node dependencies
│ └── vite.config.js # Vite configuration
│
└── README.md
# API Keys
GEMINI_API_KEY=your_gemini_key
OPENAI_API_KEY=your_openai_key
# Model Configuration
GEMINI_MODEL=gemini-2.0-flash-exp
OPENAI_MODEL=gpt-4o-mini
WHISPER_MODEL=whisper-1
# Provider Selection (gemini for testing, openai for production)
REFLECTION_PROVIDER=gemini
# Database
DATABASE_URL=sqlite:///./mindmate.db
# Server
HOST=0.0.0.0
PORT=8000
DEBUG=TrueVITE_API_URL=http://localhost:8000- Navigate to Dashboard
- Write your thoughts in the journal input
- Click "Submit" or use voice recording
- Get AI-powered reflection and emotion analysis
- Click "Use Voice" button
- Record your thoughts
- Audio is transcribed automatically
- Journal entry is created with transcription
- Go to Settings page
- Find "AI Provider" section
- Click on Gemini (Testing) or OpenAI (Production)
- Provider switches instantly without server restart
- Navigate to Insights page
- View emotion distribution charts
- See mood trends over time
- Track your emotional patterns
cd backend
source venv/bin/activate
pytest tests/test_api.py -v- Once backend is running, visit:
http://localhost:8000/docs - Interactive API documentation (Swagger UI)
Port already in use:
# Find and kill process on port 8000
lsof -ti:8000 | xargs kill -9Missing API keys:
- Add API keys to
backend/.env - Restart the backend server
PyTorch installation issues:
- Make sure you have Python 3.10+
- Try:
pip install torch --index-url https://download.pytorch.org/whl/cpu
Port already in use:
- Change port in
vite.config.jsor kill the process
API connection errors:
- Verify backend is running on
http://localhost:8000 - Check
VITE_API_URLinfrontend/.env
Module not found:
cd frontend
rm -rf node_modules package-lock.json
npm installPOST /journal/create- Create journal entryGET /journal/history- Get journal historyGET /journal/{id}- Get specific entry
GET /mood/stats- Get mood statistics
POST /analysis/emotion- Analyze emotionPOST /analysis/reflect- Generate reflectionPOST /analysis/speech-to-text- Transcribe audioPOST /analysis/analyze-full- Full analysis
GET /settings/provider- Get current providerPOST /settings/provider- Switch provider
- Set
DEBUG=Falsein.env - Use a production WSGI server (Gunicorn)
- Set up proper CORS origins
- Use a production database (PostgreSQL)
- Build for production:
npm run build - Serve with a web server (Nginx)
- Update
VITE_API_URLto production API URL
This project is built for LuminHacks 2025.
- Built with FastAPI, React, and Vite
- AI powered by Gemini and OpenAI
- Emotion analysis using Hugging Face transformers
Happy Journaling! 🧠💙