# black101081/nautilus-web-interface architecture

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

- Interactive diagram: https://gitdiagram.com/black101081/nautilus-web-interface
- Repository: https://github.com/black101081/nautilus-web-interface

## Overview

Nautilus Web Interface is a full-stack trading and administration dashboard. Traders inspect market and account state, manage strategies, orders and positions, configure risk, and run backtests; administrators manage engine components, adapters, settings, monitoring and database operations. The React application calls a FastAPI production server, which exposes trading and admin capabilities backed by Nautilus, SQLite persistence and market-data integrations. The README documents the broad runtime layout; source excerpts establish only selected internal calls, so other subsystem connections are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/App.tsx) (React App), [`backend/database.py`](https://github.com/black101081/nautilus-web-interface/blob/main/backend/database.py) (SQLite Data), [`backend/nautilus_fastapi.py`](https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_fastapi.py) (Production API), [`backend/live_trading.py`](https://github.com/black101081/nautilus-web-interface/blob/main/backend/live_trading.py) (Live Trading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Trading Interface"]
  node_frontend["React App<br/>[App.tsx]"]
  node_trader_views["Trader Views"]
  node_trading_pages["Trading Pages<br/>[OrdersPage.tsx]"]
  node_backtest_view["Backtesting"]
  node_admin_views["Admin Pages<br/>[AdaptersPage.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
  node_ws_client["WebSocket Client<br/>[useWebSocket.ts]"]
end

subgraph group_api["API and Access"]
  node_fastapi["Production API"]
  node_auth_routes["Auth Routes<br/>[auth.py]"]
  node_jwt["JWT Auth<br/>[auth_jwt.py]"]
  node_trading_routes["Trading Routes<br/>[strategies.py]"]
  node_risk_routes["Risk Routes<br/>[risk.py]"]
  node_system_routes["System Routes<br/>[system.py]"]
end

subgraph group_engine["Trading Runtime"]
  node_engine_core["Nautilus Core<br/>[nautilus_core.py]"]
  node_integration["Engine Integration"]
  node_live_trading["Live Trading<br/>[live_trading.py]"]
  node_risk_engine["Risk Checks<br/>[risk_engine.py]"]
  node_strategies["Strategy Set"]
  node_runtime_state["Runtime State<br/>[state.py]"]
end

subgraph group_data["Persistence and Feeds"]
  node_database[("SQLite Data<br/>[database.py]")]
  node_alerts_db[("Alert Store<br/>[alerts_db.py]")]
  node_market_service["Market Data"]
  node_binance["Binance Adapter<br/>[binance.py]"]
end

subgraph group_admin["Administration"]
  node_admin_db["Admin DB API<br/>[admin_db_api.py]"]
  node_db_ops["Database Operations<br/>[database_ops.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
end

node_traders(("Traders"))
node_administrators(("Administrators"))
node_binance_api["Binance API"]

node_traders -->|"use"| node_frontend
node_administrators -->|"use"| node_frontend
node_frontend -->|"routes"| node_trader_views
node_frontend -->|"routes"| node_trading_pages
node_frontend -->|"routes"| node_backtest_view
node_frontend -->|"routes"| node_admin_views
node_frontend -->|"HTTP and WS"| node_fastapi
node_ws_client -->|"opens socket"| node_fastapi
node_auth_routes -->|"authenticates"| node_jwt
node_jwt -->|"reads users; checks revocation"| node_database
node_risk_engine -->|"reads limits and loss"| node_database
node_runtime_state -->|"references"| node_engine_core
node_runtime_state -->|"references"| node_live_trading
node_live_trading -->|"uses persistence"| node_database
node_notifications -->|"uses persistence"| node_database
node_binance -->|"delegates trading"| node_live_trading
node_market_service -->|"fetches prices"| node_binance_api
node_system_routes -->|"reads and saves settings"| node_database
node_system_routes -->|"initializes engine"| node_engine_core
node_db_ops -->|"backs up and optimizes"| node_database
node_fastapi -->|"hosts trading API"| node_engine_core
node_fastapi -->|"serves live prices"| node_market_service
node_fastapi -->|"persists alerts"| node_alerts_db

click node_frontend "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/App.tsx"
click node_trader_views "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/TraderDashboard.tsx"
click node_trading_pages "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/OrdersPage.tsx"
click node_backtest_view "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/BacktestingPage.tsx"
click node_admin_views "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/AdaptersPage.tsx"
click node_api_client "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/lib/api.ts"
click node_ws_client "https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/hooks/useWebSocket.ts"
click node_fastapi "https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_fastapi.py"
click node_auth_routes "https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/auth.py"
click node_jwt "https://github.com/black101081/nautilus-web-interface/blob/main/backend/auth_jwt.py"
click node_trading_routes "https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/strategies.py"
click node_risk_routes "https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/risk.py"
click node_system_routes "https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/system.py"
click node_engine_core "https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_core.py"
click node_integration "https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_integration.py"
click node_live_trading "https://github.com/black101081/nautilus-web-interface/blob/main/backend/live_trading.py"
click node_risk_engine "https://github.com/black101081/nautilus-web-interface/blob/main/backend/risk_engine.py"
click node_strategies "https://github.com/black101081/nautilus-web-interface/tree/main/backend/strategies"
click node_runtime_state "https://github.com/black101081/nautilus-web-interface/blob/main/backend/state.py"
click node_database "https://github.com/black101081/nautilus-web-interface/blob/main/backend/database.py"
click node_alerts_db "https://github.com/black101081/nautilus-web-interface/blob/main/backend/alerts_db.py"
click node_market_service "https://github.com/black101081/nautilus-web-interface/blob/main/backend/market_data_service.py"
click node_binance "https://github.com/black101081/nautilus-web-interface/blob/main/backend/adapters/binance.py"
click node_admin_db "https://github.com/black101081/nautilus-web-interface/blob/main/backend/admin_db_api.py"
click node_db_ops "https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/database_ops.py"
click node_notifications "https://github.com/black101081/nautilus-web-interface/blob/main/backend/notifications.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_frontend,node_trader_views,node_trading_pages,node_backtest_view,node_admin_views,node_api_client,node_ws_client toneBlue
class node_fastapi,node_auth_routes,node_jwt,node_trading_routes,node_risk_routes,node_system_routes toneAmber
class node_engine_core,node_integration,node_live_trading,node_risk_engine,node_strategies,node_runtime_state,node_binance_api toneMint
class node_database,node_alerts_db,node_market_service,node_binance toneRose
class node_admin_db,node_db_ops,node_notifications,node_traders,node_administrators toneIndigo
```

## Components

### Trading Interface

- [React App](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Trader Views](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/TraderDashboard.tsx): `frontend/src/pages/TraderDashboard.tsx`
- [Trading Pages](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/OrdersPage.tsx): `frontend/src/pages/OrdersPage.tsx`
- [Backtesting](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/BacktestingPage.tsx): `frontend/src/pages/BacktestingPage.tsx`
- [Admin Pages](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/pages/AdaptersPage.tsx): `frontend/src/pages/AdaptersPage.tsx`
- [API Client](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [WebSocket Client](https://github.com/black101081/nautilus-web-interface/blob/main/frontend/src/hooks/useWebSocket.ts): `frontend/src/hooks/useWebSocket.ts`

### API and Access

- [Production API](https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_fastapi.py): `backend/nautilus_fastapi.py`
- [Auth Routes](https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [JWT Auth](https://github.com/black101081/nautilus-web-interface/blob/main/backend/auth_jwt.py): `backend/auth_jwt.py`
- [Trading Routes](https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/strategies.py): `backend/routers/strategies.py`
- [Risk Routes](https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/risk.py): `backend/routers/risk.py`
- [System Routes](https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/system.py): `backend/routers/system.py`

### Trading Runtime

- [Nautilus Core](https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_core.py): `backend/nautilus_core.py`
- [Engine Integration](https://github.com/black101081/nautilus-web-interface/blob/main/backend/nautilus_integration.py): `backend/nautilus_integration.py`
- [Live Trading](https://github.com/black101081/nautilus-web-interface/blob/main/backend/live_trading.py): `backend/live_trading.py`
- [Risk Checks](https://github.com/black101081/nautilus-web-interface/blob/main/backend/risk_engine.py): `backend/risk_engine.py`
- [Strategy Set](https://github.com/black101081/nautilus-web-interface/tree/main/backend/strategies): `backend/strategies`
- [Runtime State](https://github.com/black101081/nautilus-web-interface/blob/main/backend/state.py): `backend/state.py`

### Persistence and Feeds

- [SQLite Data](https://github.com/black101081/nautilus-web-interface/blob/main/backend/database.py): `backend/database.py`
- [Alert Store](https://github.com/black101081/nautilus-web-interface/blob/main/backend/alerts_db.py): `backend/alerts_db.py`
- [Market Data](https://github.com/black101081/nautilus-web-interface/blob/main/backend/market_data_service.py): `backend/market_data_service.py`
- [Binance Adapter](https://github.com/black101081/nautilus-web-interface/blob/main/backend/adapters/binance.py): `backend/adapters/binance.py`

### Administration

- [Admin DB API](https://github.com/black101081/nautilus-web-interface/blob/main/backend/admin_db_api.py): `backend/admin_db_api.py`
- [Database Operations](https://github.com/black101081/nautilus-web-interface/blob/main/backend/routers/database_ops.py): `backend/routers/database_ops.py`
- [Notifications](https://github.com/black101081/nautilus-web-interface/blob/main/backend/notifications.py): `backend/notifications.py`

### Other components

- **Traders**
- **Administrators**
- **Binance API**

## Connections

- Traders → React App: use (evidence: `README.md`)
- Administrators → React App: use (evidence: `README.md`)
- React App → Trader Views: routes (evidence: `frontend/src/App.tsx`)
- React App → Trading Pages: routes (evidence: `frontend/src/App.tsx`)
- React App → Backtesting: routes (evidence: `frontend/src/App.tsx`)
- React App → Admin Pages: routes (evidence: `frontend/src/App.tsx`)
- React App → Production API: HTTP and WS (evidence: `README.md`)
- WebSocket Client → Production API: opens socket (evidence: `README.md`)
- Auth Routes → JWT Auth: authenticates (evidence: `backend/routers/auth.py`)
- JWT Auth → SQLite Data: reads users; checks revocation (evidence: `backend/auth_jwt.py`)
- Risk Checks → SQLite Data: reads limits and loss (evidence: `backend/risk_engine.py`)
- Runtime State → Nautilus Core: references (evidence: `backend/state.py`)
- Runtime State → Live Trading: references (evidence: `backend/state.py`)
- Live Trading → SQLite Data: uses persistence (evidence: `backend/live_trading.py`)
- Notifications → SQLite Data: uses persistence (evidence: `backend/notifications.py`)
- Binance Adapter → Live Trading: delegates trading (evidence: `backend/adapters/binance.py`)
- Market Data → Binance API: fetches prices (evidence: `README.md`)
- System Routes → SQLite Data: reads and saves settings (evidence: `backend/routers/system.py`)
- System Routes → Nautilus Core: initializes engine (evidence: `backend/routers/system.py`)
- Database Operations → SQLite Data: backs up and optimizes (evidence: `backend/routers/database_ops.py`)
- Production API → Nautilus Core: hosts trading API (evidence: `README.md`)
- Production API → Market Data: serves live prices (evidence: `README.md`)
- Production API → Alert Store: persists alerts (evidence: `README.md`)
