# abinbyanjankar-hellrider/nepse-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/abinbyanjankar-hellrider/nepse-dashboard
- Repository: https://github.com/abinbyanjankar-hellrider/nepse-dashboard

## Overview

This repository is a NEPSE market-analysis dashboard with a daily data-ingestion and verification workflow plus optional local intraday updates. The main user path is opening the dashboard to view official closes, market summaries, prices, heatmaps, RRG analysis and verification; during market hours, a local live process can supply provisional views. The graph preserves README-described capabilities, but the sampled excerpts do not expose the dashboard’s internal JavaScript wiring or the macro-data implementation, so those connections are limited to documented behavior.

Main entry points: [`scripts/market_views.py`](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/market_views.py) (Heatmap and RRG), [`scripts/fetch_nepse.py`](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/fetch_nepse.py) (Close and prices), [`scripts/verify_daily.py`](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/verify_daily.py) (Daily verification), [`index.html`](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/index.html) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Dashboard UI<br/>[index.html]"]
end

subgraph group_daily["Daily data"]
  node_daily_runner["Daily orchestrator<br/>[run_daily.py]"]
  node_fetch["Close and prices<br/>[fetch_nepse.py]"]
  node_verify["Daily verification<br/>[verify_daily.py]"]
  node_validate["Data validation<br/>[validate_data.py]"]
  node_live["Intraday updater<br/>[live_intraday.py]"]
end

subgraph group_analysis["Market analysis"]
  node_views["Heatmap and RRG<br/>[market_views.py]"]
end

subgraph group_storage["Stored data"]
  node_latest["Latest snapshot<br/>[latest.json]"]
  node_views_store["Market views<br/>[market_views.json]"]
  node_live_store["Live snapshots"]
  node_live_views["Live views"]
  node_index_history[("Index history<br/>[index.csv]")]
  node_price_history[("Price history")]
  node_stock_history[("Stock histories")]
  node_sector_history[("Sector histories")]
  node_rrg_history[("RRG snapshots")]
  node_check_reports[("Check reports")]
end

node_visitor(("Dashboard user"))
node_sharesansar["ShareSansar"]
node_merolagani["MeroLagani"]
node_claude["Claude API"]
node_nrb["NRB macro data"]

node_visitor -->|"opens"| node_dashboard_ui
node_dashboard_ui -->|"reads snapshot"| node_latest
node_dashboard_ui -->|"reads views"| node_views_store
node_dashboard_ui -.->|"shows macro data"| node_nrb
node_daily_runner -->|"runs"| node_fetch
node_daily_runner -->|"runs"| node_views
node_daily_runner -->|"runs"| node_verify
node_daily_runner -->|"runs"| node_validate
node_fetch -->|"fetches prices"| node_sharesansar
node_fetch -->|"reads index"| node_merolagani
node_fetch -.->|"fallback lookup"| node_claude
node_fetch -->|"writes snapshot"| node_latest
node_fetch -->|"writes daily prices"| node_price_history
node_fetch -->|"updates index"| node_index_history
node_views -->|"fetches histories"| node_merolagani
node_views -->|"reads index"| node_index_history
node_views -->|"updates histories"| node_stock_history
node_views -->|"updates histories"| node_sector_history
node_views -->|"reads turnover"| node_latest
node_views -->|"writes views"| node_views_store
node_views -->|"archives snapshot"| node_rrg_history
node_verify -->|"reads and updates"| node_latest
node_verify -->|"reads history"| node_index_history
node_verify -->|"reads prior prices"| node_price_history
node_verify -->|"checks updates"| node_sector_history
node_verify -->|"compares snapshots"| node_rrg_history
node_verify -->|"writes report"| node_check_reports
node_validate -->|"checks payload"| node_latest
node_validate -->|"checks views"| node_views_store
node_validate -->|"checks history"| node_index_history
node_validate -->|"checks embedded data"| node_dashboard_ui
node_live -->|"polls market"| node_sharesansar
node_live -->|"builds provisional views"| node_views
node_live -->|"reads prior close"| node_latest
node_live -->|"writes provisional data"| node_live_store
node_live -->|"writes provisional views"| node_live_views
node_dashboard_ui -.->|"polls live data"| node_live_store
node_dashboard_ui -.->|"uses live views"| node_live_views

