Skip to content

Latest commit

Β 

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ‰ MindBridge - Privacy-First Mental Wellness Platform

Deployed on Vercel Next.js TypeScript Clerk

A production-ready mental wellness platform for students with enterprise-grade security, privacy-first architecture, and premium UI/UX design.

πŸ“– Table of Contents


🎯 Overview

MindBridge is a comprehensive mental health support platform designed specifically for students. It combines AI-powered companionship, mood tracking, dream analysis, and peer support in a secure, privacy-first environment.

Why MindBridge?

  • βœ… Privacy-First: On-device processing, encrypted data, GDPR/CCPA compliant
  • βœ… Crisis-Aware: Multi-level crisis detection with automatic escalation
  • βœ… AI-Powered: GPT-4 chatbot with contextual emotional support
  • βœ… Peer Support: Anonymous peer matching with E2E encryption
  • βœ… Beautiful UI: Premium design with smooth animations and accessibility
  • βœ… Multi-Language: Support for 6 Indian languages

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and pnpm installed
  • Clerk account (for authentication) - Sign up here
  • Convex account (optional, for backend) - Sign up here

Installation

# Clone the repository
git clone https://github.com/SrivarsanK/MindBridge.git
cd MindBridge

# Install dependencies
pnpm install

Running Locally

Option 1: Quick Preview (No Setup Required)

pnpm dev

Visit http://localhost:3000 - The app will work with guest mode and mock data.

Option 2: Full Setup (With Authentication)

  1. Create .env.local file in the root directory
  2. Add your Clerk API keys (see Setup Guide)
  3. Run the development server:
pnpm dev

✨ Features

🎯 Core Features

Feature Description Status
AI Companion 24/7 GPT-4 powered emotional support chatbot βœ… Ready
Crisis Detection Multi-level crisis detection with auto-escalation βœ… Ready
Dream Analysis Emotional pattern recognition from dream journals βœ… Ready
Peer Matching Anonymous peer-to-peer support connections βœ… Ready
Mood Tracking Daily mood check-ins with visualization βœ… Ready
Quick Relief Breathing exercises and grounding techniques βœ… Ready

πŸ”’ Security & Privacy

  • On-Device Processing: Sensitive data encrypted before storage
  • End-to-End Encryption: Peer messages fully encrypted
  • GDPR/CCPA Compliant: Data export, deletion, and retention controls
  • Role-Based Access: Student, moderator, and crisis responder roles
  • Audit Logging: Comprehensive activity tracking
  • Anonymous Mode: Optional pseudonym generation

🌐 Localization

Supports 6 languages:

  • English (India) - en-IN
  • Hindi - hi
  • Bengali - bn
  • Tamil - ta
  • Telugu - te
  • Marathi - mr

πŸ—οΈ Tech Stack

Frontend

Backend

Dev Tools

  • Package Manager: pnpm
  • Linting: ESLint
  • Deployment: Vercel

πŸ“‚ Project Structure

MindBridge/
β”œβ”€β”€ app/                           # Next.js App Router
β”‚   β”œβ”€β”€ (marketing)/               # Public pages
β”‚   β”‚   └── page.tsx              # Landing page
β”‚   β”œβ”€β”€ dashboard/                 # Protected dashboard
β”‚   β”‚   └── page.tsx              # Main dashboard
β”‚   β”œβ”€β”€ login/                     # Authentication
β”‚   β”‚   └── page.tsx              # Login page
β”‚   β”œβ”€β”€ onboarding/                # 4-step onboarding
β”‚   β”‚   β”œβ”€β”€ step-1/               # Privacy consent
β”‚   β”‚   β”œβ”€β”€ step-2/               # Language selection
β”‚   β”‚   β”œβ”€β”€ step-3/               # Initial mood
β”‚   β”‚   └── step-4/               # Feature tour
β”‚   β”œβ”€β”€ layout.tsx                 # Root layout
β”‚   └── globals.css                # Global styles
β”‚
β”œβ”€β”€ components/                    # React components
β”‚   β”œβ”€β”€ dashboard/                 # Dashboard feature cards
β”‚   β”‚   β”œβ”€β”€ ai-companion-card.tsx
β”‚   β”‚   β”œβ”€β”€ daily-checkin-card.tsx
β”‚   β”‚   β”œβ”€β”€ dream-analysis-card.tsx
β”‚   β”‚   β”œβ”€β”€ micro-interventions-card.tsx
β”‚   β”‚   └── peer-matching-card.tsx
β”‚   β”œβ”€β”€ ui/                        # Reusable UI components
β”‚   └── emergency-support-bar.tsx  # Crisis hotline bar
β”‚
β”œβ”€β”€ convex/                        # Convex backend
β”‚   β”œβ”€β”€ schema.ts                  # Database schema (15 tables)
β”‚   β”œβ”€β”€ chatbot.ts                 # AI chatbot logic
β”‚   β”œβ”€β”€ crisis.ts                  # Crisis detection
β”‚   β”œβ”€β”€ peerMatching.ts            # Peer algorithm
β”‚   β”œβ”€β”€ dreamAnalysis.ts           # Dream patterns
β”‚   └── privacy.ts                 # GDPR compliance
β”‚
β”œβ”€β”€ lib/                           # Utility functions
β”‚   β”œβ”€β”€ utils.ts                   # Helper functions
β”‚   └── emergency.ts               # Crisis hotlines
β”‚
β”œβ”€β”€ middleware.ts                  # Clerk auth middleware
β”œβ”€β”€ .env.local                     # Environment variables
└── README.md                      # This file

πŸ“š Setup Guide

Step 1: Clone and Install

git clone https://github.com/SrivarsanK/MindBridge.git
cd MindBridge
pnpm install

Step 2: Configure Clerk Authentication

  1. Go to clerk.com and sign up
  2. Create a new application
  3. Go to API Keys in the dashboard
  4. Copy your keys and add them to .env.local:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
CLERK_SECRET_KEY=sk_test_your_secret_key_here

# Clerk URLs
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/login
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/onboarding/step-1

Step 3: Configure Convex Backend (Optional)

  1. Go to convex.dev and sign up
  2. Install Convex CLI:
npx convex dev
  1. Follow the prompts to create a deployment
  2. Add the generated URLs to .env.local:
# Convex Backend
CONVEX_DEPLOYMENT=dev:your-deployment-name
NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud

Step 4: Add OpenAI API Key (Optional)

For AI chatbot functionality:

# OpenAI API
CONVEX_OPENAI_API_KEY=sk-your-openai-api-key-here

Step 5: Run the Application

# Development mode
pnpm dev

# Production build
pnpm build
pnpm start

πŸš€ Deployment

Deploy to Vercel (Recommended)

  1. Push to GitHub

    git add .
    git commit -m "Ready for deployment"
    git push origin main
  2. Import to Vercel

    • Go to vercel.com
    • Click "New Project"
    • Import your GitHub repository
    • Vercel will auto-detect Next.js
  3. Add Environment Variables

    • Go to Project Settings β†’ Environment Variables
    • Add all variables from .env.local
    • Deploy!

Deploy Convex Backend

npx convex deploy

Update your Vercel environment variables with the production Convex URL.

Production Checklist

  • Update Clerk keys to production keys
  • Deploy Convex backend to production
  • Configure Clerk production URLs
  • Test all authentication flows
  • Verify crisis detection works
  • Test GDPR data export
  • Enable rate limiting
  • Set up monitoring and analytics

πŸ“– Documentation

Document Description
QUICK_START.md Quick reference guide
BACKEND_INTEGRATION_GUIDE.md Full backend setup instructions
WARP.md Development guide for AI agents
Clerk Docs Authentication documentation
Convex Docs Backend database documentation

πŸ†˜ Emergency Resources

MindBridge includes built-in crisis support with Indian mental health hotlines:

  • Tele-MANAS: 14416 / 1800-891-4416
  • KIRAN: 1800-599-0019

These are always visible in the emergency support bar at the bottom of the app.


🀝 Contributing

We welcome contributions! This is a mental health platform, so please:

  1. Follow best practices: Accessibility, privacy, and security
  2. Test thoroughly: Especially crisis detection features
  3. Maintain sensitivity: Handle mental health topics with care
  4. Document changes: Update README and comments

Development Workflow

# Fork the repository
# Create a feature branch
git checkout -b feature/your-feature-name

# Make changes and test
pnpm dev

# Build and verify
pnpm build

# Commit and push
git commit -m "Add your feature"
git push origin feature/your-feature-name

# Create a pull request

πŸ“„ License

MIT License - See LICENSE for details


πŸ™ Acknowledgments

  • OpenAI - GPT-4 API for AI companionship
  • Convex - Real-time serverless database
  • Clerk - Authentication infrastructure
  • Radix UI - Accessible component primitives
  • Vercel - Deployment and hosting
  • v0.app - Initial UI generation
  • All contributors and mental health advocates

πŸ’¬ Support


Built with ❀️ for student mental health

πŸŒ‰ MindBridge - Privacy-First Mental Wellness Platform

About

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages