stock-bot/apps/stock/web-app
2026-10-25 11:31:23 -04:00
..
public refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
src docs: explain strategy replay and durable execution code 2026-10-25 11:31:23 -04:00
.env moved most api stuff to web-api and built out a better monitoring solution for web-app 2025-06-23 09:01:29 -04:00
.env.example moved most api stuff to web-api and built out a better monitoring solution for web-app 2025-06-23 09:01:29 -04:00
eslint.config.js refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
index.html refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
package.json fix(web): make backtest run controls and selection reliable 2026-10-22 14:17:25 -04:00
postcss.config.js refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
README.md docs: align stock readmes with current research platform 2026-10-24 18:59:32 -04:00
tailwind.config.js refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
tsconfig.json work on spider for te 2025-07-06 15:26:47 -04:00
tsconfig.node.json refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
vite.config.ts safety 2026-10-20 18:36:19 -04:00

Stock Bot research workbench

The React application is the primary interface for strategy versions, reproducible backtests, experiments and evidence-linked research. It consumes the TypeScript web API; the authoritative financial simulation runs in Rust behind the orchestrator.

For the whole system, start with Understanding Stock Bot and the backtest walkthrough.

Product areas

Route What is connected
/strategies Strategy families, immutable versions, parameter forms and candidate publication/review.
/backtests Saved configurations, retained dataset selection, durable runs, cancellation, results and reproduction. A saved run has its own reopenable URL.
/experiments Parameter trials, comparison, chronological validation, walk-forward studies and cost sensitivity.
/research Projects, hypotheses, findings and supporting evidence; research-agent grants and budgets have a separate page.
/paper Human review and management of paper deployments. Creating a deployment does not activate it.
/symbols, /exchanges Market catalog and symbol data views.
/dashboard, /system/monitoring, /system/pipeline Existing overview and operational views.

/portfolio, /analytics and /settings are currently placeholders. Implemented research charts and metrics live inside run and experiment views. New canonical runs currently admit one asset and one execution series; legacy results keep their qualification labels.

Source map

Location Purpose
src/app/App.tsx Authentication wrapper and complete route map.
src/features Each workflow's pages, components, hooks and API functions. Start with backtest/ to follow a run.
src/components Shared layout, buttons, dialogs, tables and chart components.
src/lib/api.ts Common API origin and cookie-authenticated request helper.
src/app/AuthGate.tsx Browser authentication flow.

The UI renders saved financial results and sends configuration changes. It does not calculate competing fill, cash or position semantics. PostgreSQL-backed API responses own run status; WebSocket updates prompt refreshes.

Local development

Install and build the workspace from the repository root as described in the root README. From this directory:

bun run dev
bun run build
bun run preview
bun run type-check

These start Vite development, build static assets, preview a build, and check frontend types respectively; run the command you need. React, TypeScript, Vite, Tailwind, Headless UI and Recharts are the main UI dependencies. See package.json for scripts and pinned ranges.

Vite is configured for 127.0.0.1:3000. The API origin is VITE_API_BASE_URL when supplied; otherwise development uses the browser's hostname on port 2003, and production uses the page's own origin. The dev server has no configured API proxy. The backend must be running and allow the frontend origin for authenticated cross-origin requests.

Browser authentication uses HttpOnly session cookies. VITE_API_BASE_URL is a public address, not a place for service credentials. Research runs also need the orchestrator and its configured infrastructure; starting Vite alone supplies the interface only.

Tests and behavior

The workbench browser test exercises the authenticated API and durable workflow using disposable infrastructure. Canonical workbench tests cover retained-input configuration and results. Follow the root test setup for prerequisites rather than using a regular trading database as a test fixture.

Keep loading, empty, failed, cancelled and completed states distinct. Reopening a saved run should read the recorded result, not silently start a new simulation.