click node_dashboard_ui "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/index.html"
click node_daily_runner "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/run_daily.py"
click node_fetch "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/fetch_nepse.py"
click node_views "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/market_views.py"
click node_verify "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/verify_daily.py"
click node_validate "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/validate_data.py"
click node_live "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/live_intraday.py"
click node_latest "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/data/latest.json"
click node_views_store "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/data/market_views.json"
click node_index_history "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/data/history/index.csv"
click node_price_history "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/prices"
click node_stock_history "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/stocks"
click node_sector_history "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/sectors"
click node_rrg_history "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/rrg"
click node_check_reports "https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/checks"

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_ui,node_visitor toneBlue
class node_daily_runner,node_fetch,node_verify,node_validate,node_live toneAmber
class node_views,node_claude toneMint
class node_latest,node_views_store,node_live_store,node_live_views,node_index_history,node_price_history,node_stock_history,node_sector_history,node_rrg_history,node_check_reports toneRose
class node_sharesansar,node_merolagani,node_nrb toneIndigo
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/index.html): `index.html`

### Daily data

- [Daily orchestrator](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/run_daily.py): `scripts/run_daily.py`
- [Close and prices](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/fetch_nepse.py): `scripts/fetch_nepse.py`
- [Daily verification](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/verify_daily.py): `scripts/verify_daily.py`
- [Data validation](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/validate_data.py): `scripts/validate_data.py`
- [Intraday updater](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/live_intraday.py): `scripts/live_intraday.py`

### Market analysis

- [Heatmap and RRG](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/scripts/market_views.py): `scripts/market_views.py`

### Stored data

- [Latest snapshot](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/data/latest.json): `data/latest.json`
- [Market views](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/data/market_views.json): `data/market_views.json`
- **Live snapshots**
- **Live views**
- [Index history](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/blob/main/data/history/index.csv): `data/history/index.csv`
- [Price history](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/prices): `data/history/prices`
- [Stock histories](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/stocks): `data/history/stocks`
- [Sector histories](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/sectors): `data/history/sectors`
- [RRG snapshots](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/rrg): `data/history/rrg`
- [Check reports](https://github.com/abinbyanjankar-hellrider/nepse-dashboard/tree/main/data/history/checks): `data/history/checks`

### Other components

- **Dashboard user**
- **ShareSansar**
- **MeroLagani**
- **Claude API**
- **NRB macro data**

## Connections

- Dashboard user → Dashboard UI: opens
- Dashboard UI → Latest snapshot: reads snapshot
- Dashboard UI → Market views: reads views
- Dashboard UI → NRB macro data: shows macro data
- Daily orchestrator → Close and prices: runs
- Daily orchestrator → Heatmap and RRG: runs
- Daily orchestrator → Daily verification: runs
- Daily orchestrator → Data validation: runs
- Close and prices → ShareSansar: fetches prices
- Close and prices → MeroLagani: reads index
- Close and prices → Claude API: fallback lookup
- Close and prices → Latest snapshot: writes snapshot
- Close and prices → Price history: writes daily prices
- Close and prices → Index history: updates index
- Heatmap and RRG → MeroLagani: fetches histories
- Heatmap and RRG → Index history: reads index
- Heatmap and RRG → Stock histories: updates histories
- Heatmap and RRG → Sector histories: updates histories
- Heatmap and RRG → Latest snapshot: reads turnover
- Heatmap and RRG → Market views: writes views
- Heatmap and RRG → RRG snapshots: archives snapshot
- Daily verification → Latest snapshot: reads and updates
- Daily verification → Index history: reads history
- Daily verification → Price history: reads prior prices
- Daily verification → Sector histories: checks updates
- Daily verification → RRG snapshots: compares snapshots
- Daily verification → Check reports: writes report
- Data validation → Latest snapshot: checks payload
- Data validation → Market views: checks views
- Data validation → Index history: checks history
- Data validation → Dashboard UI: checks embedded data
- Intraday updater → ShareSansar: polls market
- Intraday updater → Heatmap and RRG: builds provisional views
- Intraday updater → Latest snapshot: reads prior close
- Intraday updater → Live snapshots: writes provisional data
- Intraday updater → Live views: writes provisional views
- Dashboard UI → Live snapshots: polls live data
- Dashboard UI → Live views: uses live views
