# anurag2808/drug-2-drug-interaction architecture

> Architecture diagram of the GitHub repository anurag2808/drug-2-drug-interaction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anurag2808/drug-2-drug-interaction
- Repository: https://github.com/anurag2808/drug-2-drug-interaction

## Overview

##### Project type and purpose
- From the README (“Drug-2-Drug-Interaction: A ML project that predicts the drug–drug interaction”) and the file tree, we see:
- A Jupyter notebook (main.ipynb) for exploration and model development
- A CSV data file (Id_details_new.csv)
- A Python application script (app_new.py)
- Two HTML files (index.html, Details.html) for the UI
- This is a small full-stack ML application: a model training/experimentation component plus a web service for model inference exposed via a simple HTML-based frontend.

##### File structure
- Top-level files only; no nested directories
- main.ipynb: experiment & training pipeline
- Id_details_new.csv: raw or processed dataset
- app_new.py: backend web service (likely Flask or FastAPI)
- index.html & Details.html: frontend pages for user interaction
- Details.html may show prediction outputs or drug information
- No external database—data stored in CSV and model artifact likely saved to disk within app_new.py or loaded in memory.

##### README for additional insights
- Very brief; confirms ML prediction service
- No mention of external services or cloud deployments
- Implies single-node, on-premise or local web app

##### Elements
– Labels: “Browser UI,” “Frontend (HTML)”, “Backend API (app_new.py)”, “Data Store (CSV & model file)”, “Training Pipeline (main.ipynb)”
- From Browser to Frontend (user request)
- Frontend → Backend (HTTP POST/GET)
- Backend → Data Store (file read)
- Backend → Frontend (prediction response)
- In development view: CSV → Notebook → Model artifact → Backend
- Blue rectangles for compute components (Notebook, API)

##### Detailed architectural capture
- Don’t just show “ML service”—break it into “Feature Extraction,” “Model Loading,” “Prediction Engine” if needed
- Explicitly show where preprocessing happens (notebook vs. API)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Runtime Flow
    subgraph "Runtime Environment"
        direction TB
        Browser["User Browser"]:::external
        subgraph "Frontend UI"
            direction TB
            FrontendIndex["index.html"]:::frontend
            FrontendDetails["Details.html"]:::frontend
        end
        BackendAPI["Backend API (app_new.py)"]:::backend
        DataStore["Data Store\n(CSV & Model Artifact)"]:::datastore
    end

    %% Development Flow
    subgraph "Development Pipeline"
        direction TB
        CSV["Id_details_new.csv"]:::datastore
        Notebook["Training Notebook\n(main.ipynb)"]:::training
        ModelArtifact["Model Artifact\n(.pkl)"]:::datastore
    end

    %% Runtime Connections
    Browser -->|"loads"| FrontendIndex
    FrontendIndex -->|"user submits drug pair"| BackendAPI
    BackendAPI -->|"reads lookup/model"| DataStore
    BackendAPI -->|"returns prediction"| FrontendDetails
    FrontendDetails -->|"displays results"| Browser

    %% Development Connections (dashed)
    CSV -.->|reads data| Notebook
    Notebook -.->|exports model| ModelArtifact
    ModelArtifact -.->|deployed to| BackendAPI

    %% Documentation
    README["Project Documentation\n(README.md)"]:::doc

    %% Legend Link
    README -.->|project info| Browser

    %% Click Events
    click FrontendIndex "https://github.com/anurag2808/drug-2-drug-interaction/blob/main/index.html"
    click FrontendDetails "https://github.com/anurag2808/drug-2-drug-interaction/blob/main/Details.html"
    click BackendAPI "https://github.com/anurag2808/drug-2-drug-interaction/blob/main/app_new.py"
    click Notebook "https://github.com/anurag2808/drug-2-drug-interaction/blob/main/main.ipynb"
    click CSV "https://github.com/anurag2808/drug-2-drug-interaction/blob/main/Id_details_new.csv"
    click README "https://github.com/anurag2808/drug-2-drug-interaction/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D6EAF8,stroke:#21618C,color:#1B4F72
    classDef backend fill:#FADBD8,stroke:#C0392B,color:#641E16
    classDef datastore fill:#D5F5E3,stroke:#1D8348,color:#145A32
    classDef training fill:#FCF3CF,stroke:#B7950B,color:#7D6608
    classDef doc fill:#E8DAEF,stroke:#7D3C98,color:#512E5F
    classDef external fill:#EBF5FB,stroke:#5D6D7E,color:#283747
    classDef dashed stroke-dasharray: 5 5

    class CSV,Notebook,ModelArtifact dashed
```
