A real-time cryptocurrency tracking application built with React, TypeScript, and Vite. Monitor cryptocurrency prices with live updates, set price alerts, and manage your favorite coins.
- Real-time Price Updates: Live cryptocurrency prices via WebSocket connections
- Price Alerts: Set custom price alerts and receive notifications when triggered
- Favorites Management: Track your favorite cryptocurrencies
- Detailed Charts: View historical price data with interactive charts
- Responsive Design: Mobile-friendly interface with bottom navigation
- React 18 - UI library
- TypeScript - Type-safe development
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- Recharts - Data visualization
- Socket.io Client - Real-time WebSocket communication
- Axios - HTTP client
- REST API for data fetching
- WebSocket (Socket.io) for real-time price updates
- Backend expected at
http://localhost:8000, but the repo is not public
- ApiService: Centralized HTTP client with interceptors
- SocketService: Singleton WebSocket manager with event subscriptions
useSocketConnection- Connection state managementusePriceUpdates- Real-time price update subscriptionsuseCryptos- Crypto list with live updatesuseFavorites- Favorites managementuseAlerts- Alert management
- Initial data fetched via REST API
- WebSocket connection established automatically
- Real-time updates merged into existing state
- Type-safe integration throughout
- Node.js 16+ and npm
- Backend API server running on port 8000
Create a .env file in the root directory:
VITE_API_BASE_URL=http://localhost:8000/api/v1
VITE_SOCKET_URL=http://localhost:8000# Install dependencies
pnpm install
# Start development server
pnpm run devThe app will be available at http://localhost:5173
# Start dev server with hot reload
pnpm run dev
# Build for production
pnpm run build
# Preview production build
pnpm run preview
# Run linter
pnpm run lintsrc/
├── components/ # Reusable UI components
├── pages/ # Route page components
├── hooks/ # Custom React hooks
├── services/ # API and WebSocket services
├── types/ # TypeScript type definitions
└── App.tsx # Root component with routing
/- Dashboard with crypto list/crypto/:id- Individual crypto detail page/alerts- Manage price alerts/favorites- View favorite cryptocurrencies
E2E tests are available using Playwright:
# Run E2E tests (example in e2e/test.py)
python e2e/test.pyThis project uses ESLint for code quality. Run pnpm run lint before committing changes.
MIT