Skip to content

fix(dashboard): stat cards, trend percentages, rolling windows + Render deploy#262

Open
BigBen-7 wants to merge 1 commit into
StellarCommons:mainfrom
BigBen-7:fix/dashboard-data-and-render-deploy
Open

fix(dashboard): stat cards, trend percentages, rolling windows + Render deploy#262
BigBen-7 wants to merge 1 commit into
StellarCommons:mainfrom
BigBen-7:fix/dashboard-data-and-render-deploy

Conversation

@BigBen-7
Copy link
Copy Markdown
Contributor

Fixes three real-data issues discovered after #67 merged, plus Render Blueprint.

Bugs Fixed

1. BASE FEE / AVG FEE always blank

FeeCharged was using avg as the serde field name, but Horizon fee_stats
returns "mode" — the whole /fees/current parse silently failed every time,
leaving both stat cards empty.
Fix: #[serde(rename = "mode")] on FeeCharged::avg.

2. Trend panel showing 0.0% always

InsightsConfig had windows of 1h/6h/24h, but the UI labels them 5min/1h/24h.
Because the windows were too wide, all three buffers held identical data on any
busy network, making all rolling averages equal and all trend deltas 0.0%.
Fix: Changed to minutes(5)/hours(1)/hours(24).

3. Integration test updated

Added a data point within the new 5-minute short-term window so the engine
integration test still passes.

New: Render Blueprint

render.yaml deploys the full stack to Render.com:

  • Backend: Docker (Rust/Axum); reads PORT env automatically via config fallback
  • Frontend: Node/Next.js; BACKEND_URL linked via fromService
  • Keep-alive cron: pings /health every 14 min to prevent free-tier cold starts

Generated with Claude Code

….yaml

FeeCharged serde fix:
- Horizon fee_stats returns "mode" not "avg"; serde was failing the
  whole /fees/current parse → BASE FEE and AVG FEE always showed blank
- Add #[serde(rename = "mode")] to FeeCharged::avg; update test fixtures

Rolling window durations:
- Config had 1h/6h/24h but UI labels 5min/1h/24h → all windows returned
  identical averages and trend showed 0.0% always
- Changed to minutes(5)/hours(1)/hours(24) to match UI labels
- Update integration test: add point inside the 5-min window

config.rs PORT fallback:
- Backend now reads PORT env as fallback for API_PORT; Render injects
  PORT=10000 automatically, no override needed in render.yaml

render.yaml (new):
- Blueprint: backend (Docker/Rust), frontend (Next.js), keep-alive cron
- Cron pings /health every 14 min to prevent free-tier cold starts
- Frontend BACKEND_URL references backend service via fromService

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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