A real-time cryptocurrency tracking application built with React, TypeScript and Material-UI.
- React + TypeScript: For type-safe component development
- Material UI: For consistent and responsive UI components
- Chart.js: For interactive price history charts
- Axios: For API requests with custom caching layer
- React Router: For client-side routing
- TSS: For type-safe CSS-in-JS styling
- Custom hook
useApiCache
for optimized data fetching with caching - Context API for global state management (currency selection)
- Responsive design with mobile-first approach
- Component-based architecture with clear separation of concerns
Challenge: CoinGecko's free API has strict rate limits that were causing request failures.
Solution:
- Implemented caching layer with
useApiCache
hook - Added error handling for rate limit responses
- Set cache duration to 30 seconds to reduce API calls
- Added CORS proxy to handle API restrictions
- Node.js (v16 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/yourusername/crypto-tracker.git cd crypto-tracker
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory. -
Start the development server:
npm run dev
-
Build the application:
npm run build
- The application uses CoinGecko's free API, which has rate limits.
- A CORS proxy is required for API access.
- Cache duration is set to 30 seconds by default.
- Fork the repository.
- Create your feature branch:
git checkout -b feature/AmazingFeature
- Commit your changes:
git commit -m 'Add some AmazingFeature'
- Push to the branch:
git push origin feature/AmazingFeature
- Open a Pull Request.