# mgoldenitz/mental-health-trials-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/mgoldenitz/mental-health-trials-pipeline
- Repository: https://github.com/mgoldenitz/mental-health-trials-pipeline

## Overview

This repository analyzes ClinicalTrials.gov mental-health interventional trials and presents the findings in a Power BI report and a searchable Streamlit app. The main workflow runs from registry data through condition grouping and cleaned tables, then into descriptive analysis and dashboards; a separate notebook covers machine learning and topic trends. The README documents these capabilities, while only app.py was sampled, so links for unsampled analysis and dashboard internals are limited to documented relationships.

Main entry points: [`01_trials_pipeline.ipynb`](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/01_trials_pipeline.ipynb) (Trials pipeline), [`data/powerbi`](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/powerbi) (Dashboard tables), [`app.py`](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/app.py) (Interactive tracker), [`02_machine_learning.ipynb`](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/02_machine_learning.ipynb) (Machine learning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Data pipeline"]
  node_pipeline_nb["Trials pipeline"]
  node_clean_data["Clean trial tables"]
  node_powerbi_data["Dashboard tables"]
end

subgraph group_analysis["Analysis"]
  node_ml_nb["Machine learning"]
  node_sql_analysis["Trial analyses"]
  node_analysis_results["Analysis results"]
  node_ml_results["ML results"]
end

subgraph group_products["User-facing products"]
  node_powerbi["Power BI report"]
  node_streamlit["Interactive tracker<br/>[app.py]"]
  node_app_data["Tracker input tables"]
end

node_registry(("ClinicalTrials.gov"))
node_visitor(("Dashboard user"))

node_registry -->|"provides trials"| node_pipeline_nb
node_pipeline_nb -.->|"prepares tables"| node_clean_data
node_pipeline_nb -->|"exports tables"| node_powerbi_data
node_sql_analysis -.->|"summarizes trials"| node_analysis_results
node_ml_nb -->|"produces findings"| node_ml_results
node_powerbi_data -->|"feeds report"| node_powerbi
node_powerbi_data -->|"loads tables"| node_streamlit
node_visitor -->|"searches trials"| node_streamlit

click node_pipeline_nb "https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/01_trials_pipeline.ipynb"
click node_clean_data "https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/clean"
click node_powerbi_data "https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/powerbi"
click node_ml_nb "https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/02_machine_learning.ipynb"
click node_sql_analysis "https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/sql"
click node_analysis_results "https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/results"
click node_ml_results "https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/results/ml"
click node_powerbi "https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/Goldenitz_Mental_Health_Trials_Dashboard.pbix"
click node_streamlit "https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/app.py"
click node_app_data "https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/powerbi"

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_pipeline_nb,node_clean_data,node_powerbi_data,node_visitor toneBlue
class node_ml_nb,node_sql_analysis,node_analysis_results,node_ml_results toneAmber
class node_powerbi,node_streamlit,node_app_data toneMint
class node_registry toneIndigo
```

## Components

### Data pipeline

- [Trials pipeline](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/01_trials_pipeline.ipynb): `01_trials_pipeline.ipynb`
- [Clean trial tables](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/clean): `data/clean`
- [Dashboard tables](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/powerbi): `data/powerbi`

### Analysis

- [Machine learning](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/02_machine_learning.ipynb): `02_machine_learning.ipynb`
- [Trial analyses](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/sql): `sql`
- [Analysis results](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/results): `results`
- [ML results](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/results/ml): `results/ml`

### User-facing products

- [Power BI report](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/Goldenitz_Mental_Health_Trials_Dashboard.pbix): `Goldenitz_Mental_Health_Trials_Dashboard.pbix`
- [Interactive tracker](https://github.com/mgoldenitz/mental-health-trials-pipeline/blob/main/app.py): `app.py`
- [Tracker input tables](https://github.com/mgoldenitz/mental-health-trials-pipeline/tree/main/data/powerbi): `data/powerbi`

### Other components

- **ClinicalTrials.gov**
- **Dashboard user**

## Connections

- ClinicalTrials.gov → Trials pipeline: provides trials (evidence: `README.md`)
- Trials pipeline → Clean trial tables: prepares tables
- Trials pipeline → Dashboard tables: exports tables (evidence: `README.md`)
- Trial analyses → Analysis results: summarizes trials
- Machine learning → ML results: produces findings (evidence: `README.md`)
- Dashboard tables → Power BI report: feeds report (evidence: `README.md`)
- Dashboard tables → Interactive tracker: loads tables (evidence: `app.py`)
- Dashboard user → Interactive tracker: searches trials (evidence: `README.md`)
