# nijeeth/chart-funda architecture

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

- Interactive diagram: https://gitdiagram.com/nijeeth/chart-funda
- Repository: https://github.com/nijeeth/chart-funda

## Overview

Chart Funda is a Chrome extension that adds Indian-company fundamentals and ownership data beside TradingView charts, with an optional Chartink redirect and a dashboard of settings and market links. The main workflow is: a viewer opens the panel for a chart symbol; the panel requests Screener company data and Trendlyne earnings dates; background modules fetch and parse the data; the panel displays it and can switch the chart to a peer. The excerpts show the service-worker dispatch and panel requests, but not every response-handler detail, so only evidenced relationships are drawn.

Main entry points: [`modules/tv-panel/content.js`](https://github.com/nijeeth/chart-funda/blob/main/modules/tv-panel/content.js) (TradingView panel), [`modules/chartink-redirect/background.js`](https://github.com/nijeeth/chart-funda/blob/main/modules/chartink-redirect/background.js) (Chartink redirect), [`modules/screener-fundamentals/background.js`](https://github.com/nijeeth/chart-funda/blob/main/modules/screener-fundamentals/background.js) (Company fundamentals), [`background/index.js`](https://github.com/nijeeth/chart-funda/blob/main/background/index.js) (Background worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Extension runtime"]
  node_worker["Background worker<br/>[index.js]"]
  node_redirect["Chartink redirect<br/>[background.js]"]
  node_storage[("Settings storage<br/>[storage.js]")]
end

subgraph group_panel["Chart panel"]
  node_tvpanel["TradingView panel<br/>[content.js]"]
  node_bridge["Chart page bridge<br/>[page-bridge.js]"]
end

subgraph group_data["Market data"]
  node_screener["Company fundamentals<br/>[background.js]"]
  node_bselookup["BSE symbol lookup<br/>[bse-lookup.js]"]
  node_earnings["Earnings calendar<br/>[background.js]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboardui["Settings and links<br/>[script.js]"]
end

node_viewer(("Chart viewer"))
node_tradingview["TradingView"]
node_screenerweb["Screener.in"]
node_trendlyne["Trendlyne"]
node_kite["Kite instruments"]
node_chartink["Chartink"]

node_worker -->|"starts"| node_redirect
node_worker -->|"starts"| node_screener
node_worker -->|"starts"| node_earnings
node_viewer -->|"opens chart"| node_tradingview
node_tradingview -->|"hosts panel"| node_tvpanel
node_tvpanel -->|"requests data"| node_screener
node_tvpanel -->|"requests dates"| node_earnings
node_screener -->|"resolves BSE"| node_bselookup
node_screener -->|"fetches company data"| node_screenerweb
node_bselookup -->|"fetches instruments"| node_kite
node_earnings -->|"fetches dates"| node_trendlyne
node_tvpanel -->|"dispatches chart event"| node_bridge
node_bridge -->|"changes symbol"| node_tradingview
node_tvpanel -->|"reads settings"| node_storage
node_viewer -->|"opens dashboard"| node_dashboardui
node_dashboardui -->|"reads and writes"| node_storage
node_redirect -->|"reads setting"| node_storage
node_chartink -->|"tab navigation"| node_redirect
node_redirect -->|"redirects symbol"| node_tradingview
node_dashboardui -->|"offers market links"| node_viewer

click node_worker "https://github.com/nijeeth/chart-funda/blob/main/background/index.js"
click node_redirect "https://github.com/nijeeth/chart-funda/blob/main/modules/chartink-redirect/background.js"
click node_storage "https://github.com/nijeeth/chart-funda/blob/main/shared/storage.js"
click node_tvpanel "https://github.com/nijeeth/chart-funda/blob/main/modules/tv-panel/content.js"
click node_bridge "https://github.com/nijeeth/chart-funda/blob/main/modules/tv-panel/page-bridge.js"
click node_screener "https://github.com/nijeeth/chart-funda/blob/main/modules/screener-fundamentals/background.js"
click node_bselookup "https://github.com/nijeeth/chart-funda/blob/main/modules/screener-fundamentals/bse-lookup.js"
click node_earnings "https://github.com/nijeeth/chart-funda/blob/main/modules/earnings-calendar/background.js"
click node_dashboardui "https://github.com/nijeeth/chart-funda/blob/main/modules/dashboard/script.js"

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_worker,node_redirect,node_storage,node_viewer,node_tradingview,node_screenerweb toneBlue
class node_tvpanel,node_bridge toneAmber
class node_screener,node_bselookup,node_earnings toneMint
class node_dashboardui toneRose
class node_trendlyne,node_kite,node_chartink toneIndigo
```

## Components

### Extension runtime

- [Background worker](https://github.com/nijeeth/chart-funda/blob/main/background/index.js): `background/index.js`
- [Chartink redirect](https://github.com/nijeeth/chart-funda/blob/main/modules/chartink-redirect/background.js): `modules/chartink-redirect/background.js`
- [Settings storage](https://github.com/nijeeth/chart-funda/blob/main/shared/storage.js): `shared/storage.js`

### Chart panel

- [TradingView panel](https://github.com/nijeeth/chart-funda/blob/main/modules/tv-panel/content.js): `modules/tv-panel/content.js`
- [Chart page bridge](https://github.com/nijeeth/chart-funda/blob/main/modules/tv-panel/page-bridge.js): `modules/tv-panel/page-bridge.js`

### Market data

- [Company fundamentals](https://github.com/nijeeth/chart-funda/blob/main/modules/screener-fundamentals/background.js): `modules/screener-fundamentals/background.js`
- [BSE symbol lookup](https://github.com/nijeeth/chart-funda/blob/main/modules/screener-fundamentals/bse-lookup.js): `modules/screener-fundamentals/bse-lookup.js`
- [Earnings calendar](https://github.com/nijeeth/chart-funda/blob/main/modules/earnings-calendar/background.js): `modules/earnings-calendar/background.js`

### Dashboard

- [Settings and links](https://github.com/nijeeth/chart-funda/blob/main/modules/dashboard/script.js): `modules/dashboard/script.js`

### Other components

- **Chart viewer**
- **TradingView**
- **Screener.in**
- **Trendlyne**
- **Kite instruments**
- **Chartink**

## Connections

- Background worker → Chartink redirect: starts (evidence: `background/index.js`)
- Background worker → Company fundamentals: starts (evidence: `background/index.js`)
- Background worker → Earnings calendar: starts (evidence: `background/index.js`)
- Chart viewer → TradingView: opens chart (evidence: `README.md`)
- TradingView → TradingView panel: hosts panel (evidence: `README.md`)
- TradingView panel → Company fundamentals: requests data (evidence: `modules/tv-panel/content.js`)
- TradingView panel → Earnings calendar: requests dates (evidence: `modules/tv-panel/content.js`)
- Company fundamentals → BSE symbol lookup: resolves BSE (evidence: `modules/screener-fundamentals/background.js`)
- Company fundamentals → Screener.in: fetches company data (evidence: `README.md`)
- BSE symbol lookup → Kite instruments: fetches instruments (evidence: `modules/screener-fundamentals/bse-lookup.js`)
- Earnings calendar → Trendlyne: fetches dates (evidence: `modules/earnings-calendar/background.js`)
- TradingView panel → Chart page bridge: dispatches chart event (evidence: `modules/tv-panel/content.js`)
- Chart page bridge → TradingView: changes symbol (evidence: `modules/tv-panel/page-bridge.js`)
- TradingView panel → Settings storage: reads settings (evidence: `modules/tv-panel/content.js`)
- Chart viewer → Settings and links: opens dashboard
- Settings and links → Settings storage: reads and writes (evidence: `modules/dashboard/script.js`)
- Chartink redirect → Settings storage: reads setting (evidence: `modules/chartink-redirect/background.js`)
- Chartink → Chartink redirect: tab navigation (evidence: `modules/chartink-redirect/background.js`)
- Chartink redirect → TradingView: redirects symbol (evidence: `modules/chartink-redirect/background.js`)
- Settings and links → Chart viewer: offers market links (evidence: `README.md`)
