# narenkram/steadfast-extension architecture

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

- Interactive diagram: https://gitdiagram.com/narenkram/steadfast-extension
- Repository: https://github.com/narenkram/steadfast-extension

## Overview

This browser extension captures the visible tab and extracts BANKNIFTY option details from the screenshot. The user starts capture in the popup; the background listener obtains the screenshot, which the popup sends to OCR, parses, and displays. The sampled files show this workflow, but not the manifest configuration or the contents of the other repository files.

Main entry points: [`popup.js`](https://github.com/narenkram/steadfast-extension/blob/master/popup.js) (Capture popup), [`background.js`](https://github.com/narenkram/steadfast-extension/blob/master/background.js) (Tab capture handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["Extension workflow"]
  node_popup["Capture popup<br/>[popup.js]"]
  node_capture["Tab capture handler<br/>[background.js]"]
end

subgraph group_processing["Text processing"]
  node_ocr["Tesseract OCR"]
  node_parser["Option parser<br/>[popup.js]"]
  node_results["Result display<br/>[popup.js]"]
end

node_user(("User"))
node_active_tab["Active tab"]

node_user -->|"clicks capture"| node_popup
node_popup -->|"requests capture"| node_capture
node_capture -->|"captures screenshot"| node_active_tab
node_capture -->|"returns image"| node_popup
node_popup -->|"recognizes image"| node_ocr
node_ocr -->|"provides text"| node_parser
node_parser -->|"provides extracted data"| node_results

click node_popup "https://github.com/narenkram/steadfast-extension/blob/master/popup.js"
click node_capture "https://github.com/narenkram/steadfast-extension/blob/master/background.js"
click node_parser "https://github.com/narenkram/steadfast-extension/blob/master/popup.js"
click node_results "https://github.com/narenkram/steadfast-extension/blob/master/popup.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_popup,node_capture,node_user toneBlue
class node_ocr,node_parser,node_results toneAmber
class node_active_tab toneIndigo
```

## Components

### Extension workflow

- [Capture popup](https://github.com/narenkram/steadfast-extension/blob/master/popup.js): `popup.js`
- [Tab capture handler](https://github.com/narenkram/steadfast-extension/blob/master/background.js): `background.js`

### Text processing

- **Tesseract OCR**
- [Option parser](https://github.com/narenkram/steadfast-extension/blob/master/popup.js): `popup.js`
- [Result display](https://github.com/narenkram/steadfast-extension/blob/master/popup.js): `popup.js`

### Other components

- **User**
- **Active tab**

## Connections

- User → Capture popup: clicks capture (evidence: `popup.js`)
- Capture popup → Tab capture handler: requests capture (evidence: `popup.js`)
- Tab capture handler → Active tab: captures screenshot (evidence: `background.js`)
- Tab capture handler → Capture popup: returns image (evidence: `background.js`)
- Capture popup → Tesseract OCR: recognizes image (evidence: `popup.js`)
- Tesseract OCR → Option parser: provides text (evidence: `popup.js`)
- Option parser → Result display: provides extracted data (evidence: `popup.js`)
