Skip to content

feat(backfill): platform backfill + strategy module refactor#52

Open
philippWassibauer wants to merge 2 commits intosplit/starter-node-integration-stackedfrom
split/platform-backfill
Open

feat(backfill): platform backfill + strategy module refactor#52
philippWassibauer wants to merge 2 commits intosplit/starter-node-integration-stackedfrom
split/platform-backfill

Conversation

@philippWassibauer
Copy link
Copy Markdown
Contributor

Adds platform backfill page and strategy dashboards, then extracts shared backfill package and decomposes strategy pages into modules.

…de (#36)

* feat: add backfill page to platform app

Port backfill functionality from starter to platform app at
/[crunchname]/backfill. Key differences from starter:

- Uses nodeClient + nodeUrl (from NodeConnectionProvider) instead of
  apiClient proxy — supports multi-node per crunch
- Download links use absolute nodeUrl for direct file access
- Backfill queries invalidated on node URL change
- Added to ROUTE_CONFIG nav between Feeds and Checkpoints

Module structure:
  modules/backfill/
    domain/types.ts — BackfillJob, BackfillFeed, BackfillFile
    infrastructure/services.ts — nodeClient calls with nodeUrl
    application/hooks/ — useBackfillFeeds, Jobs, StartBackfill, Index
    ui/backfillManager.tsx — StartBackfillCard, JobsTable, DataFilesCard

* refactor: remove backfill from starter, upgrade feed monitor

Backfill:
- Remove /backfill page and entire backfill module from starter
- Backfill is a platform-only feature (previous commit)

Feed monitor — port platform improvements to starter:
- Use DataTable component instead of raw Table (sorting, empty states)
- Add freshness Badge (green <2min, warning otherwise) via timeAgo()
- Show live feed data in tabular format with values and latency columns
- Add dropdown filter to scope by source/subject
- Fix field naming: provider/asset → source/subject (matches backend API)
- Increase tail limit from 10 → 50, auto-refresh every 5s

* Revert "refactor: remove backfill from starter, upgrade feed monitor"

This reverts commit f704049.

* fix: upgrade starter feed monitor to match platform

- Use DataTable instead of raw Table (sorting, empty states)
- Add freshness Badge (green <2min, warning otherwise)
- Show live data in tabular format with values and latency columns
- Add dropdown filter to scope by source/subject
- Fix field naming: provider/asset → source/subject (matches backend)
- Increase tail limit from 10 → 50

* Add strategy dashboard pages to starter app

- /strategies — overview table with status, PnL, win rate, drawdown
  Auto-refreshes every 30s, rows link to detail page
- /strategies/[name] — detail view with:
  - Stats cards (PnL, win rate, trades, drawdown, profit factor)
  - Candlestick chart (Chart.js) with buy/sell trade markers, 1h/4h/1d
  - Cumulative PnL line chart
  - Scrollable trade log table
- Added chartjs-chart-financial dependency
- Added Strategies nav link between Metrics and Models

Backend API served by coordinator report-worker (node/api/strategies.py).

* Fix strategies page: fetch without trailing slash

Avoids 308 redirect from Next.js rewrite rules.
…nto modules

- Extract backfill types and shared UI (columns, StartBackfillCard) to
  packages/backfill. Both apps now re-export types from the shared package
  and use shared column definitions + DataTable (platform was using raw
  Table components, now consistent with starter).

- Decompose strategy pages (was 645-line monolith + 197-line list using
  raw fetch/useState) into proper module structure:
  - domain/types.ts: Strategy, StrategyDetail, Trade, Candle
  - infrastructure/endpoints.ts + services.ts: apiClient calls
  - application/hooks/: useGetStrategies, useGetStrategyDetail (React Query)
  - ui/: strategyList, strategyDetail, candlestickChart, pnlChart, tradeLog
  - Page files are now thin wrappers (<10 lines each)
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
coordinator-webapp Ignored Ignored Mar 4, 2026 10:43am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant