# pattty847/sentinel architecture

> Architecture diagram of the GitHub repository pattty847/sentinel, 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/pattty847/sentinel
- Repository: https://github.com/pattty847/sentinel

## Overview

Sentinel is a GPU-accelerated trading terminal with a desktop client and a separate data server. The principal workflow streams market data into server-side market and trading services, sends it over the Sentinel stream protocol, then displays it in interactive charts and order-book views. The repository also includes paper trading, simulation and backtesting, recording/capture, stock and SEC overlays, and screener workflows. The README documents the high-level client/server and product capabilities; sampled source supports selected internal calls, so unsampled subsystem links are omitted where their ownership is unclear.

Main entry points: [`apps/sentinel-server/SentinelServerApp.cpp`](https://github.com/pattty847/sentinel/blob/main/apps/sentinel-server/SentinelServerApp.cpp) (Server Runtime), [`libs/core/protocol/SentinelStreamClient.cpp`](https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/SentinelStreamClient.cpp) (Stream Client), [`apps/sentinel_gui/main.cpp`](https://github.com/pattty847/sentinel/blob/main/apps/sentinel_gui/main.cpp) (GUI Startup), [`libs/core/marketdata/MarketDataCoreEngine.cpp`](https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/MarketDataCoreEngine.cpp) (Market Feed Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Applications"]
  node_gui_app["GUI Startup<br/>[main.cpp]"]
  node_server_app["Server Startup<br/>[main.cpp]"]
  node_server_runtime["Server Runtime"]
  node_capture["Capture Tool<br/>[CaptureApp.cpp]"]
end

subgraph group_market["Market Data"]
  node_config["Runtime Config<br/>[ConfigTypes.hpp]"]
  node_market_engine["Market Feed Engine"]
  node_market_types["Trades &amp; Order Book<br/>[TradeData.h]"]
  node_market_dispatch["Message Dispatch"]
  node_logging["Logging"]
end

subgraph group_server["Server Services"]
  node_stream_server["Stream Server"]
  node_stream_client["Stream Client"]
  node_server_model["Server Data Model"]
  node_recording[("Recording Storage")]
  node_heatmap_service["Heatmap Services<br/>[ChunkService.cpp]"]
  node_volume_protocol["Volume Profile Wire Types"]
end

subgraph group_trading["Trading &amp; Simulation"]
  node_trading_engine["Trading Engine<br/>[TradingEngine.cpp]"]
  node_algo_engine["Algo Engine<br/>[AlgoEngine.cpp]"]
  node_backtest["Replay Backtest<br/>[ReplayEngine.cpp]"]
end

subgraph group_desktop["Desktop Client"]
  node_gui_main["Main Window<br/>[MainWindowGpu.cpp]"]
  node_grid_renderer["Unified Grid Renderer"]
  node_heatmap_render["Heatmap Rendering"]
  node_stream_state["Heatmap Stream State"]
  node_charting["Stock Chart &amp; SEC<br/>[StockChartDock.cpp]"]
  node_screener["Screener<br/>[ScreenerDock.cpp]"]
  node_dom["Order Book &amp; DOM<br/>[OrderBookDock.cpp]"]
  node_paper_ui["Paper Trading UI"]
end

node_user(("Trader"))

node_user -->|"starts"| node_gui_app
node_gui_app -->|"loads config"| node_config
node_gui_app -->|"opens window"| node_gui_main
node_server_app -->|"loads config"| node_config
node_server_app -->|"initializes"| node_server_runtime
node_server_runtime -->|"configures"| node_market_engine
node_market_engine -->|"dispatches messages"| node_market_dispatch
node_market_engine -->|"processes trades"| node_market_types
node_server_runtime -->|"configures"| node_server_model
node_server_runtime -->|"configures"| node_stream_server
node_server_runtime -->|"uses settings"| node_config
node_server_model -.->|"records data"| node_recording
node_server_model -.->|"serves heatmap"| node_heatmap_service
node_gui_main -->|"connects to server"| node_stream_client
node_stream_client -->|"exchanges stream data"| node_stream_server
node_stream_client -->|"uses wire types"| node_volume_protocol
node_gui_main -->|"uses renderer"| node_grid_renderer
node_grid_renderer -->|"uses stream state"| node_stream_state
node_grid_renderer -.->|"renders heatmap"| node_heatmap_render
node_user -->|"views stock signals"| node_charting
node_user -->|"finds symbols"| node_screener
node_user -->|"views order book"| node_dom
node_user -->|"places paper trades"| node_paper_ui
node_paper_ui -.->|"uses server connection"| node_stream_client
node_trading_engine -->|"supports algorithms"| node_algo_engine
node_user -->|"runs replay"| node_backtest
node_user -.->|"captures feed"| node_capture

click node_gui_app "https://github.com/pattty847/sentinel/blob/main/apps/sentinel_gui/main.cpp"
click node_server_app "https://github.com/pattty847/sentinel/blob/main/apps/sentinel-server/main.cpp"
click node_server_runtime "https://github.com/pattty847/sentinel/blob/main/apps/sentinel-server/SentinelServerApp.cpp"
click node_config "https://github.com/pattty847/sentinel/blob/main/libs/core/config/ConfigTypes.hpp"
click node_market_engine "https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/MarketDataCoreEngine.cpp"
click node_market_types "https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/model/TradeData.h"
click node_market_dispatch "https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/dispatch/MessageDispatcher.hpp"
click node_stream_server "https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/SentinelStreamServer.cpp"
click node_stream_client "https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/SentinelStreamClient.cpp"
click node_server_model "https://github.com/pattty847/sentinel/blob/main/libs/core/servermodel/ServerDataModel.cpp"
click node_recording "https://github.com/pattty847/sentinel/blob/main/libs/core/servermodel/RecordingChunks.cpp"
click node_heatmap_service "https://github.com/pattty847/sentinel/blob/main/libs/core/servermodel/ChunkService.cpp"
click node_gui_main "https://github.com/pattty847/sentinel/blob/main/libs/gui/MainWindowGpu.cpp"
click node_grid_renderer "https://github.com/pattty847/sentinel/blob/main/libs/gui/UnifiedGridRenderer.cpp"
click node_heatmap_render "https://github.com/pattty847/sentinel/blob/main/libs/gui/render/heatmap/HeatmapRenderNode.cpp"
click node_stream_state "https://github.com/pattty847/sentinel/blob/main/libs/gui/render/HeatmapStreamState.cpp"
click node_charting "https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/StockChartDock.cpp"
click node_screener "https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/ScreenerDock.cpp"
click node_dom "https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/OrderBookDock.cpp"
click node_paper_ui "https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/PaperTradingDock.cpp"
click node_trading_engine "https://github.com/pattty847/sentinel/blob/main/libs/core/trading/TradingEngine.cpp"
click node_algo_engine "https://github.com/pattty847/sentinel/blob/main/libs/core/trading/AlgoEngine.cpp"
click node_backtest "https://github.com/pattty847/sentinel/blob/main/libs/core/trading/ReplayEngine.cpp"
click node_capture "https://github.com/pattty847/sentinel/blob/main/libs/core/capture/CaptureApp.cpp"
click node_logging "https://github.com/pattty847/sentinel/blob/main/libs/core/SentinelLogging.hpp"
click node_volume_protocol "https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/VolumeProfileSlice.hpp"

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_gui_app,node_server_app,node_server_runtime,node_capture toneBlue
class node_config,node_market_engine,node_market_types,node_market_dispatch,node_logging toneAmber
class node_stream_server,node_stream_client,node_server_model,node_recording,node_heatmap_service,node_volume_protocol toneMint
class node_trading_engine,node_algo_engine,node_backtest toneRose
class node_gui_main,node_grid_renderer,node_heatmap_render,node_stream_state,node_charting,node_screener,node_dom,node_paper_ui,node_user toneIndigo
```

## Components

### Applications

- [GUI Startup](https://github.com/pattty847/sentinel/blob/main/apps/sentinel_gui/main.cpp): `apps/sentinel_gui/main.cpp`
- [Server Startup](https://github.com/pattty847/sentinel/blob/main/apps/sentinel-server/main.cpp): `apps/sentinel-server/main.cpp`
- [Server Runtime](https://github.com/pattty847/sentinel/blob/main/apps/sentinel-server/SentinelServerApp.cpp): `apps/sentinel-server/SentinelServerApp.cpp`
- [Capture Tool](https://github.com/pattty847/sentinel/blob/main/libs/core/capture/CaptureApp.cpp): `libs/core/capture/CaptureApp.cpp`

### Market Data

- [Runtime Config](https://github.com/pattty847/sentinel/blob/main/libs/core/config/ConfigTypes.hpp): `libs/core/config/ConfigTypes.hpp`
- [Market Feed Engine](https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/MarketDataCoreEngine.cpp): `libs/core/marketdata/MarketDataCoreEngine.cpp`
- [Trades & Order Book](https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/model/TradeData.h): `libs/core/marketdata/model/TradeData.h`
- [Message Dispatch](https://github.com/pattty847/sentinel/blob/main/libs/core/marketdata/dispatch/MessageDispatcher.hpp): `libs/core/marketdata/dispatch/MessageDispatcher.hpp`
- [Logging](https://github.com/pattty847/sentinel/blob/main/libs/core/SentinelLogging.hpp): `libs/core/SentinelLogging.hpp`

### Server Services

- [Stream Server](https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/SentinelStreamServer.cpp): `libs/core/protocol/SentinelStreamServer.cpp`
- [Stream Client](https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/SentinelStreamClient.cpp): `libs/core/protocol/SentinelStreamClient.cpp`
- [Server Data Model](https://github.com/pattty847/sentinel/blob/main/libs/core/servermodel/ServerDataModel.cpp): `libs/core/servermodel/ServerDataModel.cpp`
- [Recording Storage](https://github.com/pattty847/sentinel/blob/main/libs/core/servermodel/RecordingChunks.cpp): `libs/core/servermodel/RecordingChunks.cpp`
- [Heatmap Services](https://github.com/pattty847/sentinel/blob/main/libs/core/servermodel/ChunkService.cpp): `libs/core/servermodel/ChunkService.cpp`
- [Volume Profile Wire Types](https://github.com/pattty847/sentinel/blob/main/libs/core/protocol/VolumeProfileSlice.hpp): `libs/core/protocol/VolumeProfileSlice.hpp`

### Trading & Simulation

- [Trading Engine](https://github.com/pattty847/sentinel/blob/main/libs/core/trading/TradingEngine.cpp): `libs/core/trading/TradingEngine.cpp`
- [Algo Engine](https://github.com/pattty847/sentinel/blob/main/libs/core/trading/AlgoEngine.cpp): `libs/core/trading/AlgoEngine.cpp`
- [Replay Backtest](https://github.com/pattty847/sentinel/blob/main/libs/core/trading/ReplayEngine.cpp): `libs/core/trading/ReplayEngine.cpp`

### Desktop Client

- [Main Window](https://github.com/pattty847/sentinel/blob/main/libs/gui/MainWindowGpu.cpp): `libs/gui/MainWindowGpu.cpp`
- [Unified Grid Renderer](https://github.com/pattty847/sentinel/blob/main/libs/gui/UnifiedGridRenderer.cpp): `libs/gui/UnifiedGridRenderer.cpp`
- [Heatmap Rendering](https://github.com/pattty847/sentinel/blob/main/libs/gui/render/heatmap/HeatmapRenderNode.cpp): `libs/gui/render/heatmap/HeatmapRenderNode.cpp`
- [Heatmap Stream State](https://github.com/pattty847/sentinel/blob/main/libs/gui/render/HeatmapStreamState.cpp): `libs/gui/render/HeatmapStreamState.cpp`
- [Stock Chart & SEC](https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/StockChartDock.cpp): `libs/gui/widgets/StockChartDock.cpp`
- [Screener](https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/ScreenerDock.cpp): `libs/gui/widgets/ScreenerDock.cpp`
- [Order Book & DOM](https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/OrderBookDock.cpp): `libs/gui/widgets/OrderBookDock.cpp`
- [Paper Trading UI](https://github.com/pattty847/sentinel/blob/main/libs/gui/widgets/PaperTradingDock.cpp): `libs/gui/widgets/PaperTradingDock.cpp`

### Other components

- **Trader**

## Connections

- Trader → GUI Startup: starts (evidence: `README.md`)
- GUI Startup → Runtime Config: loads config (evidence: `apps/sentinel_gui/main.cpp`)
- GUI Startup → Main Window: opens window (evidence: `apps/sentinel_gui/main.cpp`)
- Server Startup → Runtime Config: loads config (evidence: `apps/sentinel-server/main.cpp`)
- Server Startup → Server Runtime: initializes (evidence: `apps/sentinel-server/main.cpp`)
- Server Runtime → Market Feed Engine: configures
- Market Feed Engine → Message Dispatch: dispatches messages (evidence: `libs/core/marketdata/MarketDataCoreEngine.cpp`)
- Market Feed Engine → Trades & Order Book: processes trades (evidence: `libs/core/marketdata/MarketDataCoreEngine.cpp`)
- Server Runtime → Server Data Model: configures
- Server Runtime → Stream Server: configures
- Server Runtime → Runtime Config: uses settings
- Server Data Model → Recording Storage: records data
- Server Data Model → Heatmap Services: serves heatmap
- Main Window → Stream Client: connects to server (evidence: `README.md`)
- Stream Client → Stream Server: exchanges stream data (evidence: `README.md`)
- Stream Client → Volume Profile Wire Types: uses wire types (evidence: `libs/core/protocol/SentinelStreamClient.cpp`)
- Main Window → Unified Grid Renderer: uses renderer
- Unified Grid Renderer → Heatmap Stream State: uses stream state
- Unified Grid Renderer → Heatmap Rendering: renders heatmap
- Trader → Stock Chart & SEC: views stock signals (evidence: `README.md`)
- Trader → Screener: finds symbols (evidence: `README.md`)
- Trader → Order Book & DOM: views order book (evidence: `README.md`)
- Trader → Paper Trading UI: places paper trades (evidence: `README.md`)
- Paper Trading UI → Stream Client: uses server connection
- Trading Engine → Algo Engine: supports algorithms
- Trader → Replay Backtest: runs replay
- Trader → Capture Tool: captures feed
