A modern cryptocurrency dashboard built with React 19, TypeScript, Vite, Tailwind CSS v4, and shadcn/ui.
This project is configured as a high-fidelity learning playground, featuring a clean folder structure and predefined custom styling matching the classic 2021 Adrian Hajdin design aesthetic with modern refinements and dark-mode support.
The styling for this project uses Tailwind CSS v4 and is fully dynamic (supporting light and dark mode toggling).
- Sidebar: Dark navy-blue (
#001529) with hover states at#002140and borders at#002b4d. - Content Background: Cool light gray (
#f0f2f5) in Light Mode, and Slate-900 (#0f172a) in Dark Mode. - Card Background: Pure white (
#ffffff) in Light Mode, and Slate-800 (#1e293b) in Dark Mode. - Primary Accent: Ant Design classic blue (
#1890ff), hover (#40a9ff), and active (#096dd9). - Headings & Text: Charcoal (
#1f1f1f) / slate-100 (#f1f5f9) for headings; body text at#595959/ slate-300 (#cbd5e1). - Financial Status Indication: Ant Design Success Green (
#52c41a) and Destructive Red (#ff4d4f). - Border Radius: 6px (
0.375rem) for a clean, professional financial look.
To support structured, scaleable development, the project contains empty placeholder files featuring descriptive headers detailing the purpose of each layer:
src/
├── components/ # Reusable UI components
│ ├── ui/ # shadcn/ui components (Card, Button, Input, Select, etc.)
│ ├── layout/ # Layout shells (Sidebar, Header, MainContent, Breadcrumb)
│ ├── crypto/ # Crypto-specific components (CryptoCard, CryptoList, PriceChart)
│ ├── stats/ # Stats components (StatCard, StatsGrid, TrendIndicator)
│ ├── news/ # News components (NewsCard, NewsGrid)
│ ├── exchange/ # Exchange components (ExchangeCard, ExchangeList)
│ ├── common/ # Shared items (LoadingSkeleton, ErrorFallback, ScrollToTop)
│ └── charts/ # Chart wrappers (Sparkline, AreaChart, CustomTooltip)
├── pages/ # Route-level page components
│ ├── HomePage.tsx
│ ├── CryptocurrenciesPage.tsx
│ ├── CryptoDetailPage.tsx
│ ├── ExchangesPage.tsx
│ └── NewsPage.tsx
├── hooks/ # Custom state & network query hooks
│ ├── useGlobalStats.ts
│ ├── useCoins.ts
│ ├── useCoinDetails.ts
│ ├── useCoinHistory.ts
│ ├── useExchanges.ts
│ ├── useDebounce.ts
│ └── useScrollToTop.ts
├── services/ # Axios instance & CoinGecko service requests
│ └── coinGeckoApi.ts
├── types/ # TypeScript interfaces for API payloads
│ └── crypto.ts
├── lib/ # Shared utilities
│ ├── utils.ts # cn() helper
│ └── formatters.ts # Currency, decimal, and date formatters
├── providers/ # TanStack Query client context provider
│ └── QueryProvider.tsx
├── routes/ # Client-side router declarations
│ └── AppRouter.tsx
├── data/ # Project constants and endpoints
│ └── constants.ts
└── assets/ # Static local asset resources
The following core packages are pre-installed and configured:
- State & Networking:
@tanstack/react-query&axios - Routing:
react-router-dom(React Router v7) - UI Components:
lucide-react,recharts(visualization),date-fns(dates), andsonner(notifications)
All subdirectories are mapped under the @/ prefix to prevent directory-relative imports (e.g. ../../../).
@/components/*maps tosrc/components/*@/hooks/*maps tosrc/hooks/*@/services/*maps tosrc/services/*@/types/*maps tosrc/types/*@/lib/*maps tosrc/lib/*@/providers/*maps tosrc/providers/*@/routes/*maps tosrc/routes/*@/data/*maps tosrc/data/*@/assets/*maps tosrc/assets/*
These configurations can be verified inside vite.config.ts and tsconfig.app.json.
Create a .env file in the root directory (based on .env.example):
VITE_COINGECKO_API_KEY=your_coingecko_api_key_here
VITE_COINGECKO_API_URL=https://api.coingecko.com/api/v3To launch the development server:
pnpm install
pnpm devTo run compilation checks and ESLint verification:
pnpm build
pnpm lint- TypeScript Interfaces: Defined inside crypto.ts for
Coin,CoinDetail,Exchange,NewsArticle, andGlobalStats. - API Service Layer: Implemented inside coinGeckoApi.ts using Axios. Fetches global stats, coin list, coin details, history charts, exchanges, and trending coins.
- React Query Hooks: Setup custom state & networking hooks to fetch data on demand.
- UI Pages & Components: Built core layouts and common helper components:
- RootLayout: Shell structure wrapping navigation components with a responsive main viewport and footer.
- Sidebar: Responsive collapsible sidebar navigation panel with custom active routing states.
- LoadingSkeleton: Modular fallback skeleton structures supporting
stats,list,chart, anddetailvariants. - ErrorFallback: Type-safe error interface catching Axios rate limit (429), server offline, and page not found errors.