A modern React application for tracking cryptocurrency prices and market data.
- Real-time cryptocurrency price tracking
- Search functionality for cryptocurrencies
- Favorites system to track preferred cryptocurrencies
- Responsive design with modern UI
- Price change indicators with color coding
- Market cap information
- 24-hour price change tracking
- React
- Vite
- Ant Design (UI components)
- Tailwind CSS (styling)
- Axios (API calls)
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
The project uses Vitest and React Testing Library for testing. The test setup includes:
- Unit tests for components
- Integration tests for component interactions
- Jest DOM matchers for DOM assertions
To run the tests:
npm testTests are located in __tests__ directories next to their corresponding components. For example:
src/components/__tests__/CryptocurrencyCard.test.jsx
The CryptocurrencyCard component expects the following data structure:
{
id: string, // Unique identifier for the cryptocurrency
name: string, // Full name of the cryptocurrency
symbol: string, // Trading symbol (e.g., 'btc')
quote: {
USD: {
price: number, // Current price in USD
percent_change_24h: number, // 24-hour price change percentage
market_cap: number // Market capitalization
}
}
}The CryptocurrencyCard component accepts the following props:
currencyData: Object containing cryptocurrency data (required)isFavorite: Boolean indicating if the cryptocurrency is in favorites (required)onToggleFavorite: Function to handle favorite toggling (required)
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm test- Run testsnpm run lint- Run ESLint
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License.