Built for India Β· Powered by Custom ML Β· 100% Free
"I didn't think an AI could make me feel heard. MindBridge was there at 2am when I had no one else to talk to."
MindBridge is a free, AI-powered mental health support platform built specifically for India. With 150 million Indians needing mental health care but only 0.3 psychiatrists per 100,000 people, access to support is a crisis in itself.
MindBridge bridges that gap β providing compassionate, intelligent, 24/7 mental health support through our custom-trained ML chatbot model, advanced behavioural mood detection, clinically validated screening tools, and mood tracking β all completely free, completely private.
β οΈ Disclaimer: MindBridge is a support companion, not a replacement for professional mental health care. If you are in crisis, please call iCall: 9152987821.
The core chatbot is powered by our own in-house trained ML model, purpose-built for empathetic mental health conversations. Unlike generic LLMs, this model was trained specifically on mental health dialogue patterns to listen without judgment, validate feelings before offering advice, detect emotional distress, and provide evidence-based coping strategies. Conversation history is stored per-session in Firestore.
Our sentiment analysis engine goes beyond just text β it analyses how you type, not just what you type. Mood is inferred from a combination of behavioural and textual signals in real time:
- Typing Speed β Rapid keystrokes may indicate agitation, anxiety, or urgency; slow typing may suggest low energy or sadness
- Message Sending Speed β Frequency of sent messages within a session is tracked to detect emotional bursts or withdrawal
- Message Length Patterns β Short, fragmented messages vs. lengthy outpourings are weighted as mood signals
- Punctuation & Casing Patterns β Excessive punctuation, ALL CAPS, or absence of punctuation are factored into emotional state scoring
- Response Latency β Time taken between receiving a reply and responding is used as a passive engagement signal
- Text Sentiment Score β Traditional NLP-based sentiment scoring layered with the above behavioural features for a composite mood reading
All of this analysis runs 100% locally in the browser β no data ever leaves your device for sentiment processing.
Full voice input and output using the Web Speech API β completely free, no external service needed. Speak naturally and hear MindBridge respond in a calm, measured voice.
Clinically validated depression and anxiety screening tools used worldwide by mental health professionals. After completing an assessment, Gemini AI interprets your specific answers and explains exactly what contributed to your score in plain, compassionate language. Gemini is used here specifically because assessment interpretation benefits from the nuanced reasoning of a frontier LLM.
Log your daily mood on a 1β10 scale, enriched with the behavioural signals captured during each session. After 7+ days, get a personalized AI insights report powered by Gemini that identifies your patterns, what affects your mood, and a concrete 5-point action plan based on your actual data. Gemini is used here to generate high-quality, context-aware narrative insights from your mood history.
All past conversations organised chronologically β just like your favourite AI chat apps. Switch between sessions, start new ones, and pick up where you left off.
On first login, users register a trusted contact (friend, parent, counsellor). This safety-first approach ensures someone who cares is always reachable in difficult moments.
- All data stored in Firebase Firestore with strict security rules
- Your conversations are never used for AI training
- No third-party analytics or data sharing
- All sentiment analysis and behavioural mood detection runs 100% locally in JavaScript β no API calls, no data leaving the browser
| Layer | Technology | Why |
|---|---|---|
| Frontend | React 18 + Vite | Fast, modern, component-based |
| Styling | Tailwind CSS | Utility-first, consistent design |
| Chatbot | Custom Trained ML Model | Purpose-built for mental health dialogue |
| AI Insights & Tests | Google Gemini 2.5 Flash | Best-in-class narrative reasoning for reports & assessments |
| Sentiment & Mood | Pure JavaScript (Behavioural + NLP) | No API calls, fully private, real-time |
| Auth | Firebase Authentication | Google-grade security, one-click login |
| Database | Firebase Firestore | Real-time, scalable, secure |
| Hosting | Firebase Hosting | Global CDN, instant deploys |
| Voice | Web Speech API | Built into Chrome, completely free |
- Node.js 20+
- A Google account
- A free Firebase project
- A free Gemini API key (used only for insights reports and assessments)
1. Clone the repository
git clone https://github.com/prats010/mindbridge-v2.git
cd mindbridge-v22. Install dependencies
npm install3. Set up Firebase
- Go to Firebase Console β Create project
- Enable Google Authentication (Authentication β Sign-in method β Google)
- Create a Firestore Database (start in production mode)
- Register a Web App and copy the config
4. Create your .env file
Copy .env.example to .env and fill in your values:
cp .env.example .envVITE_GEMINI_API_KEY=your_gemini_api_key_here
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id5. Deploy Firestore security rules
npm install -g firebase-tools
firebase login
firebase use --add
firebase deploy --only firestore:rules6. Run the app
npm run devOpen http://localhost:5173 π
# Build the app
npm run build
# Deploy to Firebase Hosting
firebase deploy --only hosting
# Your live URL:
# https://your-project-id.web.appmindbridge-v2/
βββ src/
β βββ components/
β β βββ Navbar.jsx # Navigation bar
β β βββ CrisisModal.jsx # Emergency helpline overlay
β β βββ TrustedContactModal.jsx # Onboarding safety modal
β βββ pages/
β β βββ LoginPage.jsx # Google sign-in
β β βββ ChatPage.jsx # Main AI chat + history sidebar
β β βββ AssessmentPage.jsx # PHQ-9 & GAD-7 screening (Gemini-interpreted)
β β βββ DashboardPage.jsx # Mood chart + Gemini AI insights
β βββ firebase.js # Firestore helpers
β βββ mlModel.js # Custom ML chatbot model integration
β βββ gemini.js # Gemini AI integration (insights & assessments only)
β βββ sentiment.js # Local behavioural + NLP sentiment engine
β βββ App.jsx # Router + auth state
β βββ main.jsx # Entry point
βββ firestore.rules # Firestore security rules
βββ firebase.json # Firebase config
βββ .env.example # Environment variables template
βββ package.json
MindBridge's core chat experience is driven by our custom-trained ML model, fine-tuned specifically for mental health support conversations. The model is designed to:
- Always acknowledge feelings before offering advice
- Use the user's name for personalisation
- Keep responses concise and conversational (3β4 sentences)
- Ask one thoughtful follow-up question per response
- Detect signs of distress and escalate to crisis resources
- Never diagnose β only reflect and support
Conversation history is passed to the model in full so it maintains context across a session.
Google Gemini is used exclusively for: (1) generating personalised insights reports from mood history data, and (2) interpreting PHQ-9 & GAD-7 assessment results in compassionate, plain language.
The sentiment engine captures passive behavioural signals alongside text content to build a richer emotional picture:
| Signal | What It Detects |
|---|---|
| Typing speed (WPM) | Agitation, urgency, anxiety vs. low energy |
| Message sending frequency | Emotional bursts, withdrawal, engagement level |
| Message length | Fragmented thinking vs. emotional overflow |
| Punctuation & casing | Frustration, distress, or emotional flatness |
| Response latency | Passive engagement or hesitance |
| NLP sentiment score | Base positive / negative / neutral text polarity |
These signals are combined into a composite mood score that informs the dashboard and, over time, feeds into the AI insights report. Everything runs locally β zero network calls.
| Tool | Purpose | Score Range |
|---|---|---|
| PHQ-9 | Depression screening | 0β27 |
| GAD-7 | Anxiety screening | 0β21 |
Both are WHO-validated tools used globally by clinical professionals. MindBridge uses them for screening only β results are interpreted by Gemini AI with compassion and context, not cold clinical language.
| Organisation | Number | Hours |
|---|---|---|
| iCall | 9152987821 | MonβSat, 8amβ10pm |
| Vandrevala Foundation | 1860-2662-345 | 24/7 |
| NIMHANS | 080-46110007 | 24/7 |
| AASRA | 9820466627 | 24/7 |
Contributions are welcome. Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Prathamesh & Team β Built with purpose for the Google Cloud AI Hackathon
Prem β Contributed to UI Designing
Mental health support should be accessible to everyone, everywhere, at any hour. MindBridge is our step toward making that real.
If this project helped you or someone you know, please give it a β
Made with β€οΈ in India Β· Powered by Custom ML + Google Gemini Β· Built for the 150 million