- Respond to WebSocket Ping frames with Pong for keepalive detection
- Refactor WS handler to share sender between broadcast and recv tasks
via Arc<Mutex> (required for pong responses from recv task)
- Add vite production build config: source maps, manual chunk splitting
for vendor/charts/query bundles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend:
- Fail fast on empty JWT_SECRET at startup
- Restrict CORS to explicit methods (GET/POST/PUT/DELETE/OPTIONS) and
headers (Authorization, Content-Type) instead of Any
- Add 1MB request body size limit (DefaultBodyLimit)
- Add gRPC status mappings: DeadlineExceeded->408, Cancelled->499,
AlreadyExists->409, ResourceExhausted->429, Unavailable->503
Frontend:
- Guard ErrorBoundary console.error behind import.meta.env.DEV
- Read VITE_API_URL and VITE_WS_URL from env vars with fallbacks
- Add max reconnect attempts (50) to WebSocket manager
- Tune React Query: staleTime 10s, refetchInterval 15s,
disable refetchOnWindowFocus to prevent thundering herd
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trading tests (7): auth gating, no-service 500, order body validation, cancel/account paths
Risk tests (5): auth gating, no-service 500, emergency stop body validation
Total: 61 tests (up from 49)
Also adds web-dashboard/.env.example for production deployment configuration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- EmergencyControls: aria-label on all buttons and confirmation input
- OrderForm: aria-label and aria-pressed on buy/sell toggle buttons
- DashboardLayout: aria-label on navigation
- StatusBar: aria-live on connection status, aria-hidden on decorative indicator dot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- api.ts: intercept 401 responses, clear tokens, redirect to /login
- websocket.ts: fix backoff ordering (increase before scheduling retry)
- All dashboards: add error banners with retry buttons when API queries fail
- MLDashboard: replace hardcoded regime data with WebSocket metrics stream
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Display logged-in username (from JWT sub claim) in status bar
- Add Sign Out button that clears tokens and disconnects WebSocket
- Fix useWebSocket hook with stable empty topics reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ErrorBoundary: catches unhandled render errors, shows recovery UI
- ProtectedRoute: redirects to /login when not authenticated
- LoginPage: username/password form that calls /api/auth/login
- All dashboard routes now require authentication
- Login page redirects to /trading on success
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ConfigDashboard: merge fetched API config over defaults instead of ignoring it
- TradingDashboard: wire OrderBook with market_data WebSocket topic
- BacktestingDashboard: wire active backtest status polling and trade results
- PerformanceDashboard: wire sortino_ratio from API, add to PerformanceMetrics type
- Remove unused Vite scaffold react.svg asset
- Set page title to "Foxhunt Trading System"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 5: Trading dashboard with candlestick chart (TradingView lightweight-charts v5),
order book, positions table, order form, and orders table with cancel support.
Phase 6: Risk dashboard with radial gauges (VaR, position utilization, drawdown),
drawdown chart, WebSocket-fed alerts panel, and emergency stop controls.
Phase 7: ML dashboard with model cards (DQN/PPO/TFT/Mamba2), ensemble voting
panel, regime state indicator, and training job progress tracking.
Phase 8: Performance dashboard with metric cards and P&L charts, backtesting
dashboard with strategy form and trade list, config dashboard with tabbed
category editor and audit log.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Vite + React 18 + TypeScript project with:
- Tailwind CSS for styling (dark theme, trading-focused color palette)
- React Router with 6 dashboard routes (Trading, Risk, ML, Performance,
Backtest, Config) and keyboard shortcuts (T/R/M/P/B/C)
- TanStack Query for data fetching with auto-refetch
- Shared lib layer: typed API client, WebSocket manager with auto-reconnect
and topic subscriptions, auth (JWT in localStorage)
- React hooks: useAuth, useApi (query/mutation wrappers), useWebSocket
- DashboardLayout with nav tabs and StatusBar (WS connection, auth status)
- Stub pages with placeholder component layouts matching design doc
Vite proxy configured to forward /api/* to gateway at localhost:3000.
TypeScript passes with zero errors, production build succeeds.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>