Files
foxhunt/web-dashboard
jgrusewski 84877e5146 feat: add auth gRPC service + migrate dashboard from REST/WS to grpc-web
Backend (Rust):
- Create proto/auth.proto with Login and RefreshToken RPCs
- Implement AuthGrpcService in services/api with JWT issuance
- Register as unauthenticated service in main.rs (pre-auth)
- Update JWT issuer from foxhunt-api-gateway to foxhunt-api

Dashboard (TypeScript):
- Install @connectrpc/connect-web + @bufbuild/protobuf
- Generate TypeScript proto clients via buf (src/gen/)
- Create grpc.ts transport with JWT interceptor
- Rewrite all useApi hooks to typed gRPC calls
- Replace WebSocket with useGrpcStream server-streaming hooks
- Migrate all 6 pages + 6 components to grpc-web
- Delete api.ts, websocket.ts, useWebSocket.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 00:05:18 +01:00
..

web-dashboard

Foxhunt trading dashboard.

Stack

  • React 19 + TypeScript
  • Vite 7 (dev server and bundler)
  • Tailwind CSS 4
  • TradingView (lightweight-charts 5.1.0) + Recharts
  • Zustand (state) + React Query (server state, staleTime 10s, refetchInterval 15s)

Pages

  1. Trading -- Live positions, orders, market data charts
  2. Risk -- VaR, drawdown, portfolio exposure
  3. ML -- Model status, training metrics, predictions
  4. Performance -- PnL, Sharpe, execution quality
  5. Backtesting -- Strategy replay configuration and results
  6. Config -- System settings, strategy parameters

Auth

Login page with JWT authentication. ProtectedRoute guards on all pages. ErrorBoundary on every route. 401 responses trigger automatic logout.

Development

npm install
npm run dev

Dev server runs on localhost:5173 and proxies API requests to web-gateway at :3000.

Build

npm run build

Production builds disable sourcemaps and use manual chunk splitting (vendor, charts, query).

Project Structure

src/
  pages/       -- Page components (Trading, Risk, ML, etc.)
  components/  -- Shared UI components, charts, tables
  hooks/       -- React Query hooks, WebSocket hooks
  stores/      -- Zustand stores
  api/         -- API client, auth helpers
  types/       -- TypeScript type definitions