# shahmaan/omarchy-stock-watch architecture

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

- Interactive diagram: https://gitdiagram.com/shahmaan/omarchy-stock-watch
- Repository: https://github.com/shahmaan/omarchy-stock-watch

## Overview

Stock Watch is an Omarchy shell bar widget for tracking a user-managed stock and fund watchlist. The main workflow runs from bar interactions to a panel where users search for and add tickers, inspect quotes and sparklines, change the reporting timeframe, and remove entries. Watchlist state persists locally, while market data and search results come from Yahoo Finance. The README documents these capabilities, but the QML files were not excerpted, so internal call ownership and detailed UI-to-model wiring cannot be verified.

Main entry points: [`Panel.qml`](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Panel.qml) (Watchlist Panel), [`Model.js`](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js) (Quote Parsing), [`BarWidget.qml`](https://github.com/shahmaan/omarchy-stock-watch/blob/master/BarWidget.qml) (Bar Widget)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Widget UI"]
  node_bar["Bar Widget<br/>[BarWidget.qml]"]
  node_panel["Watchlist Panel<br/>[Panel.qml]"]
end

subgraph group_market["Market Data"]
  node_search["Ticker Search<br/>[Model.js]"]
  node_quotes["Quote Parsing<br/>[Model.js]"]
  node_analytics["Portfolio Metrics<br/>[Model.js]"]
  node_chart["Sparkline Series<br/>[Model.js]"]
  node_flags["Exchange Flags<br/>[Model.js]"]
end

subgraph group_state["Watchlist State"]
  node_persistence["State Parsing<br/>[Model.js]"]
  node_statefile["Local State File"]
end

node_user(("User"))
node_yahoo["Yahoo Finance"]

node_user -->|"clicks or refreshes"| node_bar
node_user -->|"manages watchlist"| node_panel
node_bar -->|"opens panel"| node_panel
node_user -->|"cycles timeframe"| node_bar
node_panel -.->|"searches tickers"| node_search
node_search -->|"searches"| node_yahoo
node_panel -.->|"shows quotes"| node_quotes
node_quotes -.->|"gets market data"| node_yahoo
node_quotes -.->|"provides quote metrics"| node_analytics
node_panel -.->|"shows portfolio summary"| node_analytics
node_panel -.->|"expands sparkline"| node_chart
node_panel -.->|"shows exchange flag"| node_flags
node_panel -.->|"updates watchlist"| node_persistence
node_persistence -->|"reads and writes"| node_statefile
node_persistence -.->|"restores settings"| node_panel

click node_bar "https://github.com/shahmaan/omarchy-stock-watch/blob/master/BarWidget.qml"
click node_panel "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Panel.qml"
click node_search "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js"
click node_quotes "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js"
click node_analytics "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js"
click node_chart "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js"
click node_flags "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js"
click node_persistence "https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.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_bar,node_panel,node_user toneBlue
class node_search,node_quotes,node_analytics,node_chart,node_flags toneAmber
class node_persistence,node_statefile toneMint
class node_yahoo toneIndigo
```

## Components

### Widget UI

- [Bar Widget](https://github.com/shahmaan/omarchy-stock-watch/blob/master/BarWidget.qml): `BarWidget.qml`
- [Watchlist Panel](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Panel.qml): `Panel.qml`

### Market Data

- [Ticker Search](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js): `Model.js`
- [Quote Parsing](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js): `Model.js`
- [Portfolio Metrics](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js): `Model.js`
- [Sparkline Series](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js): `Model.js`
- [Exchange Flags](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js): `Model.js`

### Watchlist State

- [State Parsing](https://github.com/shahmaan/omarchy-stock-watch/blob/master/Model.js): `Model.js`
- **Local State File**

### Other components

- **User**
- **Yahoo Finance**

## Connections

- User → Bar Widget: clicks or refreshes (evidence: `README.md`)
- User → Watchlist Panel: manages watchlist (evidence: `README.md`)
- Bar Widget → Watchlist Panel: opens panel (evidence: `README.md`)
- User → Bar Widget: cycles timeframe (evidence: `README.md`)
- Watchlist Panel → Ticker Search: searches tickers
- Ticker Search → Yahoo Finance: searches (evidence: `README.md`)
- Watchlist Panel → Quote Parsing: shows quotes
- Quote Parsing → Yahoo Finance: gets market data
- Quote Parsing → Portfolio Metrics: provides quote metrics (evidence: `Model.js`)
- Watchlist Panel → Portfolio Metrics: shows portfolio summary
- Watchlist Panel → Sparkline Series: expands sparkline
- Watchlist Panel → Exchange Flags: shows exchange flag
- Watchlist Panel → State Parsing: updates watchlist
- State Parsing → Local State File: reads and writes (evidence: `README.md`)
- State Parsing → Watchlist Panel: restores settings
