# starsgiri/final_bda_project- architecture

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

- Interactive diagram: https://gitdiagram.com/starsgiri/final_bda_project-
- Repository: https://github.com/starsgiri/final_bda_project-

## Overview

Heart Disease Tracker is a Streamlit application for collecting health indicators and displaying machine-learning risk assessments, with Gemini-generated personalized guidance as an optional capability. The repository contains two substantial app scripts; the graph keeps their workflows distinct rather than assuming they call one another. Sampled excerpts show form capture, Spark prediction, and AI-generation behavior, but omit some orchestration details and model-path configuration, so uncertain links to stored models are dashed and unverified.

Main entry points: [`web-apps/Streamlet_app1.py`](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py) (Risk prediction), [`web-apps/app.py`](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py) (Risk prediction), [`models/model1(79)`](https://github.com/starsgiri/final_bda_project-/tree/main/models/model1(79)) (GBT pipeline), [`models/model2/v2_dataset`](https://github.com/starsgiri/final_bda_project-/tree/main/models/model2/v2_dataset) (Logistic pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app1["Prediction app"]
  node_prediction_ui["Assessment interface<br/>[Streamlet_app1.py]"]
  node_prediction_prep["Input preparation<br/>[Streamlet_app1.py]"]
  node_prediction_engine["Risk prediction<br/>[Streamlet_app1.py]"]
  node_prediction_results["Risk results<br/>[Streamlet_app1.py]"]
  node_prediction_guidance["Health suggestions<br/>[Streamlet_app1.py]"]
end

subgraph group_app2["CardioAI app"]
  node_cardio_ui["CardioAI interface<br/>[app.py]"]
  node_cardio_prep["Input preparation<br/>[app.py]"]
  node_cardio_engine["Risk prediction<br/>[app.py]"]
  node_cardio_results["Risk results<br/>[app.py]"]
  node_cardio_guidance["AI insights<br/>[app.py]"]
end

subgraph group_runtime["ML and AI runtime"]
  node_spark["Spark runtime<br/>[Streamlet_app1.py]"]
  node_model1["GBT pipeline"]
  node_model2["Logistic pipeline"]
  node_gemini{{"Gemini API"}}
end

node_user(("User"))

node_user -->|"enters health data"| node_prediction_ui
node_prediction_ui -->|"submits inputs"| node_prediction_prep
node_prediction_prep -->|"builds features"| node_prediction_engine
node_prediction_engine -->|"creates DataFrame"| node_spark
node_prediction_engine -.->|"loads pipeline"| node_model1
node_prediction_engine -.->|"loads pipeline"| node_model2
node_prediction_engine -->|"produces risk"| node_prediction_results
node_prediction_results -.->|"requests suggestions"| node_prediction_guidance
node_prediction_guidance -->|"generates guidance"| node_gemini
node_user -->|"enters health data"| node_cardio_ui
node_cardio_ui -->|"collects indicators"| node_cardio_prep
node_cardio_prep -->|"builds inputs"| node_cardio_engine
node_cardio_engine -->|"creates DataFrame"| node_spark
node_cardio_engine -->|"runs transform"| node_cardio_results
node_cardio_results -.->|"requests insights"| node_cardio_guidance
node_cardio_guidance -->|"generates insights"| node_gemini

click node_prediction_ui "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py"
click node_prediction_prep "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py"
click node_prediction_engine "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py"
click node_prediction_results "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py"
click node_prediction_guidance "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py"
click node_cardio_ui "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py"
click node_cardio_prep "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py"
click node_cardio_engine "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py"
click node_cardio_results "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py"
click node_cardio_guidance "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py"
click node_spark "https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py"
click node_model1 "https://github.com/starsgiri/final_bda_project-/tree/main/models/model1(79)"
click node_model2 "https://github.com/starsgiri/final_bda_project-/tree/main/models/model2/v2_dataset"

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_prediction_ui,node_prediction_prep,node_prediction_engine,node_prediction_results,node_prediction_guidance,node_user toneBlue
class node_cardio_ui,node_cardio_prep,node_cardio_engine,node_cardio_results,node_cardio_guidance toneAmber
class node_spark,node_model1,node_model2,node_gemini toneMint
```

## Components

### Prediction app

- [Assessment interface](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py): `web-apps/Streamlet_app1.py`
- [Input preparation](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py): `web-apps/Streamlet_app1.py`
- [Risk prediction](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py): `web-apps/Streamlet_app1.py`
- [Risk results](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py): `web-apps/Streamlet_app1.py`
- [Health suggestions](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py): `web-apps/Streamlet_app1.py`

### CardioAI app

- [CardioAI interface](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py): `web-apps/app.py`
- [Input preparation](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py): `web-apps/app.py`
- [Risk prediction](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py): `web-apps/app.py`
- [Risk results](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py): `web-apps/app.py`
- [AI insights](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/app.py): `web-apps/app.py`

### ML and AI runtime

- [Spark runtime](https://github.com/starsgiri/final_bda_project-/blob/main/web-apps/Streamlet_app1.py): `web-apps/Streamlet_app1.py`
- [GBT pipeline](https://github.com/starsgiri/final_bda_project-/tree/main/models/model1(79)): `models/model1(79)`
- [Logistic pipeline](https://github.com/starsgiri/final_bda_project-/tree/main/models/model2/v2_dataset): `models/model2/v2_dataset`
- **Gemini API**

### Other components

- **User**

## Connections

- User → Assessment interface: enters health data (evidence: `web-apps/Streamlet_app1.py`)
- Assessment interface → Input preparation: submits inputs (evidence: `web-apps/Streamlet_app1.py`)
- Input preparation → Risk prediction: builds features (evidence: `web-apps/Streamlet_app1.py`)
- Risk prediction → Spark runtime: creates DataFrame (evidence: `web-apps/Streamlet_app1.py`)
- Risk prediction → GBT pipeline: loads pipeline
- Risk prediction → Logistic pipeline: loads pipeline
- Risk prediction → Risk results: produces risk (evidence: `web-apps/Streamlet_app1.py`)
- Risk results → Health suggestions: requests suggestions (evidence: `web-apps/Streamlet_app1.py`)
- Health suggestions → Gemini API: generates guidance (evidence: `web-apps/Streamlet_app1.py`)
- User → CardioAI interface: enters health data (evidence: `web-apps/app.py`)
- CardioAI interface → Input preparation: collects indicators (evidence: `web-apps/app.py`)
- Input preparation → Risk prediction: builds inputs (evidence: `web-apps/app.py`)
- Risk prediction → Spark runtime: creates DataFrame (evidence: `web-apps/app.py`)
- Risk prediction → Risk results: runs transform (evidence: `web-apps/app.py`)
- Risk results → AI insights: requests insights (evidence: `web-apps/app.py`)
- AI insights → Gemini API: generates insights (evidence: `web-apps/app.py`)
