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.
- 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.
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
-
New API endpoints:
Add a new function inbackend/routes/api_routes.py(or create a new*_routes.pyfile if itβs a major feature) and register it in__init__.py. -
New AI/Gemini feature:
Usebackend/routes/ai_routes.pyand helper functions frombackend/utils/gemini_utils.py. -
New Dashboard Page:
Add a route indashboard_routes.py, create a new HTML file inbackend/templates, and if needed, CSS/JS inbackend/static. -
Error Pages:
Modify or add handlers inerror_handlers.py.
This modular structure makes it simple to extend the application.
- Python 3.8 or above
- Flask
- A valid Google Generative AI API key
-
Clone the repository:
git clone https://github.com/your-username/Drx.MediMate.git cd Drx.MediMate -
Install dependencies:
pip install -r requirements.txt
-
Set up your API key:
- Add your API key as an environment variable named
GEMINI_KEY.
- Add your API key as an environment variable named
-
Run the application:
python app.py
-
Open your browser and navigate to
http://127.0.0.1:5000/.
- Home Page:
GET / - Drug Information:
POST /get_drug_info- Input: JSON payload with
drug_name. - Output: JSON response containing clinical drug information.
- Input: JSON payload with
- Symptom Checker:
POST /symptom_checker- Input: JSON payload with
symptoms. - Output: JSON response with recommended drugs and safety information.
- Input: JSON payload with
- 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.
Contributions are welcome! Follow these steps:
- Fork the repository.
- Clone your fork:
git clone https://github.com/your-username/Drx.MediMate.git
- Create a feature branch:
git checkout -b feature-name
- Commit changes:
git commit -m "Description of your changes" - Push:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
