Professional cryptocurrency trading dashboard.
Real-time WebSocket prices Β· Portfolio P&L Β· Price Alerts Β· Backtest Β· Compare Β· MultiversX/EGLD native Β· Address Inspector Β· CryptoPanic news Β· Binance WS singleton.
π Live Demo Β· π Changelog Β· π Issues Β· π /egld Dashboard
| Feature | Details |
|---|---|
| π Market Dashboard | Top 50 coins live, sortable by Price / 24h% / MCap / Volume |
| β‘ Binance WebSocket | Singleton priceFeed β batched subscriptions, exponential reconnect |
| πΌ Portfolio Tracker | Add positions with buy price, live P&L per row, 24h%, pie chart, CSV export |
| π Price Alerts | Above/below thresholds β browser Notification API, persisted Zustand |
| β Watchlist | Star any coin, live prices via WS, persistent /watchlist page |
| π Global Search | Cmd+K modal β live filter, keyboard nav βββ΅Esc |
| β¨οΈ Keyboard Shortcuts | D dashboard Β· W watchlist Β· P portfolio Β· A alerts Β· ? help |
| π° Crypto News | CryptoPanic feed per coin, paginated, vote counts |
| π TradingView Charts | Embedded Advanced Chart per coin (SSR-safe dynamic import) |
| Side-by-side dual-chart overlay, normalized to 100% | |
| π§ͺ Backtest | SMA crossover strategy on Binance OHLC klines, equity curve |
| π EGLD Dashboard | MultiversX economics, staking APR, validators, live EGLDUSDT Β· β LIVE |
| π Address Inspector | erd1... wallet lookup β EGLD balance, ESDT tokens, NFTs, recent txs |
| β¨ PriceFlash | Green/red flash 600ms on every price update across all pages |
| π’ LiveDot | Reusable animated live indicator β <LiveDot showLabel /> |
| π Dark / Light Mode | prefers-color-scheme default + manual data-theme toggle |
| π‘οΈ Error Boundary | React class ErrorBoundary β catch + retry UI, no raw stack traces |
| πΊοΈ SEO Sitemap | Dynamic sitemap.ts β home + portfolio + watchlist + top-15 coins + EGLD |
| Layer | Library | Version |
|---|---|---|
| Framework | Next.js App Router | 14 |
| Language | TypeScript | 5.6 |
| Styling | TailwindCSS | 3.4 |
| Server state | @tanstack/react-query | 5 |
| Client state | Zustand + persist | 4.5 |
| Charts | Recharts | 2 |
| HTTP | Axios + retry interceptor | 1.7 |
| Icons | Lucide React | latest |
| Data | CoinGecko API v3 | free / Pro |
| News | CryptoPanic API v1 | free |
| Live prices | Binance WebSocket | public |
| EGLD | MultiversX API | public |
# Install
npm install
# Configure environment
cp .env.example .env.local
# Dev server
npm run dev # http://localhost:3000
# Type check + lint
npm run type-check
npm run lint
# Build
npm run build# CoinGecko (free tier works without key; Pro removes 429 rate limit)
COINGECKO_API_KEY=
NEXT_PUBLIC_COINGECKO_BASE=https://api.coingecko.com/api/v3
# CryptoPanic β news feed per currency
CRYPTOPANIC_API_KEY= # REQUIRED β https://cryptopanic.com/developers/api/
NEXT_PUBLIC_CRYPTOPANIC_BASE=https://cryptopanic.com/api/v1
# MultiversX (EGLD dashboard + Address Inspector)
MULTIVERSX_API_URL=https://api.multiversx.com
NEXT_PUBLIC_MULTIVERSX_EXPLORER=https://explorer.multiversx.com
# Binance WebSocket (public, no auth)
NEXT_PUBLIC_BINANCE_WS_BASE=wss://stream.binance.com:9443
NEXT_PUBLIC_BINANCE_REST_BASE=https://api.binance.com/api/v3
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=CryptoTraderProsrc/
βββ app/ # Next.js App Router
β βββ layout.tsx # Root layout: ThemeProvider, QueryClient, ErrorBoundary, Header
β βββ providers.tsx # ReactQueryDevtools + QueryClientProvider
β βββ globals.css # CSS variables: Nexus palette light/dark, fluid type scale
β βββ page.tsx # / β Dashboard: top coins table, global stats, search modal
β βββ sitemap.ts # Dynamic sitemap (home + portfolio + watchlist + top-15 coins + /egld)
β βββ error.tsx # Global error boundary page
β βββ not-found.tsx # 404 page
β β
β βββ portfolio/page.tsx # /portfolio β table + pie chart, Binance WS live prices
β βββ watchlist/page.tsx # /watchlist β live prices per coin card
β βββ alerts/page.tsx # /alerts β threshold triggers + Notification API
β βββ compare/page.tsx # /compare β side-by-side dual-chart, normalized %
β βββ backtest/page.tsx # /backtest β SMA crossover, equity curve, metrics
β β
β βββ egld/
β β βββ page.tsx # /egld β EGLD KPI cards, staking, validators, wallet input
β β βββ [address]/page.tsx # /egld/erd1β¦ β balance, ESDT tokens, NFTs, recent transactions
β β
β βββ coin/[id]/page.tsx # /coin/[id] β TradingView chart, stats, news, live price
β β
β βββ api/ # Route Handlers β server-side proxy (hides API keys)
β βββ coins/route.ts # GET /api/coins
β βββ coin/[id]/route.ts # GET /api/coin/[id]
β βββ chart/[id]/route.ts # GET /api/chart/[id]?days=
β βββ news/route.ts # GET /api/news?currency=
β βββ global/route.ts # GET /api/global
β βββ search/route.ts # GET /api/search?q=
β βββ egld/route.ts # GET /api/egld β aggregates /economics + /stats, revalidate 30s
β βββ egld/address/
β β βββ [address]/route.ts # GET /api/egld/address/[address] β account + tokens + nfts + txs, revalidate 15s
β βββ alerts/check/route.ts # POST /api/alerts/check
β
βββ components/
β βββ Header.tsx # Sticky nav: logo, links, theme toggle, Cmd+K
β βββ SearchModal.tsx # Cmd+K modal: live filter + keyboard nav
β βββ ErrorBoundary.tsx # React class ErrorBoundary
β β
β βββ charts/
β β βββ PortfolioPieChart.tsx # Recharts PieChart β tooltip, legends, animation
β β βββ PriceLineChart.tsx # Recharts AreaChart β price history
β β βββ CompareChart.tsx # Recharts dual-axis LineChart
β β
β βββ coin/
β β βββ CoinNewsFeed.tsx # Wrapper β CryptoPanicFeed
β β βββ CryptoPanicFeed.tsx # News cards, skeleton, pagination
β β βββ TradingViewWidget.tsx # TradingView Advanced Chart (SSR-safe)
β β
β βββ portfolio/
β β βββ PortfolioTable.tsx # Live dot β, P&L colored, 24h%, remove button
β β
β βββ watchlist/
β β βββ WatchlistCard.tsx # Card with live price + 24h%
β β
β βββ alerts/
β β βββ AlertRow.tsx # Target price, current price, status badge
β β
β βββ egld/
β β βββ EgldKpiCard.tsx # KPI card: icon, label, value, optional delta
β β βββ EgldQuickLinks.tsx # Explorer Β· xExchange Β· xPortal Β· Docs Β· Staking
β β βββ WalletInspector.tsx # erd1β¦ input + validate + navigate to /egld/[address]
β β βββ AddressDetail.tsx # Balance, ESDT list, NFT count, recent txs
β β
β βββ ui/
β βββ Skeleton.tsx # Shimmer skeleton
β βββ Badge.tsx # Color badge (success/error/warning/info)
β βββ Tooltip.tsx # CSS-only accessible tooltip
β βββ Button.tsx # primary / secondary / ghost / danger variants
β βββ PriceFlash.tsx # Wraps any value β green/red flash 600ms on change
β βββ LiveDot.tsx # Animated β indicator β size sm/md, optional label
β βββ CopyButton.tsx # Copy to clipboard β β feedback 1.5s
β
βββ hooks/
β βββ useLivePrice.ts # Single symbol via priceFeed singleton
β βββ usePortfolioLivePrices.ts # portfolioStore + useLivePrices β rows with isLive
β βββ useMultiTickerWS.ts # Direct Binance WS (fallback)
β βββ useTheme.ts # Light/dark with data-theme on <html>
β βββ useKeyboardShortcuts.ts # Global shortcuts, auto-cleanup
β βββ usePortfolioExport.ts # CSV blob download
β βββ useDebounce.ts # Generic debounce
β
βββ lib/
β βββ ws/priceFeed.ts # Singleton Binance WS: subscribe/unsubscribe, batching, reconnect
β βββ api/
β β βββ coingecko.ts # Typed CoinGecko fetchers
β β βββ cryptopanic.ts # CryptoPanic news fetcher
β β βββ multiversx.ts # MultiversX economics + stats + address + tokens + txs
β β βββ binance.ts # Binance klines/OHLC fetcher
β βββ formatters.ts # fmtPrice / fmtLarge / fmtPct / fmtDate / fmtEgld
β βββ cgToBinance.ts # CoinGecko id β Binance USDT symbol map
β βββ egldValidation.ts # isValidEgldAddress(addr) β bech32 erd1 check
β βββ constants.ts # TOP_COINS, DEFAULT_CURRENCY, REFRESH_INTERVALS
β
βββ store/
β βββ portfolioStore.ts # Zustand persist β entries[], addEntry, removeEntry
β βββ watchlistStore.ts # Zustand persist β coinIds[], add, remove, has
β βββ alertsStore.ts # Zustand persist β alerts[], addAlert, updateStatus
β
βββ types/
βββ coingecko.ts
βββ cryptopanic.ts
βββ multiversx.ts # EgldEconomics, EgldStats, MvxAccount, EsdtToken, MvxTx
βββ portfolio.ts # PortfolioEntry, PortfolioRow, AlertEntry
All live prices flow through a single managed WebSocket connection:
wss://stream.binance.com:9443/stream?streams=btcusdt@miniTicker/ethusdt@miniTicker/egldusdt@miniTicker
API:
priceFeed.subscribe(symbol, cb) β unsubscribeFn
priceFeed.getCached(symbol) β TickerPayload | null- Subscriptions from the same React render tick are batched after 40ms β 1 reconnect
- Reconnect: exponential
1.5s β 3s β 6s β 12s β 24s, max 5 retries - Use
useLivePrices(symbols[])β never subscribe to Binance WS directly
Wraps any price value and flashes green/red for 600ms when the value changes:
<PriceFlash value={price}>
{fmtPrice(price)}
</PriceFlash>Used on every live price in Dashboard, Portfolio, Watchlist, and EGLD pages.
Reusable animated live indicator with two variants:
<LiveDot isLive={isConnected} /> // β dot only
<LiveDot isLive={isConnected} showLabel size="md" /> // β LIVECopy any string to clipboard with 1.5s visual confirmation (β Copied):
<CopyButton value="erd1abc..." />| Shortcut | Action |
|---|---|
Cmd+K / Ctrl+K |
Open global search |
D |
Go to Dashboard |
W |
Go to Watchlist |
P |
Go to Portfolio |
A |
Go to Alerts |
? |
Show shortcuts help |
Esc |
Close modal / search |
fmtPrice(42341.5) // "$42,341.50"
fmtPrice(0.000123) // "$0.000123"
fmtLarge(1_230_000) // "$1.23M"
fmtPct(3.45) // "+3.45%"
fmtDate(timestamp) // "May 17, 2026 Β· 01:33"
fmtEgld(1234500000000000000n) // "1.2345 EGLD"All numeric values in the UI must use fmtPrice / fmtLarge / fmtPct / fmtEgld and the tabular-nums CSS class.
CryptoTraderPro has first-class support for the MultiversX ecosystem:
- 8 KPI cards: EGLD Price (live WS
β LIVE), 24h%, Market Cap, Staking APR, Total Staked, Validators, Total Transactions, Total Accounts - Wallet Inspector β enter any
erd1...address, validates bech32, navigates to Address Detail - Quick Links β Explorer Β· xExchange Β· xPortal Β· Docs Β· Staking Providers
PriceFlashon EGLD price +LiveDotindicator
- EGLD balance + USD value (calculated from live WS price)
- MultiversX username (
@alias) if registered - ESDT tokens list β logo, identifier, balance with correct decimals
- NFT/SFT count
- Recent transactions β status icon (β send / β receive), hash, action label, value, timestamp
- CopyButton on address Β· direct link to Explorer
| Route | Data | Revalidate |
|---|---|---|
GET /api/egld |
economics + stats aggregated | 30s |
GET /api/egld/address/[address] |
account + tokens + nfts + txs | 15s |
https://api.multiversx.com/economics
https://api.multiversx.com/stats
https://api.multiversx.com/accounts/{address}
https://api.multiversx.com/accounts/{address}/tokens
https://api.multiversx.com/accounts/{address}/nfts?size=1
https://api.multiversx.com/accounts/{address}/transactions?size=10
| Task | Where to add |
|---|---|
| New coin WS support | src/lib/cgToBinance.ts |
| New external API | src/lib/api/{service}.ts + src/app/api/{service}/route.ts |
| New Zustand store | src/store/{name}Store.ts with persist middleware |
| New page | src/app/{route}/page.tsx + entry in sitemap.ts |
| New WS hook | Build on useLivePrices β never raw Binance WS |
| New UI component | src/components/ui/ β use Nexus CSS variables only |
| Feature | Status |
|---|---|
| Dashboard top coins + search Cmd+K | β v0.5.0 |
| Keyboard shortcuts globale | β v0.5.0 |
| ErrorBoundary + Axios retry 429 | β v0.5.0 |
| Sitemap dinamic SEO | β v0.5.0 |
| priceFeed singleton WS | β v0.7.0 |
| CoinNewsFeed β CryptoPanicFeed | β v0.7.0 |
| usePortfolioLivePrices + pie chart | β v0.8.0 |
| Live dot β per row portfolio | β v0.8.0 |
| PriceFlash animaΘie preΘ schimbat | β v0.9.0 |
| 24h% per row portfolio (from WS) | β v0.9.0 |
| /alerts page cu Notification API | β v0.9.0 |
| /compare dual-chart normalizat | β v0.10.0 |
| /backtest SMA crossover | β v0.10.0 |
| /egld MultiversX dashboard complet | β v0.11.0 |
| /egld/[address] Address Inspector | β v0.11.0 |
| LiveDot + CopyButton components | β v0.11.0 |
| Supabase auth + cloud sync portfolio | π² v1.0.0 |
| Mobile PWA + push notifications | π² v1.0.0 |
| xExchange DEX integration | π² v1.0.0 |
| Multi-chain support (ETH, SOL) | π² v1.1.0 |
Auto-deployed to GitHub Pages via GitHub Actions on every push to main.
# .github/workflows/deploy.yml:
# 1. npm ci + next build
# 2. next export β /out
# 3. Deploy /out to gh-pages branchLive URL: https://gzeu.github.io/CryptoTraderPro
git checkout -b feat/your-feature
npm run dev
npm run type-check
git push origin feat/your-feature
# Open Pull RequestFollow existing code style (Prettier + ESLint config included).
MIT Β© Gzeu