# abishekvijay05/gdsc architecture

> Architecture diagram of the GitHub repository abishekvijay05/gdsc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abishekvijay05/gdsc
- Repository: https://github.com/abishekvijay05/gdsc

## Overview

RepurposeAI is a web-based drug-repurposing research platform. Its principal workflow takes a molecule search through clinical, patent, market, and regulatory research, then synthesizes findings into a report; the README also documents a no-key fallback for AI synthesis. Separate capabilities include disease-first hypothesis generation and conversational follow-up. The Flask app is identified as the server, but its source was not sampled, so app-level orchestration and frontend-to-backend links are shown only as unverified. Domain integrations and major analysis modules are retained; the available excerpts do not establish every internal call.

Main entry points: [`backend/app.py`](https://github.com/abishekvijay05/gdsc/blob/main/backend/app.py) (Flask server), [`frontend/static/js/main.js`](https://github.com/abishekvijay05/gdsc/blob/main/frontend/static/js/main.js) (Web interface), [`backend/modules/hypothesis_generator.py`](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/hypothesis_generator.py) (Hypothesis generator), [`backend/modules/synthesizer.py`](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/synthesizer.py) (Report synthesis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_web_ui["Web interface<br/>[main.js]"]
  node_server["Flask server<br/>[app.py]"]
end

subgraph group_research["Research evidence"]
  node_clinical["Clinical trials<br/>[clinical.py]"]
  node_patents["Patent research<br/>[patents.py]"]
  node_market["Market data<br/>[market.py]"]
  node_regulatory["Regulatory data<br/>[regulatory.py]"]
  node_pubmed["Literature search<br/>[pubmed.py]"]
  node_mechanism["Drug mechanism<br/>[mechanism.py]"]
end

subgraph group_analysis["Analysis engines"]
  node_context["Clinical context<br/>[context_memory.py]"]
  node_overlap["Pathway overlap<br/>[overlap_engine.py]"]
  node_similarity["Drug similarity"]
  node_hypothesis["Disease hypotheses<br/>[hypothesis.py]"]
  node_hypothesis_generator["Hypothesis generator"]
  node_scorer["Confidence scoring<br/>[scorer.py]"]
  node_synthesizer["Report synthesis<br/>[synthesizer.py]"]
  node_token_tracker["Token tracking<br/>[token_tracker.py]"]
end

subgraph group_interaction["Conversation and state"]
  node_intent["Intent translation"]
  node_followup["Follow-up answers<br/>[followup.py]"]
  node_conversation["Conversation state"]
  node_failure["Failure analysis"]
  node_database[("Research database<br/>[database.py]")]
end

node_researcher(("Researcher"))
node_clinical_service{{"ClinicalTrials.gov"}}
node_pubchem{{"PubChem"}}
node_openfda{{"OpenFDA"}}
node_ai_service{{"AI service"}}

node_researcher -->|"submits search"| node_web_ui
node_web_ui -.->|"sends requests"| node_server
node_server -.->|"dispatches research"| node_clinical
node_server -.->|"dispatches research"| node_patents
node_server -.->|"dispatches research"| node_market
node_server -.->|"dispatches research"| node_regulatory
node_clinical -->|"fetches trials"| node_clinical_service
node_patents -->|"fetches patents"| node_pubchem
node_market -->|"fetches market data"| node_openfda
node_regulatory -->|"fetches labels"| node_openfda
node_server -.->|"dispatches research"| node_pubmed
node_server -.->|"dispatches research"| node_mechanism
node_server -.->|"builds context"| node_context
node_server -.->|"scores evidence"| node_scorer
node_server -.->|"requests synthesis"| node_synthesizer
node_synthesizer -.->|"generates report"| node_ai_service
node_server -.->|"runs disease search"| node_hypothesis
node_server -.->|"runs disease search"| node_hypothesis_generator
node_hypothesis_generator -->|"computes overlap"| node_overlap
node_hypothesis_generator -->|"uses drug classes"| node_similarity
node_synthesizer -->|"records usage"| node_token_tracker
node_intent -->|"records usage"| node_token_tracker
node_followup -->|"records usage"| node_token_tracker
node_web_ui -.->|"sends feedback"| node_intent
node_web_ui -.->|"asks questions"| node_followup
node_server -.->|"manages sessions"| node_conversation
node_server -.->|"stores research state"| node_database

click node_web_ui "https://github.com/abishekvijay05/gdsc/blob/main/frontend/static/js/main.js"
click node_server "https://github.com/abishekvijay05/gdsc/blob/main/backend/app.py"
click node_clinical "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/clinical.py"
click node_patents "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/patents.py"
click node_market "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/market.py"
click node_regulatory "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/regulatory.py"
click node_pubmed "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/pubmed.py"
click node_mechanism "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/mechanism.py"
click node_context "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/context_memory.py"
click node_overlap "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/overlap_engine.py"
click node_similarity "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/similarity_engine.py"
click node_hypothesis "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/hypothesis.py"
click node_hypothesis_generator "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/hypothesis_generator.py"
click node_scorer "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/scorer.py"
click node_synthesizer "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/synthesizer.py"
click node_token_tracker "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/token_tracker.py"
click node_intent "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/intent_translator.py"
click node_followup "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/followup.py"
click node_conversation "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/conversation_state.py"
click node_failure "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/failure_analysis.py"
click node_database "https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/database.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_ui,node_server toneBlue
class node_clinical,node_patents,node_market,node_regulatory,node_pubmed,node_mechanism toneAmber
class node_context,node_overlap,node_similarity,node_hypothesis,node_hypothesis_generator,node_scorer,node_synthesizer,node_token_tracker toneMint
class node_intent,node_followup,node_conversation,node_failure,node_database toneRose
class node_researcher,node_clinical_service,node_pubchem,node_openfda,node_ai_service toneIndigo
```

## Components

### User interface

- [Web interface](https://github.com/abishekvijay05/gdsc/blob/main/frontend/static/js/main.js): `frontend/static/js/main.js`
- [Flask server](https://github.com/abishekvijay05/gdsc/blob/main/backend/app.py): `backend/app.py`

### Research evidence

- [Clinical trials](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/clinical.py): `backend/modules/clinical.py`
- [Patent research](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/patents.py): `backend/modules/patents.py`
- [Market data](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/market.py): `backend/modules/market.py`
- [Regulatory data](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/regulatory.py): `backend/modules/regulatory.py`
- [Literature search](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/pubmed.py): `backend/modules/pubmed.py`
- [Drug mechanism](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/mechanism.py): `backend/modules/mechanism.py`

### Analysis engines

- [Clinical context](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/context_memory.py): `backend/modules/context_memory.py`
- [Pathway overlap](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/overlap_engine.py): `backend/modules/overlap_engine.py`
- [Drug similarity](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/similarity_engine.py): `backend/modules/similarity_engine.py`
- [Disease hypotheses](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/hypothesis.py): `backend/modules/hypothesis.py`
- [Hypothesis generator](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/hypothesis_generator.py): `backend/modules/hypothesis_generator.py`
- [Confidence scoring](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/scorer.py): `backend/modules/scorer.py`
- [Report synthesis](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/synthesizer.py): `backend/modules/synthesizer.py`
- [Token tracking](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/token_tracker.py): `backend/modules/token_tracker.py`

### Conversation and state

- [Intent translation](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/intent_translator.py): `backend/modules/intent_translator.py`
- [Follow-up answers](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/followup.py): `backend/modules/followup.py`
- [Conversation state](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/conversation_state.py): `backend/modules/conversation_state.py`
- [Failure analysis](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/failure_analysis.py): `backend/modules/failure_analysis.py`
- [Research database](https://github.com/abishekvijay05/gdsc/blob/main/backend/modules/database.py): `backend/modules/database.py`

### Other components

- **Researcher**
- **ClinicalTrials.gov**
- **PubChem**
- **OpenFDA**
- **AI service**

## Connections

- Researcher → Web interface: submits search (evidence: `README.md`)
- Web interface → Flask server: sends requests
- Flask server → Clinical trials: dispatches research
- Flask server → Patent research: dispatches research
- Flask server → Market data: dispatches research
- Flask server → Regulatory data: dispatches research
- Clinical trials → ClinicalTrials.gov: fetches trials (evidence: `README.md`)
- Patent research → PubChem: fetches patents (evidence: `README.md`)
- Market data → OpenFDA: fetches market data (evidence: `README.md`)
- Regulatory data → OpenFDA: fetches labels (evidence: `README.md`)
- Flask server → Literature search: dispatches research
- Flask server → Drug mechanism: dispatches research
- Flask server → Clinical context: builds context
- Flask server → Confidence scoring: scores evidence
- Flask server → Report synthesis: requests synthesis
- Report synthesis → AI service: generates report
- Flask server → Disease hypotheses: runs disease search
- Flask server → Hypothesis generator: runs disease search
- Hypothesis generator → Pathway overlap: computes overlap (evidence: `backend/modules/hypothesis_generator.py`)
- Hypothesis generator → Drug similarity: uses drug classes (evidence: `backend/modules/hypothesis_generator.py`)
- Report synthesis → Token tracking: records usage (evidence: `backend/modules/synthesizer.py`)
- Intent translation → Token tracking: records usage (evidence: `backend/modules/intent_translator.py`)
- Follow-up answers → Token tracking: records usage (evidence: `backend/modules/followup.py`)
- Web interface → Intent translation: sends feedback
- Web interface → Follow-up answers: asks questions
- Flask server → Conversation state: manages sessions
- Flask server → Research database: stores research state
