Conversation
…lity - Fear & Greed: alternative.me -> CMC F&G -> composite from market data - Coins: CoinMarketCap -> CoinGecko fallback (same data shape) - Markets: CoinGecko -> overview built from cached CMC coins - Last-good data is kept (no TTL) and persisted to server/.cache for warm starts - Retry with backoff for CoinGecko/CMC/alternative.me (no retry on 4xx) - /api/cmc/live serves cached list instead of 502 when live update fails - Rate limiter now only applies to /api routes, not static assets - /api/health reports per-dataset availability, source, age and last error - CSP: unsafe-inline scripts only for legacy public/ frontend - Fix pre-existing lint errors in client (usePolling, CoinDetail, main.tsx) - Add vitest suite (35 tests) and GitHub Actions CI (typecheck, tests, lint, build) Co-authored-by: Sebastian <devbadya@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Markets, Coins und Fear & Greed fielen zeitweise aus: Wenn eine externe API (CoinGecko, CoinMarketCap, Alternative.me) nicht antwortete, lief der Cache-TTL ab und die Endpoints lieferten 503. Nach jedem Neustart/Deploy war der Cache zudem komplett leer.
Lösung
Automatische API-Fallbacks:
Letzte gute Daten bleiben erhalten:
server/.cache/: nach Neustart/Deploy sind sofort Daten da (Warm-Start).Härtung (Quick Wins):
/api-Routen, nicht mehr auf statische Assets./api/healthzeigt pro Datensatz: verfügbar, Quelle, Alter, letzter Fehler (ok/degraded/starting).unsafe-inline-Scripts nur noch für das Legacy-Frontend (public/), nicht für den React-Build.Tests & CI:
usePolling,CoinDetail,main.tsx),npm auditauf 0 Findings.Verifiziert
/api/healthweist Quelle und letzten Fehler pro Datensatz aus.