# samsraina/rene architecture

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

- Interactive diagram: https://gitdiagram.com/samsraina/rene
- Repository: https://github.com/samsraina/rene

## Overview

ReMediX is a drug-repurposing analysis web app. Users search for a compound by name or SMILES, inspect its PubChem profile and ChEMBL bioactivity, then compare its targets with a disease signature to view therapeutic scoring results. The API also exposes DrugBank lookup, CREEDS gene matching, gene-expression data, and PPI Excel browsing. The map follows documented capabilities and sampled calls; unsampled route wiring is shown only where README or excerpts support it.

Main entry points: [`src/routers/api_handlers.py`](https://github.com/samsraina/rene/blob/developement/src/routers/api_handlers.py) (Endpoint handlers), [`frontend/src/App.tsx`](https://github.com/samsraina/rene/blob/developement/frontend/src/App.tsx) (React app routes), [`frontend/src/lib/api.ts`](https://github.com/samsraina/rene/blob/developement/frontend/src/lib/api.ts) (API client), [`src/data`](https://github.com/samsraina/rene/tree/developement/src/data) (Provisioned datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["React app routes<br/>[App.tsx]"]
  node_home["Compound search<br/>[HomePage.tsx]"]
  node_gene_match_ui["Gene matching<br/>[GeneMatchPage.tsx]"]
  node_results_ui["Scoring results"]
  node_data_ui["Data browsers"]
  node_frontend_api["API client<br/>[api.ts]"]
end

subgraph group_api["API layer"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_routes["API routes<br/>[api.py]"]
  node_handlers["Endpoint handlers<br/>[api_handlers.py]"]
  node_availability["Dataset checks"]
end

subgraph group_analysis["Analysis and data"]
  node_creeds["Disease signatures<br/>[creeds_client.py]"]
  node_scoring["Therapeutic scoring<br/>[remedix_scoring.py]"]
  node_gene_scores["Gene and PPI data"]
  node_local_data[("Provisioned datasets")]
end

subgraph group_integrations["Data integrations"]
  node_chembl["Bioactivity and targets<br/>[chembl_client.py]"]
  node_pubchem["Compound lookup<br/>[pubchem_client.py]"]
  node_drugbank["DrugBank lookup<br/>[drugbank_client.py]"]
end

node_user(("Researcher"))
node_pubchem_service["PubChem"]
node_chembl_service["ChEMBL"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_gene_match_ui
node_app -->|"routes to"| node_results_ui
node_app -->|"routes to"| node_data_ui
node_home -->|"requests data"| node_frontend_api
node_gene_match_ui -->|"requests data"| node_frontend_api
node_results_ui -->|"requests data"| node_frontend_api
node_data_ui -->|"requests data"| node_frontend_api
node_frontend_api -->|"calls API"| node_fastapi
node_fastapi -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_handlers
node_handlers -->|"looks up compounds"| node_pubchem
node_pubchem -->|"queries"| node_pubchem_service
node_handlers -->|"fetches bioactivity"| node_chembl
node_chembl -->|"queries"| node_chembl_service
node_handlers -->|"searches drugs"| node_drugbank
node_handlers -->|"calculates score"| node_scoring
node_scoring -->|"uses targets"| node_chembl
node_scoring -->|"loads disease consensus"| node_creeds
node_handlers -->|"matches genes"| node_creeds
node_handlers -->|"loads gene and PPI data"| node_gene_scores
node_handlers -->|"checks datasets"| node_availability
node_availability -->|"checks presence"| node_local_data
node_creeds -->|"reads signatures"| node_local_data
node_drugbank -->|"reads XML"| node_local_data
node_gene_scores -->|"reads spreadsheets"| node_local_data

click node_app "https://github.com/samsraina/rene/blob/developement/frontend/src/App.tsx"
click node_home "https://github.com/samsraina/rene/blob/developement/frontend/src/pages/HomePage.tsx"
click node_gene_match_ui "https://github.com/samsraina/rene/blob/developement/frontend/src/pages/GeneMatchPage.tsx"
click node_results_ui "https://github.com/samsraina/rene/blob/developement/frontend/src/pages/ScoringResultsPage.tsx"
click node_data_ui "https://github.com/samsraina/rene/blob/developement/frontend/src/pages/GeneExpressionsPage.tsx"
click node_frontend_api "https://github.com/samsraina/rene/blob/developement/frontend/src/lib/api.ts"
click node_fastapi "https://github.com/samsraina/rene/blob/developement/main.py"
click node_routes "https://github.com/samsraina/rene/blob/developement/src/routers/api.py"
click node_handlers "https://github.com/samsraina/rene/blob/developement/src/routers/api_handlers.py"
click node_availability "https://github.com/samsraina/rene/blob/developement/src/data_availability.py"
click node_chembl "https://github.com/samsraina/rene/blob/developement/src/clients/chembl_client.py"
click node_pubchem "https://github.com/samsraina/rene/blob/developement/src/clients/pubchem_client.py"
click node_drugbank "https://github.com/samsraina/rene/blob/developement/src/clients/drugbank_client.py"
click node_creeds "https://github.com/samsraina/rene/blob/developement/src/clients/creeds_client.py"
click node_scoring "https://github.com/samsraina/rene/blob/developement/src/utils/remedix_scoring.py"
click node_gene_scores "https://github.com/samsraina/rene/blob/developement/src/utils/final_gene_score.py"
click node_local_data "https://github.com/samsraina/rene/tree/developement/src/data"

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_app,node_home,node_gene_match_ui,node_results_ui,node_data_ui,node_frontend_api toneBlue
class node_fastapi,node_routes,node_handlers,node_availability toneAmber
class node_creeds,node_scoring,node_gene_scores,node_local_data toneMint
class node_chembl,node_pubchem,node_drugbank toneRose
class node_user,node_pubchem_service,node_chembl_service toneIndigo
```

## Components

### Web interface

- [React app routes](https://github.com/samsraina/rene/blob/developement/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Compound search](https://github.com/samsraina/rene/blob/developement/frontend/src/pages/HomePage.tsx): `frontend/src/pages/HomePage.tsx`
- [Gene matching](https://github.com/samsraina/rene/blob/developement/frontend/src/pages/GeneMatchPage.tsx): `frontend/src/pages/GeneMatchPage.tsx`
- [Scoring results](https://github.com/samsraina/rene/blob/developement/frontend/src/pages/ScoringResultsPage.tsx): `frontend/src/pages/ScoringResultsPage.tsx`
- [Data browsers](https://github.com/samsraina/rene/blob/developement/frontend/src/pages/GeneExpressionsPage.tsx): `frontend/src/pages/GeneExpressionsPage.tsx`
- [API client](https://github.com/samsraina/rene/blob/developement/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API layer

- [FastAPI app](https://github.com/samsraina/rene/blob/developement/main.py): `main.py`
- [API routes](https://github.com/samsraina/rene/blob/developement/src/routers/api.py): `src/routers/api.py`
- [Endpoint handlers](https://github.com/samsraina/rene/blob/developement/src/routers/api_handlers.py): `src/routers/api_handlers.py`
- [Dataset checks](https://github.com/samsraina/rene/blob/developement/src/data_availability.py): `src/data_availability.py`

### Analysis and data

- [Disease signatures](https://github.com/samsraina/rene/blob/developement/src/clients/creeds_client.py): `src/clients/creeds_client.py`
- [Therapeutic scoring](https://github.com/samsraina/rene/blob/developement/src/utils/remedix_scoring.py): `src/utils/remedix_scoring.py`
- [Gene and PPI data](https://github.com/samsraina/rene/blob/developement/src/utils/final_gene_score.py): `src/utils/final_gene_score.py`
- [Provisioned datasets](https://github.com/samsraina/rene/tree/developement/src/data): `src/data`

### Data integrations

- [Bioactivity and targets](https://github.com/samsraina/rene/blob/developement/src/clients/chembl_client.py): `src/clients/chembl_client.py`
- [Compound lookup](https://github.com/samsraina/rene/blob/developement/src/clients/pubchem_client.py): `src/clients/pubchem_client.py`
- [DrugBank lookup](https://github.com/samsraina/rene/blob/developement/src/clients/drugbank_client.py): `src/clients/drugbank_client.py`

### Other components

- **Researcher**
- **PubChem**
- **ChEMBL**

## Connections

- Researcher → React app routes: uses
- React app routes → Compound search: routes to
- React app routes → Gene matching: routes to
- React app routes → Scoring results: routes to
- React app routes → Data browsers: routes to
- Compound search → API client: requests data
- Gene matching → API client: requests data
- Scoring results → API client: requests data
- Data browsers → API client: requests data
- API client → FastAPI app: calls API
- FastAPI app → API routes: mounts
- API routes → Endpoint handlers: dispatches
- Endpoint handlers → Compound lookup: looks up compounds
- Compound lookup → PubChem: queries
- Endpoint handlers → Bioactivity and targets: fetches bioactivity
- Bioactivity and targets → ChEMBL: queries
- Endpoint handlers → DrugBank lookup: searches drugs
- Endpoint handlers → Therapeutic scoring: calculates score
- Therapeutic scoring → Bioactivity and targets: uses targets
- Therapeutic scoring → Disease signatures: loads disease consensus
- Endpoint handlers → Disease signatures: matches genes
- Endpoint handlers → Gene and PPI data: loads gene and PPI data
- Endpoint handlers → Dataset checks: checks datasets
- Dataset checks → Provisioned datasets: checks presence
- Disease signatures → Provisioned datasets: reads signatures
- DrugBank lookup → Provisioned datasets: reads XML
- Gene and PPI data → Provisioned datasets: reads spreadsheets
