# yusramuzaibp/nexusquartz architecture

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

- Interactive diagram: https://gitdiagram.com/yusramuzaibp/nexusquartz
- Repository: https://github.com/yusramuzaibp/nexusquartz

## Overview

This is a Streamlit patient-facing app for diabetes, heart-disease, and Parkinson’s risk predictions, with accounts, saved prediction history, a dashboard, specialist-finding navigation, and a health assistant. The principal workflow is patient input → range checks → disease-specific model inference → displayed result and saved record; users can later review or export prior records. The main app excerpt is partial, so some page wiring and specialist-search implementation are not shown; the graph includes only supported connections and leaves those details within the app node.

Main entry points: [`multiple_disease_pred1.py`](https://github.com/yusramuzaibp/nexusquartz/blob/main/multiple_disease_pred1.py) (Streamlit app), [`chatbot_snippet.py`](https://github.com/yusramuzaibp/nexusquartz/blob/main/chatbot_snippet.py) (Assistant page), [`auth/authentication.py`](https://github.com/yusramuzaibp/nexusquartz/blob/main/auth/authentication.py) (Authentication), [`database/database.py`](https://github.com/yusramuzaibp/nexusquartz/blob/main/database/database.py) (Prediction records API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Patient workflow"]
  node_app["Streamlit app"]
  node_dashboard["Activity dashboard<br/>[dashboard.py]"]
end

subgraph group_prediction["Risk prediction"]
  node_validation["Range checks<br/>[validation.py]"]
  node_diabetes_model["Diabetes model<br/>[diabetes_model.sav]"]
  node_heart_model["Heart model"]
  node_parkinsons_model["Parkinson’s model"]
end

subgraph group_records["Accounts and records"]
  node_auth["Authentication<br/>[authentication.py]"]
  node_db_api["Prediction records API<br/>[database.py]"]
  node_user_db[("SQLite records<br/>[users.db]")]
end

subgraph group_assistant["Health assistant"]
  node_assistant_page["Assistant page<br/>[chatbot_snippet.py]"]
  node_keyword_bot["Keyword replies<br/>[chatbot_snippet.py]"]
end

node_patient(("Patient"))
node_gemini{{"Gemini API"}}

node_patient -->|"enters input"| node_app
node_app -->|"checks ranges"| node_validation
node_app -->|"loads and predicts"| node_diabetes_model
node_app -->|"loads and predicts"| node_heart_model
node_app -->|"loads and predicts"| node_parkinsons_model
node_app -->|"authenticates"| node_auth
node_auth -->|"reads and writes users"| node_user_db
node_app -->|"saves and retrieves history"| node_db_api
node_db_api -->|"reads and writes predictions"| node_user_db
node_app -->|"renders assistant"| node_assistant_page
node_assistant_page -->|"requests fallback reply"| node_keyword_bot
node_assistant_page -.->|"requests generated reply"| node_gemini

click node_app "https://github.com/yusramuzaibp/nexusquartz/blob/main/multiple_disease_pred1.py"
click node_dashboard "https://github.com/yusramuzaibp/nexusquartz/blob/main/dashboard.py"
click node_validation "https://github.com/yusramuzaibp/nexusquartz/blob/main/utils/validation.py"
click node_diabetes_model "https://github.com/yusramuzaibp/nexusquartz/blob/main/saved_models/diabetes_model.sav"
click node_heart_model "https://github.com/yusramuzaibp/nexusquartz/blob/main/saved_models/heart_disease_model.sav"
click node_parkinsons_model "https://github.com/yusramuzaibp/nexusquartz/blob/main/saved_models/parkinsons_model.sav"
click node_auth "https://github.com/yusramuzaibp/nexusquartz/blob/main/auth/authentication.py"
click node_db_api "https://github.com/yusramuzaibp/nexusquartz/blob/main/database/database.py"
click node_user_db "https://github.com/yusramuzaibp/nexusquartz/blob/main/users.db"
click node_assistant_page "https://github.com/yusramuzaibp/nexusquartz/blob/main/chatbot_snippet.py"
click node_keyword_bot "https://github.com/yusramuzaibp/nexusquartz/blob/main/chatbot_snippet.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_app,node_dashboard toneBlue
class node_validation,node_diabetes_model,node_heart_model,node_parkinsons_model toneAmber
class node_auth,node_db_api,node_user_db,node_gemini toneMint
class node_assistant_page,node_keyword_bot toneRose
class node_patient toneIndigo
```

## Components

### Patient workflow

- [Streamlit app](https://github.com/yusramuzaibp/nexusquartz/blob/main/multiple_disease_pred1.py): `multiple_disease_pred1.py`
- [Activity dashboard](https://github.com/yusramuzaibp/nexusquartz/blob/main/dashboard.py): `dashboard.py`

### Risk prediction

- [Range checks](https://github.com/yusramuzaibp/nexusquartz/blob/main/utils/validation.py): `utils/validation.py`
- [Diabetes model](https://github.com/yusramuzaibp/nexusquartz/blob/main/saved_models/diabetes_model.sav): `saved_models/diabetes_model.sav`
- [Heart model](https://github.com/yusramuzaibp/nexusquartz/blob/main/saved_models/heart_disease_model.sav): `saved_models/heart_disease_model.sav`
- [Parkinson’s model](https://github.com/yusramuzaibp/nexusquartz/blob/main/saved_models/parkinsons_model.sav): `saved_models/parkinsons_model.sav`

### Accounts and records

- [Authentication](https://github.com/yusramuzaibp/nexusquartz/blob/main/auth/authentication.py): `auth/authentication.py`
- [Prediction records API](https://github.com/yusramuzaibp/nexusquartz/blob/main/database/database.py): `database/database.py`
- [SQLite records](https://github.com/yusramuzaibp/nexusquartz/blob/main/users.db): `users.db`

### Health assistant

- [Assistant page](https://github.com/yusramuzaibp/nexusquartz/blob/main/chatbot_snippet.py): `chatbot_snippet.py`
- [Keyword replies](https://github.com/yusramuzaibp/nexusquartz/blob/main/chatbot_snippet.py): `chatbot_snippet.py`

### Other components

- **Patient**
- **Gemini API**

## Connections

- Patient → Streamlit app: enters input
- Streamlit app → Range checks: checks ranges
- Streamlit app → Diabetes model: loads and predicts
- Streamlit app → Heart model: loads and predicts
- Streamlit app → Parkinson’s model: loads and predicts
- Streamlit app → Authentication: authenticates
- Authentication → SQLite records: reads and writes users
- Streamlit app → Prediction records API: saves and retrieves history
- Prediction records API → SQLite records: reads and writes predictions
- Streamlit app → Assistant page: renders assistant
- Assistant page → Keyword replies: requests fallback reply
- Assistant page → Gemini API: requests generated reply
