# itsyebekhe/nabz architecture

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

- Interactive diagram: https://gitdiagram.com/itsyebekhe/nabz
- Repository: https://github.com/itsyebekhe/nabz

## Overview

نبض بازار is a static market-data service and dashboard for live currency, gold, coin, and oil prices, with historical archives, charts, and per-asset share pages. Its main workflow fetches and parses market data, updates price history, and publishes repository-backed outputs for users to view or retrieve. The sampled source confirms scraping and history writes, while the README documents the API and chart capabilities; unsampled orchestration and chart-generation links are left unverified.

Main entry points: [`fetch_rates.py`](https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py) (Rate fetcher), [`api`](https://github.com/itsyebekhe/nabz/tree/main/api) (History archives), [`charts`](https://github.com/itsyebekhe/nabz/tree/main/charts) (Trend charts), [`share`](https://github.com/itsyebekhe/nabz/tree/main/share) (Share pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_fetcher["Rate fetcher<br/>[fetch_rates.py]"]
  node_market_sources(("Market sources"))
  node_asset_parser["Asset extraction<br/>[fetch_rates.py]"]
  node_usd_calculation["USD conversion<br/>[fetch_rates.py]"]
end

subgraph group_history["Price history"]
  node_history_update["History updater<br/>[fetch_rates.py]"]
  node_history_api[("History archives")]
end

subgraph group_publishing["Published views"]
  node_chart_output["Trend charts"]
  node_share_pages["Share pages"]
  node_readme_view["Market dashboard<br/>[README.md]"]
end

subgraph group_access["User access"]
  node_market_api["Live market API<br/>[market.json]"]
end

node_scheduler(("Scheduled updater<br/>[fetch-rates.yml]"))
node_visitor(("Market-data user"))

node_scheduler -.->|"triggers"| node_fetcher
node_fetcher -->|"requests prices"| node_market_sources
node_fetcher -->|"fetches assets"| node_asset_parser
node_fetcher -->|"calculates USD"| node_usd_calculation
node_fetcher -->|"updates history"| node_history_update
node_history_update -->|"writes archives"| node_history_api
node_fetcher -.->|"publishes prices"| node_market_api
node_fetcher -.->|"generates charts"| node_chart_output
node_fetcher -.->|"generates pages"| node_share_pages
node_fetcher -.->|"updates dashboard"| node_readme_view
node_visitor -->|"reads prices"| node_market_api
node_visitor -->|"reads history"| node_history_api
node_visitor -->|"views trends"| node_chart_output
node_visitor -.->|"opens pages"| node_share_pages
node_visitor -->|"views rates"| node_readme_view

click node_scheduler "https://github.com/itsyebekhe/nabz/blob/main/.github/workflows/fetch-rates.yml"
click node_fetcher "https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py"
click node_asset_parser "https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py"
click node_usd_calculation "https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py"
click node_history_update "https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py"
click node_history_api "https://github.com/itsyebekhe/nabz/tree/main/api"
click node_market_api "https://github.com/itsyebekhe/nabz/blob/main/market.json"
click node_chart_output "https://github.com/itsyebekhe/nabz/tree/main/charts"
click node_share_pages "https://github.com/itsyebekhe/nabz/tree/main/share"
click node_readme_view "https://github.com/itsyebekhe/nabz/blob/main/README.md"

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_fetcher,node_market_sources,node_asset_parser,node_usd_calculation,node_visitor toneBlue
class node_history_update,node_history_api toneAmber
class node_chart_output,node_share_pages,node_readme_view toneMint
class node_market_api toneRose
class node_scheduler toneTeal
```

## Components

### Data collection

- [Rate fetcher](https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py): `fetch_rates.py`
- **Market sources**
- [Asset extraction](https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py): `fetch_rates.py`
- [USD conversion](https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py): `fetch_rates.py`

### Price history

- [History updater](https://github.com/itsyebekhe/nabz/blob/main/fetch_rates.py): `fetch_rates.py`
- [History archives](https://github.com/itsyebekhe/nabz/tree/main/api): `api`

### Published views

- [Trend charts](https://github.com/itsyebekhe/nabz/tree/main/charts): `charts`
- [Share pages](https://github.com/itsyebekhe/nabz/tree/main/share): `share`
- [Market dashboard](https://github.com/itsyebekhe/nabz/blob/main/README.md): `README.md`

### User access

- [Live market API](https://github.com/itsyebekhe/nabz/blob/main/market.json): `market.json`

### Other components

- [Scheduled updater](https://github.com/itsyebekhe/nabz/blob/main/.github/workflows/fetch-rates.yml): `.github/workflows/fetch-rates.yml`
- **Market-data user**

## Connections

- Scheduled updater → Rate fetcher: triggers
- Rate fetcher → Market sources: requests prices (evidence: `fetch_rates.py`)
- Rate fetcher → Asset extraction: fetches assets (evidence: `fetch_rates.py`)
- Rate fetcher → USD conversion: calculates USD (evidence: `fetch_rates.py`)
- Rate fetcher → History updater: updates history (evidence: `fetch_rates.py`)
- History updater → History archives: writes archives (evidence: `fetch_rates.py`)
- Rate fetcher → Live market API: publishes prices
- Rate fetcher → Trend charts: generates charts
- Rate fetcher → Share pages: generates pages
- Rate fetcher → Market dashboard: updates dashboard
- Market-data user → Live market API: reads prices (evidence: `README.md`)
- Market-data user → History archives: reads history (evidence: `README.md`)
- Market-data user → Trend charts: views trends (evidence: `README.md`)
- Market-data user → Share pages: opens pages
- Market-data user → Market dashboard: views rates (evidence: `README.md`)
