How barathkb09/dashboard-crypto works
Purpose and runtime
This is a Next.js/React cryptocurrency market dashboard. It presents a market overview, coin detail views, and a persistent user watchlist. The app is intended for Vercel deployment (vercel.json) and uses TypeScript, Tailwind CSS, and a shared component library.
Application shell and entry points
The root layout establishes global page structure and styles in app/layout.tsx and app/globals.css. The market overview is the primary entry route at app/page.tsx. Shared site navigation is centralized in components/navigation.tsx, linking the overview, individual coin routes, and watchlist.
Market overview pipeline
The home route composes filtering and tabular market presentation:
• app/page.tsx
• components/market-filters.tsx
• components/market-table.tsx
Filters control the market dataset shown by the table; table rows likely form the navigation boundary into dynamic coin pages. The market data contract is defined in types/crypto.ts, while data acquisition is isolated behind lib/api.ts.
Coin detail route
Dynamic coin pages are handled by app/coin/[id]/page.tsx. The route parameter (id) identifies the selected asset and drives detail-data retrieval through the API boundary. Historical or time-series price visualization is encapsulated in components/price-chart.tsx, separating chart rendering from route-level loading and presentation.
Watchlist state boundary
The watchlist page is app/watchlist/page.tsx, with client-side watchlist behavior concentrated in hooks/useWatchlist.ts. This hook is the key persistence/state boundary: market and detail views can use it to add or remove assets, while the watchlist route resolves and displays the saved selections. Debounced interaction or query updates are available through hooks/useDebounce.ts.
Data, types, and external services
lib/api.ts is the central external-service adapter for cryptocurrency market and pricing data; callers should not couple directly to provider request formats. types/crypto.ts provides shared crypto-domain models across API, table, chart, and page layers. No backend, database, authentication service, or API route layer appears in the repository tree, so user-specific state is likely browser-local rather than server-managed.
Presentation system
Tailwind configuration lives in tailwind.config.ts; reusable UI primitives are under components/ui/. Feature components (components/market-table.tsx, components/price-chart.tsx, and components/market-filters.tsx) compose these primitives rather than owning a separate design system. lib/utils.ts provides shared presentation or utility support.
Main entry points: app/page.tsx Market overview · [id]/page.tsx Coin detail · market-table.tsx Market table · market-filters.tsx Market filters
Components 15
Next.js routes
- Root layout · Establishes global structure and styles.
app/layout.tsx - Market overview
app/page.tsx - Coin detail · Loads the asset selected by id.
app/coin/[id]/page.tsx - Watchlist
app/watchlist/page.tsx
Market features
- Market filters
components/market-filters.tsx - Market table · Displays filtered assets and links into coin routes.
components/market-table.tsx - Price chart · Renders historical price data.
components/price-chart.tsx
Data and state
- Watchlist state · Owns browser-local saved asset selections.
hooks/useWatchlist.ts - Debounced updates
hooks/useDebounce.ts - Crypto API adapter · Isolates market and pricing provider requests.
lib/api.ts - Crypto models · Shared market and price data contract.
types/crypto.ts
Presentation system
- Site navigation
components/navigation.tsx - UI primitives
- Presentation utilities
lib/utils.ts - Global styles
app/globals.css
Connections 23
- Root layout → Global styles: loads
- Root layout → Site navigation: hosts
- Site navigation → Market overview: navigates to
- Site navigation → Coin detail: navigates to
- Site navigation → Watchlist: navigates to
- Market overview → Market filters: composes
- Market overview → Market table: composes
- Market filters → Market table: filters dataset
- Market filters → Debounced updates: debounces updates
- Market table → Coin detail: selects asset
- Market overview → Crypto API adapter: loads markets
- Coin detail → Crypto API adapter: loads asset data
- Coin detail → Price chart: composes
- Watchlist → Watchlist state: reads saved assets
- Market overview → Watchlist state: updates watchlist
- Coin detail → Watchlist state: updates watchlist
- Crypto API adapter → Crypto models: uses models
- Market table → Crypto models: uses models
- Price chart → Crypto models: uses models
- Market filters → UI primitives: composes
- Market table → UI primitives: composes
- Price chart → UI primitives: composes
- UI primitives → Presentation utilities: uses