# akashdeep-bit-gif/hft-trading-terminal architecture

> Architecture diagram of the GitHub repository akashdeep-bit-gif/hft-trading-terminal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akashdeep-bit-gif/hft-trading-terminal
- Repository: https://github.com/akashdeep-bit-gif/hft-trading-terminal

## Overview

This is a paper-trading terminal with a Redis-mediated market-data path: generated or exchange-fed ticks reach a backend WebSocket broadcaster and then the React client. The README also documents exchange ingestion, time-series logging, charts, depth, and execution controls; those capabilities are represented at their documented level, but their implementation was not sampled. The sampled frontend shows trade and system-log panels, not the additional workstation features.

Main entry points: [`frontend/src/App.jsx`](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/App.jsx) (Terminal UI), [`backend`](https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/backend) (Exchange Ingestion), [`backend/server.js`](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/backend/server.js) (WebSocket Broadcaster), [`backend/generator.js`](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/backend/generator.js) (Mock Trade Generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Market Data"]
  node_generator["Mock Trade Generator<br/>[generator.js]"]
  node_ingestion["Exchange Ingestion"]
  node_redis["Redis Pub/Sub"]
end

subgraph group_backend["Backend Services"]
  node_wsserver["WebSocket Broadcaster<br/>[server.js]"]
end

subgraph group_frontend["Trading Workstation"]
  node_entry["React Entry<br/>[main.jsx]"]
  node_terminal["Terminal UI<br/>[App.jsx]"]
  node_livepanels["Trade And Logs<br/>[App.jsx]"]
  node_workstation["Charts And Execution"]
end

subgraph group_storage["Time-Series Storage"]
  node_logger["Tick Logger"]
  node_sqlite[("Market Data DB")]
end

node_trader(("Trader"))
node_exchange["Binance"]

node_trader -->|"uses"| node_terminal
node_exchange -->|"streams ticks"| node_ingestion
node_generator -->|"publishes trades"| node_redis
node_ingestion -->|"publishes ticks"| node_redis
node_redis -->|"delivers messages"| node_wsserver
node_wsserver -->|"streams messages"| node_terminal
node_entry -->|"renders"| node_terminal
node_terminal -->|"renders"| node_livepanels
node_redis -->|"supplies ticks"| node_logger
node_logger -->|"archives ticks"| node_sqlite
node_terminal -->|"includes"| node_workstation

click node_generator "https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/backend/generator.js"
click node_ingestion "https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/backend"
click node_wsserver "https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/backend/server.js"
click node_logger "https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/backend"
click node_entry "https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/main.jsx"
click node_terminal "https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/App.jsx"
click node_livepanels "https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/App.jsx"
click node_workstation "https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/frontend/src"

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_generator,node_ingestion,node_redis toneBlue
class node_wsserver toneAmber
class node_entry,node_terminal,node_livepanels,node_workstation toneMint
class node_logger,node_sqlite toneRose
class node_trader,node_exchange toneIndigo
```

## Components

### Market Data

- [Mock Trade Generator](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/backend/generator.js): `backend/generator.js`
- [Exchange Ingestion](https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/backend): `backend`
- **Redis Pub/Sub**

### Backend Services

- [WebSocket Broadcaster](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/backend/server.js): `backend/server.js`

### Trading Workstation

- [React Entry](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Terminal UI](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Trade And Logs](https://github.com/akashdeep-bit-gif/hft-trading-terminal/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Charts And Execution](https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/frontend/src): `frontend/src`

### Time-Series Storage

- [Tick Logger](https://github.com/akashdeep-bit-gif/hft-trading-terminal/tree/main/backend): `backend`
- **Market Data DB**

### Other components

- **Trader**
- **Binance**

## Connections

- Trader → Terminal UI: uses (evidence: `README.md`)
- Binance → Exchange Ingestion: streams ticks (evidence: `README.md`)
- Mock Trade Generator → Redis Pub/Sub: publishes trades (evidence: `backend/generator.js`)
- Exchange Ingestion → Redis Pub/Sub: publishes ticks (evidence: `README.md`)
- Redis Pub/Sub → WebSocket Broadcaster: delivers messages (evidence: `backend/server.js`)
- WebSocket Broadcaster → Terminal UI: streams messages (evidence: `frontend/src/App.jsx`)
- React Entry → Terminal UI: renders (evidence: `frontend/src/main.jsx`)
- Terminal UI → Trade And Logs: renders (evidence: `frontend/src/App.jsx`)
- Redis Pub/Sub → Tick Logger: supplies ticks (evidence: `README.md`)
- Tick Logger → Market Data DB: archives ticks (evidence: `README.md`)
- Terminal UI → Charts And Execution: includes (evidence: `README.md`)
