Skip to content

MAVERICK-VF142/Drx.MediMate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ’Š Drx.MediMate - Your Pharmaceutical Assistant

πŸ“ˆ Project Overview

Drx.MediMate is a Flask-based web application that serves as your AI-powered pharmaceutical assistant. It provides:

  • Clinical drug information, including therapeutic uses, dosage guidelines, side effects, contraindications, and drug interactions.
  • Symptom-based drug recommendations following evidence-based guidelines.
  • Educational Use: Designed for educational purposes to assist in healthcare decision-making.

πŸ”§ Features

  • Drug Information: Get detailed clinical summaries for any drug, tailored for pharmacists and healthcare professionals.
  • Symptom Checker: Input symptoms and receive AI-generated drug recommendations.
  • Role-based Dashboards: Separate dashboards for doctors, pharmacists, students, and patients.
  • Structured Codebase: Fully modular backend and organized frontend for easy contributions.
  • Educational Use: Designed for educational purposes to assist in healthcare decision-making.

πŸ—‚ Code Structure & Contribution Guide

After the major restructuring, the project now follows a clean, modular structure:

.
β”œβ”€β”€ app.py                  # Entry point of the application (registers blueprints)
β”‚
β”œβ”€β”€ backend
β”‚   β”œβ”€β”€ routes              # All route definitions (Blueprints)
β”‚   β”‚   β”œβ”€β”€ api_routes.py        # JSON APIs for drug info, symptom checker, etc.
β”‚   β”‚   β”œβ”€β”€ ai_routes.py         # Gemini / AI endpoints
β”‚   β”‚   β”œβ”€β”€ auth_routes.py       # Authentication (login, signup)
β”‚   β”‚   β”œβ”€β”€ dashboard_routes.py  # Dashboards (doctor, pharmacist, etc.)
β”‚   β”‚   β”œβ”€β”€ feature_routes.py    # Additional features
β”‚   β”‚   β”œβ”€β”€ error_handlers.py    # 404 / 500 error handlers
β”‚   β”‚   └── __init__.py          # Blueprint registration
β”‚   β”‚
β”‚   β”œβ”€β”€ utils
β”‚   β”‚   └── gemini_utils.py      # Utility functions for Gemini API
β”‚   β”‚
β”‚   β”œβ”€β”€ static
β”‚   β”‚   β”œβ”€β”€ css                  # Stylesheets
β”‚   β”‚   └── js                   # Client-side scripts
β”‚   β”‚
β”‚   └── templates                # Jinja2 HTML templates
β”‚
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Procfile
β”œβ”€β”€ vercel.json
└── LICENSE

Where to Add New Features

  • New API endpoints:
    Add a new function in backend/routes/api_routes.py (or create a new *_routes.py file if it’s a major feature) and register it in __init__.py.

  • New AI/Gemini feature:
    Use backend/routes/ai_routes.py and helper functions from backend/utils/gemini_utils.py.

  • New Dashboard Page:
    Add a route in dashboard_routes.py, create a new HTML file in backend/templates, and if needed, CSS/JS in backend/static.

  • Error Pages:
    Modify or add handlers in error_handlers.py.

This modular structure makes it simple to extend the application.


πŸ“š Table of Contents


⛏ Installation

Prerequisites

  1. Python 3.8 or above
  2. Flask
  3. A valid Google Generative AI API key

Steps

  1. Clone the repository:

    git clone https://github.com/your-username/Drx.MediMate.git
    cd Drx.MediMate
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up your API key:

    • Add your API key as an environment variable named GEMINI_KEY.
  4. Run the application:

    python app.py
  5. Open your browser and navigate to http://127.0.0.1:5000/.


▢️ Usage

Endpoints

  1. Home Page: GET /
  2. Drug Information: POST /get_drug_info
    • Input: JSON payload with drug_name.
    • Output: JSON response containing clinical drug information.
  3. Symptom Checker: POST /symptom_checker
    • Input: JSON payload with symptoms.
    • Output: JSON response with recommended drugs and safety information.

πŸ“Š Logging, Timeout & Retry

  • Logs are printed to console and available in deployment logs (e.g., Vercel).
  • Gemini API requests use a 10-second timeout with up to 3 retries.
  • Events logged: API calls, prompts, errors, exceptions.

πŸ› οΈ Contributing

Contributions are welcome! Follow these steps:

  1. Fork the repository.
  2. Clone your fork:
    git clone https://github.com/your-username/Drx.MediMate.git
  3. Create a feature branch:
    git checkout -b feature-name
  4. Commit changes:
    git commit -m "Description of your changes"
  5. Push:
    git push origin feature-name
  6. Open a pull request.

πŸ“œ License

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


❀️ Contributors

πŸ™Œ A Big Thank You to All Contributors!

Contributors