Skip to content

Conversation

@Bobagi
Copy link
Owner

@Bobagi Bobagi commented Dec 25, 2025

Motivation

  • Make the current-price UI explicit about which quote currency is shown and make it more visible to avoid ambiguity (e.g. BTCBRL was showing a value in BRL but not indicating the unit).
  • Provide a convenient reload action for current price lookups so users can refresh the value on demand.
  • Add a lightweight, non-invasive real-time charting experience on the dashboard so multiple independent charts can be added and monitored simultaneously.
  • Back charts with historical klines from Binance to compute per-period min/max and initialize the chart window.

Description

  • Enhanced templates/index.html with a visible current-price-panel, a reload button and improved formatting of price labels using helpers like determineQuoteAssetFromSymbol and buildCurrentPriceLabel so every Current price shows the quote asset (BRL, USDT, BTC, etc.).
  • Reworked the existing symbolDropdown Alpine component to expose currentPriceLabel and a refreshPrice() action, replacing the old currentPriceText behavior and adding a small loading indicator.
  • Implemented a new realTimeChartDashboard Alpine component in templates/index.html that provides a full-width “Add chart” card and allows creating multiple chart cards that poll every 5 seconds, maintain a sliding window of points (configurable window size), render a single highlighted latest point plus the history line, and let each card change period (1Y, 3M, 1M, 1W, 1D).
  • Added internal/service/binance_historical_price_service.go, a BinanceHistoricalPriceService to fetch klines and compute minimum/maximum for a period, exposed a new HTTP endpoint /binance/history and extended server wiring (internal/httpserver/server.go, cmd/server/main.go) and NewServer to include and update the historical-price service.

Testing

  • No automated tests or builds were executed as per the modification instructions.
  • A Playwright screenshot attempt failed due to a missing file context in the browser container (non-blocking for the change).
  • Manual runtime verification is suggested: start the server and visit the dashboard to validate Current price (BRL) labels, the reload button, and add/remove real-time chart cards that update every 5 seconds.
  • All modified files: templates/index.html, internal/service/binance_historical_price_service.go, internal/httpserver/server.go, and cmd/server/main.go were compiled into this change set.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants