# thorbeck20/theredqueen architecture

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

- Interactive diagram: https://gitdiagram.com/thorbeck20/theredqueen
- Repository: https://github.com/thorbeck20/theredqueen

## Overview

TheRedQueen is an investment-information website bringing financial resources into one interface. The visible workflow is a user navigating the React app to bond tools, which request FRED series metadata and observations through FastAPI and display yields or chart data; Polymarket event previews provide a separate market-information branch. The README also names stock fundamentals from yfinance as a planned capability, but the sampled Stocks page is empty. Backend wiring for dividends and the Polymarket service is not shown, so those links are omitted where unsupported.

Main entry points: [`TRQ-frontend/src/App.jsx`](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/App.jsx) (App shell and routes), [`Backend/main.py`](https://github.com/thorbeck20/theredqueen/blob/main/Backend/main.py) (FastAPI app), [`Backend/services/fred_bonds.py`](https://github.com/thorbeck20/theredqueen/blob/main/Backend/services/fred_bonds.py) (FRED requests), [`TRQ-frontend/src/components/BondsPage/Bonds.jsx`](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/BondsPage/Bonds.jsx) (Bond dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Investment UI"]
  node_app["App shell and routes<br/>[App.jsx]"]
  node_navigation["Navigation and theme<br/>[Navbar.jsx]"]
  node_bonds_page["Bond dashboard<br/>[Bonds.jsx]"]
  node_yield_tools["Yield comparisons"]
  node_chart_tools["Series charting<br/>[ChartContainer.jsx]"]
  node_stocks_page["Stock information<br/>[Stocks.jsx]"]
  node_options_page["Options page<br/>[Options.jsx]"]
  node_polymarket_view["Event preview<br/>[EventsPreview.jsx]"]
end

subgraph group_backend["API backend"]
  node_api["FastAPI app<br/>[main.py]"]
  node_bond_route["Bond series route<br/>[bonds.py]"]
  node_fred_service["FRED requests<br/>[fred_bonds.py]"]
  node_dividend_route["Dividend route<br/>[dividends.py]"]
  node_polymarket_route["Polymarket route<br/>[polymarket.py]"]
  node_polymarket_service["Polymarket service<br/>[polymarket.py]"]
end

subgraph group_integrations["Market data"]
  node_fred{{"FRED API"}}
  node_polymarket{{"Polymarket API"}}
  node_yfinance{{"yfinance"}}
end

node_investor(("Investor"))

node_investor -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"routes"| node_bonds_page
node_app -->|"routes"| node_stocks_page
node_app -->|"routes"| node_options_page
node_bonds_page -->|"renders"| node_yield_tools
node_yield_tools -->|"requests yields"| node_api
node_chart_tools -->|"requests series"| node_api
node_api -->|"mounts"| node_bond_route
node_bond_route -->|"fetches series"| node_fred_service
node_fred_service -->|"requests data"| node_fred
node_polymarket_view -->|"requests event"| node_api
node_api -->|"mounts"| node_polymarket_route
node_polymarket_route -.->|"calls"| node_polymarket_service
node_polymarket_service -.->|"fetches markets"| node_polymarket
node_dividend_route -.-> node_fred_service
node_stocks_page -.->|"planned fundamentals"| node_yfinance

click node_app "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/App.jsx"
click node_navigation "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/Navbar/Navbar.jsx"
click node_bonds_page "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/BondsPage/Bonds.jsx"
click node_yield_tools "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/BondsPage/YieldSpreadComp.jsx"
click node_chart_tools "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/ChartComponents/ChartContainer.jsx"
click node_stocks_page "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/Stockspage/Stocks.jsx"
click node_options_page "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/OptionsPage/Options.jsx"
click node_polymarket_view "https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/PolyMarketComponents/EventsPreview.jsx"
click node_api "https://github.com/thorbeck20/theredqueen/blob/main/Backend/main.py"
click node_bond_route "https://github.com/thorbeck20/theredqueen/blob/main/Backend/routers/bonds.py"
click node_fred_service "https://github.com/thorbeck20/theredqueen/blob/main/Backend/services/fred_bonds.py"
click node_dividend_route "https://github.com/thorbeck20/theredqueen/blob/main/Backend/routers/dividends.py"
click node_polymarket_route "https://github.com/thorbeck20/theredqueen/blob/main/Backend/routers/polymarket.py"
click node_polymarket_service "https://github.com/thorbeck20/theredqueen/blob/main/Backend/services/polymarket.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_navigation,node_bonds_page,node_yield_tools,node_chart_tools,node_stocks_page,node_options_page,node_polymarket_view toneBlue
class node_api,node_bond_route,node_fred_service,node_dividend_route,node_polymarket_route,node_polymarket_service toneAmber
class node_fred,node_polymarket,node_yfinance toneMint
class node_investor toneIndigo
```

## Components

### Investment UI

- [App shell and routes](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/App.jsx): `TRQ-frontend/src/App.jsx`
- [Navigation and theme](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/Navbar/Navbar.jsx): `TRQ-frontend/src/components/Navbar/Navbar.jsx`
- [Bond dashboard](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/BondsPage/Bonds.jsx): `TRQ-frontend/src/components/BondsPage/Bonds.jsx`
- [Yield comparisons](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/BondsPage/YieldSpreadComp.jsx): `TRQ-frontend/src/components/BondsPage/YieldSpreadComp.jsx`
- [Series charting](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/ChartComponents/ChartContainer.jsx): `TRQ-frontend/src/components/ChartComponents/ChartContainer.jsx`
- [Stock information](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/Stockspage/Stocks.jsx): `TRQ-frontend/src/components/Stockspage/Stocks.jsx`
- [Options page](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/OptionsPage/Options.jsx): `TRQ-frontend/src/components/OptionsPage/Options.jsx`
- [Event preview](https://github.com/thorbeck20/theredqueen/blob/main/TRQ-frontend/src/components/PolyMarketComponents/EventsPreview.jsx): `TRQ-frontend/src/components/PolyMarketComponents/EventsPreview.jsx`

### API backend

- [FastAPI app](https://github.com/thorbeck20/theredqueen/blob/main/Backend/main.py): `Backend/main.py`
- [Bond series route](https://github.com/thorbeck20/theredqueen/blob/main/Backend/routers/bonds.py): `Backend/routers/bonds.py`
- [FRED requests](https://github.com/thorbeck20/theredqueen/blob/main/Backend/services/fred_bonds.py): `Backend/services/fred_bonds.py`
- [Dividend route](https://github.com/thorbeck20/theredqueen/blob/main/Backend/routers/dividends.py): `Backend/routers/dividends.py`
- [Polymarket route](https://github.com/thorbeck20/theredqueen/blob/main/Backend/routers/polymarket.py): `Backend/routers/polymarket.py`
- [Polymarket service](https://github.com/thorbeck20/theredqueen/blob/main/Backend/services/polymarket.py): `Backend/services/polymarket.py`

### Market data

- **FRED API**
- **Polymarket API**
- **yfinance**

### Other components

- **Investor**

## Connections

- Investor → App shell and routes: uses
- App shell and routes → Navigation and theme: renders
- App shell and routes → Bond dashboard: routes
- App shell and routes → Stock information: routes
- App shell and routes → Options page: routes
- Bond dashboard → Yield comparisons: renders
- Yield comparisons → FastAPI app: requests yields
- Series charting → FastAPI app: requests series
- FastAPI app → Bond series route: mounts
- Bond series route → FRED requests: fetches series
- FRED requests → FRED API: requests data
- Event preview → FastAPI app: requests event
- FastAPI app → Polymarket route: mounts
- Polymarket route → Polymarket service: calls
- Polymarket service → Polymarket API: fetches markets
- Dividend route → FRED requests
- Stock information → yfinance: planned fundamentals
