# abdulhanshad/khair_project architecture

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

- Interactive diagram: https://gitdiagram.com/abdulhanshad/khair_project
- Repository: https://github.com/abdulhanshad/khair_project

## Overview

Khair is a read-only Streamlit dashboard for a group fund. Members view a dashboard built from the published Google Sheet, which is fetched when a session opens or when they refresh. The app summarizes collections and unpaid months, estimates gold P/L, and offers report/image downloads and editable WhatsApp reminder drafts. The sampled source is partial and concentrates on one large app file, so the graph treats its features as responsibilities within that file; relationships documented only in the README are cited there.

Main entry points: [`app.py`](https://github.com/abdulhanshad/khair_project/blob/main/app.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Dashboard runtime"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_sheet_loader["Sheet data loading<br/>[app.py]"]
end

subgraph group_analysis["Fund insights"]
  node_fund_summary["Fund summary<br/>[app.py]"]
  node_unpaid_ranking["Unpaid month ranking<br/>[app.py]"]
  node_gold_estimates["Gold P/L estimates<br/>[app.py]"]
end

subgraph group_outputs["Member outputs"]
  node_reports["Reports and image<br/>[app.py]"]
  node_reminder_drafts["WhatsApp reminder drafts<br/>[app.py]"]
end

node_viewer(("Dashboard viewer"))
node_published_sheet[("Published Google Sheet CSV")]
node_rate_source["Bahrain reference rates"]
node_whatsapp["WhatsApp review"]

node_viewer -->|"opens"| node_dashboard
node_dashboard -->|"loads or refreshes"| node_sheet_loader
node_sheet_loader -->|"fetches CSV"| node_published_sheet
node_dashboard -->|"shows"| node_fund_summary
node_dashboard -->|"ranks members"| node_unpaid_ranking
node_dashboard -->|"estimates P/L"| node_gold_estimates
node_gold_estimates -->|"uses rates"| node_rate_source
node_dashboard -->|"offers downloads"| node_reports
node_dashboard -->|"prepares drafts"| node_reminder_drafts
node_reminder_drafts -->|"opens for review"| node_whatsapp

click node_dashboard "https://github.com/abdulhanshad/khair_project/blob/main/app.py"
click node_sheet_loader "https://github.com/abdulhanshad/khair_project/blob/main/app.py"
click node_fund_summary "https://github.com/abdulhanshad/khair_project/blob/main/app.py"
click node_unpaid_ranking "https://github.com/abdulhanshad/khair_project/blob/main/app.py"
click node_gold_estimates "https://github.com/abdulhanshad/khair_project/blob/main/app.py"
click node_reports "https://github.com/abdulhanshad/khair_project/blob/main/app.py"
click node_reminder_drafts "https://github.com/abdulhanshad/khair_project/blob/main/app.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_dashboard,node_sheet_loader,node_viewer,node_whatsapp toneBlue
class node_fund_summary,node_unpaid_ranking,node_gold_estimates,node_published_sheet toneAmber
class node_reports,node_reminder_drafts toneMint
class node_rate_source toneIndigo
```

## Components

### Dashboard runtime

- [Streamlit dashboard](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`
- [Sheet data loading](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`

### Fund insights

- [Fund summary](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`
- [Unpaid month ranking](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`
- [Gold P/L estimates](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`

### Member outputs

- [Reports and image](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`
- [WhatsApp reminder drafts](https://github.com/abdulhanshad/khair_project/blob/main/app.py): `app.py`

### Other components

- **Dashboard viewer**
- **Published Google Sheet CSV**
- **Bahrain reference rates**
- **WhatsApp review**

## Connections

- Dashboard viewer → Streamlit dashboard: opens (evidence: `README.md`)
- Streamlit dashboard → Sheet data loading: loads or refreshes (evidence: `app.py`)
- Sheet data loading → Published Google Sheet CSV: fetches CSV (evidence: `app.py`)
- Streamlit dashboard → Fund summary: shows (evidence: `README.md`)
- Streamlit dashboard → Unpaid month ranking: ranks members (evidence: `README.md`)
- Streamlit dashboard → Gold P/L estimates: estimates P/L (evidence: `app.py`)
- Gold P/L estimates → Bahrain reference rates: uses rates (evidence: `README.md`)
- Streamlit dashboard → Reports and image: offers downloads (evidence: `README.md`)
- Streamlit dashboard → WhatsApp reminder drafts: prepares drafts (evidence: `README.md`)
- WhatsApp reminder drafts → WhatsApp review: opens for review (evidence: `app.py`)
