Skip to content

amankumarhappy/mediobot

Repository files navigation

🩺 Mediobot — AI Medical First-Aid Assistant

Mediobot Logo

Safety-first medical first-aid guidance for rural India
Firebase Auth • Encrypted API Keys • Rule-Based Triage • Hindi/Bhojpuri Voice


✨ Features

Feature Description
🔐 Firebase Auth Email/Password + Google login
🔑 Encrypted API Keys HMAC-signed, 7-day expiry, per-user limits
🩺 Medical Triage Rule-based symptom detection (zero AI hallucination)
🌡️ Fever Check Temperature classification with protocol-based steps
🏥 Hospital Finder Leaflet.js interactive maps for Bihar hospitals
🎤 Voice I/O Hindi, English, Bhojpuri speech recognition + TTS
👨‍💼 Admin Panel User management, usage tracking, key control
📄 PDF Ingestion Auto-extract medical data from uploaded PDFs
💬 Free Tier 3 free chats without login, then login required
📖 API Documentation Complete docs + Swagger/ReDoc

🚀 Quick Start

# Clone
git clone https://github.com/amankumarhappy/mediobot.git
cd mediobot

# Install dependencies
pip install -r requirements.txt

# Create .env file
cp .env.example .env  # Edit with your Firebase config

# Run
python app.py
# → http://localhost:8000

🔑 API Key System

  1. Sign up at the web UI
  2. Go to API Keys page
  3. Click Generate Key → Copy your mb_xxxxx key
  4. Use in requests:
curl -X POST http://localhost:8000/fever \
  -H "x-api-key: mb_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"temp": 102}'

Key Rules

  • Keys start with mb_ prefix
  • Expire after 7 days
  • Only one active key per user
  • Usage is counted and rate-limited
  • HMAC-signed — cannot be forged

📊 API Endpoints

Method Endpoint Auth Description
POST /auth/login Bearer Login with Firebase token
POST /auth/generate-key Bearer Generate API key
POST /fever API Key Fever classification
POST /triage API Key Smart symptom triage
POST /hospitals API Key Hospital lookup
POST /condition API Key Condition lookup
GET /protocols API Key List all protocols
POST /chat/free None Free chat (3 limit)
GET /admin/users Admin User management

🏗️ Architecture

mediobot/
├── app.py              # FastAPI backend (auth, triage, admin)
├── database.py         # SQLite + HMAC API key management
├── protocol.json       # Medical protocol database
├── requirements.txt    # Python dependencies
├── .env                # Environment config (not in git)
├── static/
│   ├── index.html      # Premium SPA UI
│   ├── style.css       # Design system
│   ├── script.js       # Firebase Auth + Chat + Admin
│   └── LOGO-removebg-preview.png
└── mediobot.db         # SQLite database (auto-created)

⚠️ Disclaimer

Mediobot is NOT a diagnostic tool. It provides first-aid guidance based on verified protocols from WHO, MoHFW India, and AIIMS. Always consult a doctor for medical decisions. In emergencies, call 108 first.

👨‍💻 Built By

NexaForce — Aman Kumar, Bihar, India 🇮🇳


Made with ❤️ for rural India

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors