Skip to content

[codex] Consolidate backend live snapshot routes - #6

Merged
zifanzhou1024 merged 2 commits into
mainfrom
codex/backend-route-consolidation
Apr 30, 2026
Merged

[codex] Consolidate backend live snapshot routes#6
zifanzhou1024 merged 2 commits into
mainfrom
codex/backend-route-consolidation

Conversation

@zifanzhou1024

Copy link
Copy Markdown
Owner

Summary

  • Consolidates server-rendered frontend data loading so snapshot, experimental, and heatmap pages call FastAPI directly through shared server helpers while browser requests keep using same-origin Next proxy routes.
  • Adds a shared FastAPI LiveSnapshotService so snapshot, experimental, heatmap, scenario, and stream routes derive from one cached materialized live snapshot source.
  • Preserves Moomoo and IBKR capabilities, including Moomoo heatmap session routing and backend admin-token forwarding in private mode.
  • Adds Moomoo dashboard source labeling so compatibility collector data is not shown as IBKR-only.

Root Cause

Server-rendered pages and FastAPI routes were each rebuilding or proxying through separate paths, which added redundant hops and duplicated live snapshot assembly. The dashboard also labeled Moomoo compatibility collector output with IBKR-specific text.

Validation

  • pnpm typecheck:web
  • pnpm test:web - 447 passed
  • pnpm test:api - 295 passed
  • pnpm test:contracts - 8 passed
  • pnpm test:scripts - 3 passed
  • pnpm test:collector - 169 passed
  • PYTHONPATH=services/collector:apps/api .venv/bin/pytest services/collector/tests/test_ibkr_config.py -q - 15 passed
  • git diff --check
  • Localhost smoke: /, /experimental, /heatmap, and Next API routes returned 200 with live Moomoo data

@zifanzhou1024
zifanzhou1024 marked this pull request as ready for review April 30, 2026 09:34
@zifanzhou1024
zifanzhou1024 merged commit 05b455a into main Apr 30, 2026
2 checks passed
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