The first period tracker that teaches you what your cycle is actually telling you โ privately, safely, and with people who get it.
Maitri is a privacy-first, AI-powered women's health Progressive Web App (PWA). It goes beyond simple period prediction โ connecting your logged symptoms to real physiological explanations, surfacing patterns you'd never notice on your own, and providing a safe, moderated community of women at similar life stages.
- Log cycle start dates and receive phase predictions (Menstrual, Follicular, Ovulatory, Luteal)
- Visual progress bar showing where you are in your current cycle
- Transparent confidence tiers โ predictions get smarter with every logged cycle
- Quick micro-conversation check-ins (energy, physical symptoms, mood) designed to take under 30 seconds
- Calendar-style history view of all logged entries
- Automatic pattern surfacing after 2+ cycles of data
- Phase-aware, empathetic AI chatbot that knows your current cycle phase and recent symptoms
- Multi-provider failover across Google Gemini, Groq (Llama 3), and OpenRouter for 99.9% uptime
- Persistent chat history with conversations grouped by date in a collapsible sidebar
- Per-user rate limiting and server-side AI response caching
- Strictly scoped to women's health topics โ off-topic queries are gracefully declined
- Anonymous, moderated spaces grouped by life stage (Teens, 20s & 30s, Perimenopause, etc.)
- Structured post types: Questions, Experiences, Wins, Resources
- Upvoting, threaded replies, and weekly engagement prompts
- Complete history of cycle patterns, symptom logs, and AI conversations
- One-click data export for sharing with healthcare providers
- Full data deletion capabilities
- OTP-based passwordless authentication via email
- JWT session management with secure token handling
- Minor-user safety: automatic age detection at signup with optional parental consent flow
- Toggle-able pattern detection, AI chat history retention, and push notifications
- Customisable profiles with avatar and accent colour selection
- Installable on mobile (Android & iOS) and desktop
- Offline-capable with service worker caching
- Push notification support for cycle reminders and insights
- Native app-like experience with standalone display mode
| Technology | Purpose |
|---|---|
| React 19 (Vite 7) | UI framework with fast HMR |
| React Router DOM v7 | Client-side routing with protected routes |
| TailwindCSS 3 | Utility-first responsive styling |
| Axios | HTTP client for API communication |
| React Icons | Icon library |
| Technology | Purpose |
|---|---|
| Node.js / Express 5 | REST API server |
| MongoDB / Mongoose 9 | Database & ODM |
| JWT | Stateless session authentication |
| Nodemailer | OTP email delivery |
| web-push | Browser push notifications (VAPID) |
| Helmet | HTTP security headers |
| express-rate-limit | API rate limiting |
| Morgan | HTTP request logging |
A custom multi-provider fallback system with automatic cascade across providers and models:
- Google Gemini API โ Primary
- Tries
gemini-2.5-flashโgemini-2.0-flashโgemini-1.5-flashin sequence
- Tries
- Groq API (
llama3-8b-8192) โ Secondary - OpenRouter API โ Tertiary (free model pool)
- Tries
gemma-3-12b-itโgemma-3n-e2b-itโgemma-2-9b-itโmistral-small-3.1-24bin sequence
- Tries
| Service | Role |
|---|---|
| Vercel | Frontend hosting + serverless API functions |
Maitri/
โโโ public/ # Static assets & PWA files
โ โโโ manifest.json # PWA web app manifest
โ โโโ sw.js # Service worker (caching + push)
โ โโโ android-chrome-*.png # App icons (192ร192, 512ร512)
โ โโโ apple-touch-icon.png # iOS home screen icon
โ โโโ favicon.* # Browser favicons
โ
โโโ src/ # React frontend
โ โโโ main.jsx # Entry point + SW registration
โ โโโ App.jsx # Root component & routing
โ โโโ index.css # Global styles & design tokens
โ โโโ context/
โ โ โโโ AuthContext.jsx # Authentication state provider
โ โ โโโ ToastContext.jsx # Toast notification provider
โ โโโ components/
โ โ โโโ layout/
โ โ โโโ AppLayout.jsx # Protected layout shell with nav
โ โ โโโ AppLayout.css
โ โโโ lib/
โ โ โโโ api.js # Axios instance & interceptors
โ โโโ pages/
โ โโโ LandingPage.jsx # Public marketing page
โ โโโ LoginPage.jsx # OTP login
โ โโโ SignupPage.jsx # Registration flow
โ โโโ VerifyEmailPage.jsx # Email verification
โ โโโ HomePage.jsx # Dashboard with cycle tracking
โ โโโ JournalPage.jsx # Daily symptom check-ins
โ โโโ AskMaitriPage.jsx # AI chat interface
โ โโโ CommunityPage.jsx # Community circles
โ โโโ VaultPage.jsx # Health data vault & export
โ โโโ ProfilePage.jsx # User profile & settings
โ
โโโ server/ # Express backend
โ โโโ index.js # Server entry point
โ โโโ package.json # Backend dependencies
โ โโโ controllers/
โ โ โโโ authController.js # Signup, login, OTP, verify
โ โ โโโ cycleController.js # Cycle CRUD & predictions
โ โ โโโ journalController.js # Daily log management
โ โ โโโ insightController.js # AI-generated daily insights
โ โ โโโ askMaitriController.js # AI chat endpoint
โ โ โโโ communityController.js # Posts, replies, upvotes
โ โ โโโ vaultController.js # Data export & history
โ โโโ models/
โ โ โโโ User.js # User schema (auth, preferences, age bracket)
โ โ โโโ Cycle.js # Cycle records
โ โ โโโ DailyLog.js # Symptom journal entries
โ โ โโโ Post.js # Community posts
โ โ โโโ Reply.js # Threaded replies
โ โ โโโ ChatHistory.js # AI conversation persistence
โ โ โโโ AiCache.js # Cached AI responses
โ โโโ routes/
โ โ โโโ auth.js
โ โ โโโ cycles.js
โ โ โโโ journal.js
โ โ โโโ insights.js
โ โ โโโ askMaitri.js
โ โ โโโ community.js
โ โ โโโ vault.js
โ โโโ services/
โ โ โโโ aiService.js # Multi-provider AI fallback engine
โ โโโ middleware/ # Auth guards & rate limiters
โ
โโโ api/ # Vercel serverless adapter
โโโ index.html # App shell (PWA-configured)
โโโ vite.config.js # Vite config with API proxy
โโโ tailwind.config.js # Tailwind theme configuration
โโโ vercel.json # Vercel deployment config
โโโ package.json # Root dependencies & scripts
- Node.js v18 or higher
- MongoDB instance (local or MongoDB Atlas)
- At least one AI API key from: Google AI Studio, Groq, or OpenRouter
git clone https://github.com/Pratik-kr21/Maitri.git
cd Maitri# Frontend dependencies
npm install
# Backend dependencies
cd server
npm install
cd ..PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_EXPIRE=30d
# Email (Gmail App Password recommended)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_email_app_password
CLIENT_URL=http://localhost:5173
NODE_ENV=development
# AI Providers โ at least one is required
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
OPENROUTER_API_KEY=your_openrouter_api_key
# Push Notifications โ generate with: npx web-push generate-vapid-keys
VAPID_PUBLIC_KEY=your_vapid_public_key
VAPID_PRIVATE_KEY=your_vapid_private_keyVITE_VAPID_PUBLIC_KEY=your_vapid_public_key
VITE_API_URL=http://localhost:5000/apiYou need two terminal windows:
# Terminal 1 โ Backend
cd server
npm run dev# Terminal 2 โ Frontend
npm run devOpen http://localhost:5173 in your browser.
npm run build # Outputs to dist/
npm run preview # Preview the production build locallyMaitri is a fully installable Progressive Web App:
| Platform | How to Install |
|---|---|
| Android (Chrome) | Tap the "Add to Home Screen" banner or use the browser menu โ "Install App" |
| iOS (Safari) | Tap the Share button โ "Add to Home Screen" |
| Desktop (Chrome/Edge) | Click the install icon in the address bar |
Once installed, Maitri runs in standalone mode with its own window, offline caching, and push notifications.
The project is configured for Vercel deployment:
- Connect your GitHub repository to Vercel
- Set all environment variables from above in Vercel's dashboard
- The
vercel.jsonhandles routing โ API requests go to serverless functions, everything else falls through to the SPA
| Route | Access | Description |
|---|---|---|
/ |
Public | Landing page |
/login |
Public | OTP-based login |
/signup |
Public | Registration flow |
/verify-email |
Public | Email verification |
/home |
Protected | Dashboard with cycle tracking & insights |
/journal |
Protected | Daily symptom check-in |
/ask |
Protected | Ask Maitri AI companion |
/community |
Protected | Community circles |
/vault |
Protected | Health data vault & export |
/profile |
Protected | Settings & preferences |
We are continuously working to improve Maitri. Here are some features on our roadmap:
- โ Wearable Integration: Sync with Apple Health, Google Fit, and Oura Ring for automated basal body temperature (BBT) and sleep data logging.
- ๐ค Partner Sync: An opt-in feature to share cycle phase and empathy-driven tips with a trusted partner to foster understanding.
- ๐ Multilingual Support: Expanding the app interface and AI companion to support multiple languages for global accessibility.
- ๐ฉบ Provider Portal: A secure, HIPAA-compliant dashboard for healthcare providers to review patient-shared cycle data and symptom patterns.
- ๐ถ Advanced TTC Mode: Specialized features for those Trying to Conceive, including ovulation test strip scanning and detailed BBT charting.
- ๐ Dark Mode & Themes: Deeper UI customization including a dedicated dark mode that aligns with the premium aesthetic.
Maitri provides health education only. It is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.
Maitri thrives on community feedback! Here's how you can help:
- Report bugs โ Open an issue
- Request features โ Share your ideas in the issues tab
- Contribute code โ Fork the repo, create a branch, and submit a pull request
Built with ๐ for women's health