How shantocrockerie-cloud/trading-assistant works
Trading Assistant is a browser-based market-research and paper-trading terminal, with a separate optional ticker/date research service. The main workflow loads live or simulated candles, displays market context, runs deterministic analysis, and lets users manage session-only paper trades. Optional AI analysis and the separate Python research panel are distinct paths. The graph follows the README and shown call sites; unsampled research-service internals and unshown AI wiring are not expanded.
Main entry points: index.tsx Terminal interface · trading.ts Candle acquisition · __root.tsx Root route and shell · ui Reusable UI components
Components 24
Browser Terminal
- Terminal interface
src/routes/index.tsx - Candle acquisition
src/lib/trading.ts - Session candle simulation
src/lib/trading.ts - Price chart
src/components/trading/price-chart.tsx - Paper-trade tracking
src/routes/index.tsx
Signal Analysis
- Indicators and signal
src/lib/trading.ts - Rule-based analysts
src/lib/trading.ts - Optional AI analyst
src/lib/ai-signal.functions.ts
Research Services
- Ticker/date research panel
src/routes/index.tsx - Python research adapter
backend/app.py
Application Runtime
- Router setup
src/router.tsx - Root route and shell
src/routes/__root.tsx - Reusable UI components
src/components/ui - Class utilities
src/lib/utils.ts - Responsive sidebar
src/components/ui/sidebar.tsx - Mobile breakpoint hook
src/hooks/use-mobile.tsx - Client error reporting
src/lib/lovable-error-reporting.ts - Server error capture
src/lib/error-capture.ts - Server error page
src/lib/error-page.ts - SSR request handler
src/server.ts
Other components
- Terminal user
- Binance candles
- Configured chat API
- TradingAgents workflow
Connections 22
- Terminal user → Terminal interface: uses
- Terminal interface → Candle acquisition: requests candles
src/routes/index.tsx - Candle acquisition → Binance candles: fetches supported pairs
- Candle acquisition → Session candle simulation: falls back to
src/lib/trading.ts - Terminal interface → Price chart: renders chart
src/routes/index.tsx - Price chart → Indicators and signal: calculates EMA
src/components/trading/price-chart.tsx - Terminal interface → Indicators and signal: generates signal
src/routes/index.tsx - Terminal interface → Rule-based analysts: runs analysts
src/routes/index.tsx - Terminal interface → Paper-trade tracking: manages session trades
src/routes/index.tsx - Terminal interface → Optional AI analyst: invokes optional AI
src/routes/index.tsx - Optional AI analyst → Configured chat API: requests analysis
- Terminal user → Ticker/date research panel: starts research
- Ticker/date research panel → Python research adapter: calls local service
- Python research adapter → TradingAgents workflow: adapts workflow
- Router setup → Root route and shell: registers route tree
src/router.tsx - Root route and shell → Reusable UI components: renders terminal route
src/routes/__root.tsx - Responsive sidebar → Mobile breakpoint hook: checks viewport
src/components/ui/sidebar.tsx - Responsive sidebar → Reusable UI components: uses controls
src/components/ui/sidebar.tsx - Reusable UI components → Class utilities: merges classes
src/components/ui/button.tsx - Root route and shell → Client error reporting: reports route errors
src/routes/__root.tsx - SSR request handler → Server error capture: consumes captured error
src/server.ts - SSR request handler → Server error page: renders failure page
src/server.ts