# tduic/macro-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/tduic/macro-dashboard
- Repository: https://github.com/tduic/macro-dashboard

## Overview

Macro Desk is a local macro-markets dashboard. Its main workflow fetches market and economic indicators, presents them as cards or a heatmap, and opens historical charts with comparisons and event overlays. Separate branches provide news, release-calendar and yield-curve views, plus mover and regime summaries. The API coordinates the data services and the frontend consumes its routes. Relationships shown here are supported by the README or excerpts and SOURCE INDEX references; unsampled implementations are represented only where their documented capability and path are clear.

Main entry points: [`frontend/src/App.tsx`](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/App.tsx) (Dashboard shell), [`backend/main.py`](https://github.com/tduic/macro-dashboard/blob/main/backend/main.py) (FastAPI routes), [`frontend/src/api.ts`](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/api.ts) (API client), [`backend/data/fred.py`](https://github.com/tduic/macro-dashboard/blob/main/backend/data/fred.py) (FRED data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard UI"]
  node_app["Dashboard shell<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_indicator_cards["Indicator cards<br/>[IndicatorCard.tsx]"]
  node_heatmap["Performance heatmap<br/>[HeatmapGrid.tsx]"]
end

subgraph group_backend["API and data"]
  node_backend_api["FastAPI routes<br/>[main.py]"]
  node_market_data["Market data<br/>[market.py]"]
  node_fred_data["FRED data<br/>[fred.py]"]
  node_news_data["News aggregation<br/>[news.py]"]
  node_curve_data["Curve snapshots<br/>[curves.py]"]
  node_event_data["Macro events<br/>[events.py]"]
  node_cache["TTL cache<br/>[cache.py]"]
end

subgraph group_summaries["Market summaries"]
  node_daily_summary["Mover summary<br/>[DailySummary.tsx]"]
  node_regime["Regime summary<br/>[RegimeStrip.tsx]"]
end

subgraph group_context["News and events"]
  node_news_ui["News feed<br/>[NewsFeed.tsx]"]
  node_calendar_ui["Release calendar<br/>[CalendarPanel.tsx]"]
end

subgraph group_analysis["Chart analysis"]
  node_chart["History charts<br/>[ChartModal.tsx]"]
  node_curve_panel["Yield curve panel"]
end

node_user(("Dashboard user"))
node_yfinance["Market data provider"]
node_fred["FRED service"]
node_rss["RSS feeds"]

node_user -->|"views"| node_app
node_app -->|"requests data"| node_api_client
node_app -->|"renders"| node_indicator_cards
node_app -->|"renders"| node_heatmap
node_app -->|"renders"| node_daily_summary
node_app -->|"renders"| node_regime
node_app -->|"renders"| node_calendar_ui
node_app -->|"renders"| node_news_ui
node_app -->|"opens"| node_chart
node_api_client -->|"calls routes"| node_backend_api
node_backend_api -->|"fetches indicators"| node_market_data
node_backend_api -->|"fetches releases"| node_fred_data
node_backend_api -->|"fetches news"| node_news_data
node_backend_api -->|"fetches curve"| node_curve_data
node_backend_api -->|"fetches events"| node_event_data
node_backend_api -->|"clears caches"| node_cache
node_market_data -.->|"retrieves prices"| node_yfinance
node_fred_data -->|"retrieves series"| node_fred
node_news_data -.->|"reads feeds"| node_rss
node_chart -->|"loads history"| node_api_client
node_chart -->|"loads events"| node_api_client
node_curve_panel -->|"loads snapshots"| node_api_client
node_news_ui -->|"loads news"| node_api_client
node_calendar_ui -->|"loads releases"| node_api_client
node_market_data -->|"caches results"| node_cache
node_fred_data -->|"caches results"| node_cache
node_news_data -.->|"caches results"| node_cache
node_curve_data -->|"builds snapshots"| node_fred_data
node_event_data -->|"merges releases"| node_fred_data

click node_app "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/api.ts"
click node_indicator_cards "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/IndicatorCard.tsx"
click node_heatmap "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/HeatmapGrid.tsx"
click node_chart "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/ChartModal.tsx"
click node_curve_panel "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/YieldCurvePanel.tsx"
click node_daily_summary "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/DailySummary.tsx"
click node_regime "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/RegimeStrip.tsx"
click node_news_ui "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/NewsFeed.tsx"
click node_calendar_ui "https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/CalendarPanel.tsx"
click node_backend_api "https://github.com/tduic/macro-dashboard/blob/main/backend/main.py"
click node_market_data "https://github.com/tduic/macro-dashboard/blob/main/backend/data/market.py"
click node_fred_data "https://github.com/tduic/macro-dashboard/blob/main/backend/data/fred.py"
click node_news_data "https://github.com/tduic/macro-dashboard/blob/main/backend/data/news.py"
click node_curve_data "https://github.com/tduic/macro-dashboard/blob/main/backend/data/curves.py"
click node_event_data "https://github.com/tduic/macro-dashboard/blob/main/backend/data/events.py"
click node_cache "https://github.com/tduic/macro-dashboard/blob/main/backend/cache.py"

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_app,node_api_client,node_indicator_cards,node_heatmap,node_user toneBlue
class node_backend_api,node_market_data,node_fred_data,node_news_data,node_curve_data,node_event_data,node_cache toneAmber
class node_daily_summary,node_regime toneMint
class node_news_ui,node_calendar_ui toneRose
class node_chart,node_curve_panel,node_yfinance,node_fred,node_rss toneIndigo
```

## Components

### Dashboard UI

- [Dashboard shell](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Indicator cards](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/IndicatorCard.tsx): `frontend/src/components/IndicatorCard.tsx`
- [Performance heatmap](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/HeatmapGrid.tsx): `frontend/src/components/HeatmapGrid.tsx`

### API and data

- [FastAPI routes](https://github.com/tduic/macro-dashboard/blob/main/backend/main.py): `backend/main.py`
- [Market data](https://github.com/tduic/macro-dashboard/blob/main/backend/data/market.py): `backend/data/market.py`
- [FRED data](https://github.com/tduic/macro-dashboard/blob/main/backend/data/fred.py): `backend/data/fred.py`
- [News aggregation](https://github.com/tduic/macro-dashboard/blob/main/backend/data/news.py): `backend/data/news.py`
- [Curve snapshots](https://github.com/tduic/macro-dashboard/blob/main/backend/data/curves.py): `backend/data/curves.py`
- [Macro events](https://github.com/tduic/macro-dashboard/blob/main/backend/data/events.py): `backend/data/events.py`
- [TTL cache](https://github.com/tduic/macro-dashboard/blob/main/backend/cache.py): `backend/cache.py`

### Market summaries

- [Mover summary](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/DailySummary.tsx): `frontend/src/components/DailySummary.tsx`
- [Regime summary](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/RegimeStrip.tsx): `frontend/src/components/RegimeStrip.tsx`

### News and events

- [News feed](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/NewsFeed.tsx): `frontend/src/components/NewsFeed.tsx`
- [Release calendar](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/CalendarPanel.tsx): `frontend/src/components/CalendarPanel.tsx`

### Chart analysis

- [History charts](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/ChartModal.tsx): `frontend/src/components/ChartModal.tsx`
- [Yield curve panel](https://github.com/tduic/macro-dashboard/blob/main/frontend/src/components/YieldCurvePanel.tsx): `frontend/src/components/YieldCurvePanel.tsx`

### Other components

- **Dashboard user**
- **Market data provider**
- **FRED service**
- **RSS feeds**

## Connections

- Dashboard user → Dashboard shell: views (evidence: `README.md`)
- Dashboard shell → API client: requests data (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Indicator cards: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Performance heatmap: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Mover summary: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Regime summary: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → Release calendar: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → News feed: renders (evidence: `frontend/src/App.tsx`)
- Dashboard shell → History charts: opens (evidence: `frontend/src/App.tsx`)
- API client → FastAPI routes: calls routes (evidence: `frontend/src/api.ts`)
- FastAPI routes → Market data: fetches indicators (evidence: `backend/main.py`)
- FastAPI routes → FRED data: fetches releases (evidence: `backend/main.py`)
- FastAPI routes → News aggregation: fetches news (evidence: `backend/main.py`)
- FastAPI routes → Curve snapshots: fetches curve (evidence: `backend/main.py`)
- FastAPI routes → Macro events: fetches events (evidence: `backend/main.py`)
- FastAPI routes → TTL cache: clears caches (evidence: `backend/main.py`)
- Market data → Market data provider: retrieves prices (evidence: `README.md`)
- FRED data → FRED service: retrieves series (evidence: `backend/data/fred.py`)
- News aggregation → RSS feeds: reads feeds (evidence: `README.md`)
- History charts → API client: loads history (evidence: `frontend/src/components/ChartModal.tsx`)
- History charts → API client: loads events (evidence: `frontend/src/components/ChartModal.tsx`)
- Yield curve panel → API client: loads snapshots (evidence: `frontend/src/components/YieldCurvePanel.tsx`)
- News feed → API client: loads news (evidence: `frontend/src/components/NewsFeed.tsx`)
- Release calendar → API client: loads releases (evidence: `frontend/src/components/CalendarPanel.tsx`)
- Market data → TTL cache: caches results (evidence: `backend/cache.py`)
- FRED data → TTL cache: caches results (evidence: `backend/data/curves.py`)
- News aggregation → TTL cache: caches results (evidence: `backend/data/news.py`)
- Curve snapshots → FRED data: builds snapshots (evidence: `backend/data/curves.py`)
- Macro events → FRED data: merges releases (evidence: `backend/data/events.py`)
