Skip to content

feat: switch currency widget to Frankfurter v2 API#1

Open
melanki wants to merge 1 commit into
mainfrom
feat/frankfurter-currency-api
Open

feat: switch currency widget to Frankfurter v2 API#1
melanki wants to merge 1 commit into
mainfrom
feat/frankfurter-currency-api

Conversation

@melanki

@melanki melanki commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces exchangerate-api.com with frankfurter.dev (v2) as the rate source for the dashboard CurrencyWidget.
  • Updates the server CSP connect-src allowlist accordingly, plus the MSW intercept in DashboardPage.test.tsx and the wiki entry in Dashboard-Widgets.md.
  • Same data.rates[to] field is read, so the widget behavior is unchanged. The new endpoint shape is GET /v2/rates?base={from}&quotes={to} returning { base, date, rates: { [code]: number } }.

Why

Frankfurter is open-source, aggregates data from central banks, and supports historical lookups by date. That historical capability is the reason for the swap — it will be used in a follow-up PR to convert prior-dated expenses for multi-currency budgets. This PR only does the API swap; no UI change.

Test plan

  • npx vitest run src/pages/DashboardPage.test.tsx — 32/32 pass with the updated MSW intercept.
  • Manually try the CurrencyWidget on the dashboard: change source/target currency, click refresh — rate should update.
  • Confirm the CSP doesn't block the request in the browser console.

🤖 Generated with Claude Code

Replaces exchangerate-api.com with frankfurter.dev for the dashboard
Currency widget. Frankfurter is open-source, sourced from central
banks, and supports historical lookups by date — which we'll need for
multi-currency budget conversion in a follow-up change.

Changes:
- CurrencyWidget: fetch /v2/rates?base=&quotes= (same response shape
  for the field we read, data.rates[to]).
- server CSP: swap api.exchangerate-api.com for api.frankfurter.dev in
  connect-src.
- DashboardPage test: update MSW intercept to the new host and v2
  response payload.
- wiki: point readers at Frankfurter and note the upcoming historical
  use case.

Co-Authored-By: Claude Opus 4.7 (1M context) <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