Skip to content

SimoneGuidi/cryptoboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoBoard — Crypto Dashboard with Python & Flask

A real-time web dashboard showing prices and 7-day trends for Bitcoin, Ethereum, Solana, Cardano, and Dogecoin. Data is fetched from the CoinGecko public API (no key required) and cached server-side.

Tech Stack

  • Python 3 + Flask — REST backend with in-memory cache
  • CoinGecko API — public, no registration or API key needed
  • Chart.js — 7-day line chart, imported via CDN
  • Vanilla JS — fetch API, skeleton loading, event delegation

Architecture

Browser  ──GET /api/prices──────▶  Flask (app.py) ──▶ CoinGecko API
         ◀──JSON [{ coin... }]──
         ──GET /api/history/{id}─▶  Flask (app.py) ──▶ CoinGecko API
         ◀──JSON { prices: [] }──

Flask is not a simple pass-through: it applies a 60-second in-memory cache per endpoint to respect CoinGecko's free-tier rate limit and reduce perceived latency.

Run locally

cd cryptoboard
pip install -r requirements.txt
python app.py

Open http://localhost:5001 in your browser.

Key design decisions

  • In-memory cache with TTL — avoids hitting CoinGecko on every page refresh; Redis would be the production equivalent
  • coin_id allowlist validation — the URL parameter is checked against a fixed set before any external call is made, preventing arbitrary API forwarding
  • Skeleton loading — shimmer placeholders appear instantly while prices load, eliminating blank state
  • Chart update without re-render — clicking a second coin updates chart.data and calls chart.update() for an animated transition instead of destroying and recreating the instance
  • CSS custom properties for coin colors — hex values defined once in :root, consumed by both CSS (card border) and JS (chart line color)

About

Dashboard crypto in tempo reale con Flask e Chart.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors