Skip to content

rohanphw/mummy

Repository files navigation

πŸ₯ Mummy - WhatsApp Health Bot

Your caring personal health assistant for families via WhatsApp

CI License: MIT TypeScript Node.js

Mummy is an intelligent WhatsApp bot that helps you and your family track health records, analyze medical reports, monitor health trends, and manage medications - all through simple WhatsApp messages.

✨ Features

  • πŸ“Š Intelligent Report Analysis - Upload PDFs or photos of medical reports, get AI-powered analysis
  • πŸ’Š Medication Tracking - Track medications with dosage, frequency, and timing
  • πŸ“ˆ Health Trends - Visualize and track health metrics over time
  • ❓ Natural Language Queries - Ask questions about your health history in plain English
  • πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Multi-User Support - Separate, private data for each family member
  • πŸ” Secure - Phone-based authentication, encrypted storage, HIPAA-ready architecture
  • πŸ€– Powered by Claude AI - Advanced understanding and analysis using Anthropic's Claude

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • MongoDB (local or Atlas)
  • Twilio account with WhatsApp enabled
  • Anthropic API key (for Claude)

Installation

# Clone the repository
git clone https://github.com/rohanphw/mummy.git
cd mummy

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your credentials

# Start development server
npm run dev

Configuration

Edit .env with your credentials:

# Twilio WhatsApp
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_WHATSAPP_NUMBER=whatsapp:+14155238886

# Anthropic Claude AI
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# MongoDB
MONGODB_URI=mongodb://localhost:27017/mummy

# Application
PORT=8000
NODE_ENV=development
DEFAULT_TIMEZONE=Asia/Kolkata

Webhook Setup

  1. Expose your local server (using ngrok):

    ngrok http 8000
  2. Configure Twilio webhook:

    • Go to Twilio Console β†’ Messaging β†’ WhatsApp
    • Set webhook URL: https://your-ngrok-url.ngrok.io/webhook/whatsapp
    • Method: POST
  3. Test by sending a WhatsApp message!

πŸ“– Usage

Commands

Command Description
/menu Show all available commands
/status View your health summary
/trends See health trends (last 6 months)
/records View recent health records
/medications View active medications

Quick Actions

After viewing records, type a number (1-10) to see details:

/records β†’ "1" β†’ Full details of record #1

Upload Health Reports

  • PDF: Send PDF file directly
  • Image: Take photo of report and send
  • Text: Type vitals like BP: 120/80, Weight: 70kg

Ask Questions

"What was my cholesterol last month?"
"Explain record #1"
"Show my blood pressure trend"
"When did I last check my blood sugar?"

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  WhatsApp   β”‚
β”‚   (User)    β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
   β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”
   β”‚ Twilio β”‚ (WhatsApp API)
   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Mummy Bot   β”‚ (Node.js + TypeScript)
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Express β”‚  β”‚ (Web Server)
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Handler β”‚  β”‚ (Message Router)
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β”‚
β”‚  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”‚
β”‚  β”‚Services β”‚  β”‚ (Claude, Twilio, DB)
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
   β”‚ MongoDB  β”‚ (Data Storage)
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

  • Backend: Node.js, TypeScript, Express
  • AI: Anthropic Claude (Haiku/Sonnet)
  • Database: MongoDB + Mongoose
  • Messaging: Twilio WhatsApp API
  • PDF Processing: pdf-parse
  • Image Processing: Sharp
  • Logging: Winston

πŸ”’ Security Features

  • βœ… Input sanitization and validation
  • βœ… Rate limiting (20 req/min per user)
  • βœ… Twilio signature verification
  • βœ… Security headers (XSS, clickjacking protection)
  • βœ… Phone number validation
  • βœ… Request size limits
  • βœ… User data isolation
  • βœ… Encrypted MongoDB connections

See SECURITY.md for more details.

πŸ“¦ Deployment

Docker

# Using Docker Compose (recommended)
docker-compose up -d

# Or build manually
docker build -t mummy .
docker run -p 8000:8000 --env-file .env mummy

Railway.com

  1. Push to GitHub
  2. Connect to Railway
  3. Add MongoDB service
  4. Set environment variables
  5. Deploy!

See DEPLOYMENT.md for detailed guides for Railway, AWS, DigitalOcean, and more.

πŸ§ͺ Development

# Run in development mode with hot reload
npm run dev

# Build for production
npm run build

# Run linter
npm run lint

# Format code
npm run format

# Run tests
npm test

πŸ“Š Project Structure

mummy/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config/           # Configuration management
β”‚   β”œβ”€β”€ handlers/         # Message handlers
β”‚   β”œβ”€β”€ models/           # Database models
β”‚   β”œβ”€β”€ services/         # External services (Claude, Twilio)
β”‚   β”œβ”€β”€ middleware/       # Express middleware (validation, security)
β”‚   β”œβ”€β”€ utils/            # Utility functions
β”‚   β”œβ”€β”€ types/            # TypeScript type definitions
β”‚   └── index.ts          # Application entry point
β”œβ”€β”€ .github/              # GitHub workflows and templates
β”œβ”€β”€ docs/                 # Additional documentation
β”œβ”€β”€ Dockerfile            # Docker configuration
β”œβ”€β”€ docker-compose.yml    # Docker Compose configuration
└── package.json          # Dependencies and scripts

🀝 Contributing (don't open any PRs in this repo please)

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

πŸ“ License (eh β€” its a vibe coded app)

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

Mummy is a health tracking tool, not a medical device. Always consult healthcare professionals for medical advice, diagnosis, or treatment. The bot provides information based on your data but does not replace professional medical judgment.

πŸ™ Acknowledgments (wow, talk about self-glazing, jeez)

πŸ“ž Support

πŸ—ΊοΈ Roadmap (I won't implement these anytime soon, but feel free to do it yourself with claude code)

  • Voice message support
  • Medication reminder scheduling
  • Export health reports as PDF
  • Integration with wearables (Fitbit, Apple Health)
  • Multi-language support
  • Family-wide analytics dashboard
  • Doctor report sharing

I'm in my vibe coding era, bear with me, thanks

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors