# prat3564/market-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/prat3564/market-dashboard
- Repository: https://github.com/prat3564/market-dashboard

## Overview

This is a serverless market dashboard: scheduled scraping refreshes US and Indian index datasets, while a browser dashboard displays those feeds alongside live metals and currency data. The scraper is a separate data-ingestion stage; the JSON files are its persisted output and the dashboard’s local-feed inputs. The graph preserves the documented automation, hosting, UI, and market-data branches. Some frontend calls and the workflow are shown only in excerpts or README documentation, so unsampled implementation details are not inferred.

Main entry points: [`market.js`](https://github.com/prat3564/market-dashboard/blob/main/market.js) (Dashboard controller), [`scraper.py`](https://github.com/prat3564/market-dashboard/blob/main/scraper.py) (Market scraper), [`index.html`](https://github.com/prat3564/market-dashboard/blob/main/index.html) (Dashboard document), [`indian_indices.json`](https://github.com/prat3564/market-dashboard/blob/main/indian_indices.json) (Indian indices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_automation["Scheduled ingestion"]
  node_timer["GitHub Actions<br/>[cron_scraper.yml]"]
  node_scraper["Market scraper<br/>[scraper.py]"]
end

subgraph group_data["Market data"]
  node_india_source["LiveMint India"]
  node_us_source["MintGenie API"]
  node_india_json[("Indian indices")]
  node_us_json[("US indices<br/>[us_indices.json]")]
  node_metals_api["Metals price API"]
  node_fx_api["USD/INR rate API"]
  node_msn_api["MSN index API"]
end

subgraph group_dashboard["Browser dashboard"]
  node_html["Dashboard document<br/>[index.html]"]
  node_js["Dashboard controller<br/>[market.js]"]
  node_css["Dashboard styling<br/>[market.css]"]
end

subgraph group_hosting["Static hosting"]
  node_pages["GitHub Pages"]
end

node_browser_user(("Dashboard visitor"))

node_timer -->|"runs every three hours"| node_scraper
node_scraper -->|"scrapes"| node_india_source
node_scraper -->|"requests prices"| node_us_source
node_scraper -->|"writes"| node_india_json
node_scraper -->|"writes"| node_us_json
node_browser_user -->|"opens dashboard"| node_pages
node_pages -->|"serves"| node_html
node_html -->|"loads controller"| node_js
node_html -->|"uses styles"| node_css
node_js -->|"fetches local feed"| node_india_json
node_js -->|"fetches local feed"| node_us_json
node_js -->|"fetches prices"| node_metals_api
node_js -->|"fetches exchange rate"| node_fx_api
node_js -->|"fetches index data"| node_msn_api

click node_timer "https://github.com/prat3564/market-dashboard/blob/main/.github/workflows/cron_scraper.yml"
click node_scraper "https://github.com/prat3564/market-dashboard/blob/main/scraper.py"
click node_india_json "https://github.com/prat3564/market-dashboard/blob/main/indian_indices.json"
click node_us_json "https://github.com/prat3564/market-dashboard/blob/main/us_indices.json"
click node_html "https://github.com/prat3564/market-dashboard/blob/main/index.html"
click node_js "https://github.com/prat3564/market-dashboard/blob/main/market.js"
click node_css "https://github.com/prat3564/market-dashboard/blob/main/market.css"

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_timer,node_scraper toneBlue
class node_india_source,node_us_source,node_india_json,node_us_json,node_metals_api,node_fx_api,node_msn_api toneAmber
class node_html,node_js,node_css toneMint
class node_pages toneRose
class node_browser_user toneIndigo
```

## Components

### Scheduled ingestion

- [GitHub Actions](https://github.com/prat3564/market-dashboard/blob/main/.github/workflows/cron_scraper.yml): `.github/workflows/cron_scraper.yml`
- [Market scraper](https://github.com/prat3564/market-dashboard/blob/main/scraper.py): `scraper.py`

### Market data

- **LiveMint India**
- **MintGenie API**
- [Indian indices](https://github.com/prat3564/market-dashboard/blob/main/indian_indices.json): `indian_indices.json`
- [US indices](https://github.com/prat3564/market-dashboard/blob/main/us_indices.json): `us_indices.json`
- **Metals price API**
- **USD/INR rate API**
- **MSN index API**

### Browser dashboard

- [Dashboard document](https://github.com/prat3564/market-dashboard/blob/main/index.html): `index.html`
- [Dashboard controller](https://github.com/prat3564/market-dashboard/blob/main/market.js): `market.js`
- [Dashboard styling](https://github.com/prat3564/market-dashboard/blob/main/market.css): `market.css`

### Static hosting

- **GitHub Pages**

### Other components

- **Dashboard visitor**

## Connections

- GitHub Actions → Market scraper: runs every three hours (evidence: `README.md`)
- Market scraper → LiveMint India: scrapes (evidence: `scraper.py`)
- Market scraper → MintGenie API: requests prices (evidence: `scraper.py`)
- Market scraper → Indian indices: writes (evidence: `scraper.py`)
- Market scraper → US indices: writes (evidence: `scraper.py`)
- Dashboard visitor → GitHub Pages: opens dashboard (evidence: `README.md`)
- GitHub Pages → Dashboard document: serves (evidence: `README.md`)
- Dashboard document → Dashboard controller: loads controller (evidence: `README.md`)
- Dashboard document → Dashboard styling: uses styles (evidence: `README.md`)
- Dashboard controller → Indian indices: fetches local feed (evidence: `market.js`)
- Dashboard controller → US indices: fetches local feed (evidence: `market.js`)
- Dashboard controller → Metals price API: fetches prices (evidence: `README.md`)
- Dashboard controller → USD/INR rate API: fetches exchange rate (evidence: `market.js`)
- Dashboard controller → MSN index API: fetches index data (evidence: `market.js`)
