How ayush-030/medsafe_drug-drug-interaction works
Project type and purpose
• MedSafe is a full-stack Python/Flask web application that provides an AI-driven drug-drug interaction (DDI) prediction service.
• It combines:
• A web front end (HTML/CSS/JS under templates/ and static/)
• A Flask back end (app.py, Form and SIMPLE modules)
• A machine-learning pipeline that loads molecular data (Drug_data/) and runs similarity/clustering using RDKit, scikit-learn, pandas, etc.
• Optional integration with an external service (PubChem API) for real-time SMILES retrieval.
File structure
• Top level:
• app.py – application entry point
• templates/ and static/ – shared UI assets (index, login, signup, contact, main pages)
• Form/ – Flask “blueprint” or module managing the main DDI prediction form and results
• SIMPLE/ – alternate interface (CLI or simple web form) with its own templates and static files
• Drug_data/ – CSV data (drug lists, similarity matrices) and a README describing the data • Other assets: SAME_DRUG.csv, drug_names_ids.csv, and a Jupyter notebook for exploration.
• Key patterns:
• MVC-style separation: Flask routes & controllers in app.py and blueprints, Models are the ML pipeline, Views are Jinja2 templates + static assets.
• Configuration/dependencies declared in requirements.txt.
• Data files live in a dedicated folder, loaded at runtime by the back end.
README for additional insights
• Confirms tech stack: Python, Flask, RDKit, scikit-learn, pandas, optional PubChemPy.
• Describes the high-level model flow: SMILES → Morgan fingerprints → similarity matrix → clustering → risk prediction.
• Mentions both a web interface (Flask) and a CLI fallback.
Final advice
• Every module: root app.py, the two blueprints, the static/template directories, the ML code paths, and the data files.
• Do not omit the optional Jupyter notebook and PubChem integration—they illustrate extensibility.
• Provide enough detail to guide new engineers through the full request life cycle—from form submission to risk result display.