Skip to content

15 - React UI And Analytics Surfaces

Application Shell

frontend/src/App.tsx defines public, authenticated, standard-layout, and full-width routes. frontend/src/components/layout/Layout.tsx owns the standard navigation shell; FullWidthLayout.tsx is used for dense workspaces. frontend/src/config/navigation.ts determines visible navigation groups.

Operational Pages

AreaRoutes/pages
AccountDashboard, OrderBook, TradeBook, Positions, Holdings
AutomationStrategy, Chartink, Python Strategy Host, Flow
ExecutionAction Center, Analyzer, Sandbox, Scalping
MonitoringPnL Tracker, Latency, Traffic, Health, Security, Logs
ConfigurationAPI key, broker credentials, admin, Telegram, WhatsApp
DataSearch, Historify, Download, Master Contract

Account pages combine TanStack Query with Socket.IO-triggered refreshes. The active broker capability store controls exchange/feature options; app mode comes from the backend analyzer setting.

Analytics And Trading Tools

Current routed tools include:

RoutePurposeBackend source
/strategybuilderMulti-leg payoff, Greeks, P&L, strategy chart, OIMultiple strategy services
/optionchainLive option chain and quick executionoption_chain_service.py
/ivchartHistorical IV/Greeks chartsiv_chart_service.py
/ivsmileCall/put IV smile and skewiv_smile_service.py
/volsurface3D volatility surfacevol_surface_service.py
/gexGamma exposure by strikegex_service.py
/gammadensityGamma-times-OI and convexity zonesgamma_density_service.py
/oitrackerOI bars and PCRoi_tracker_service.py
/oirangeClient-side strike-range OI viewOption-chain API
/oiprofileCandles plus OI profileoi_profile_service.py
/maxpainMax-pain distributionOI tracker max-pain route
/straddleATM straddle chartstraddle_chart_service.py
/straddlepnlCustom multi-leg straddle chartcustom_straddle_service.py
/arbitrageFutures calendar-spread scannerarbitrage_service.py
/scalpingKeyboard execution and server-side stop riskscalping.py, risk monitor

The tool list is not fixed at twelve; navigation and routes are the current source of truth.

Live Data

Tools use the shared MarketDataManager through hooks rather than opening ad hoc browser feeds. Continuous option-chain or price views merge initial REST snapshots with WebSocket ticks. Pages use visibility controls and stale-data fallbacks to avoid unnecessary broker traffic.

Shared Components

  • components/trading/: order dialog, market depth, quote header, GTT and basket execution.
  • components/strategy-builder/: leg editor, payoff, Greeks, P&L, strategy charts, portfolio save.
  • components/option-chain/: column configuration and bar settings.
  • components/scalping/: chart and stop-loss dialog.
  • components/ui/: local Radix/shadcn-style primitives.

Error And Loading Behavior

TanStack Query owns request states. Route modules are lazy-loaded, ErrorBoundary.tsx handles render failures, PageLoader covers route loading, and Sonner-based helpers in frontend/src/utils/toast.ts expose categorized user feedback.

Key Files

FilePurpose
frontend/src/App.tsxRoute inventory
frontend/src/config/navigation.tsNavigation inventory
frontend/src/api/trading.tsAccount/trading client
frontend/src/hooks/useOrderEventRefresh.tsEvent-driven account refresh
frontend/src/lib/MarketDataManager.tsShared market-data subscriptions
blueprints/react_app.pyProduction SPA route serving