A beautiful, real-time cryptocurrency tracking dashboard built with React and Chart.js, featuring live data from CoinGecko API.
- Real-time Data: Live cryptocurrency prices and market data
- Interactive Charts: Beautiful price charts with Chart.js
- Watchlist: Add/remove cryptocurrencies to your personal watchlist
- Responsive Design: Works perfectly on desktop and mobile
- Market Analytics: Price changes, market cap, volume data
- Search Functionality: Quick search for any cryptocurrency
- Dark/Light Theme: Toggle between themes
- Frontend: React 18.2.0
- Charts: Chart.js 4.4.0
- API: CoinGecko API (Free tier)
- Styling: CSS Modules / Styled Components
- State Management: React Hooks (useState, useEffect)
- HTTP Client: Fetch API
- Node.js (v16 or higher)
- npm or yarn
# Clone the repository
git clone https://github.com/yourusername/crypto-tracker.git
# Navigate to project directory
cd crypto-tracker
# Install dependencies
npm install
# Start development server
npm startThe app will open at http://localhost:3000
- View Market Data: Browse live cryptocurrency prices on the dashboard
- Add to Watchlist: Click the star icon to add coins to your watchlist
- View Charts: Click on any cryptocurrency to view detailed price charts
- Search: Use the search bar to find specific cryptocurrencies
- Toggle Theme: Switch between dark and light modes
Create a .env file in the root directory:
REACT_APP_API_BASE_URL=https://api.coingecko.com/api/v3
REACT_APP_API_KEY=your_api_key_here- API Key Required: While CoinGecko offers public endpoints, the main ones used in this application require an API key for a higher rate limit (50 calls/minute). Please add your key to the .env file as shown in the Installation section.
// Get market data for cryptocurrencies
GET /coins/markets?vs_currency=usd&order=market_cap_desc&per_page=100&page=1
// Get detailed coin information
GET /coins/{id}
// Get historical market data
GET /coins/{id}/market_chart?vs_currency=usd&days=7- Free Tier: 50 calls/minute
- Public API: No authentication required for basic endpoints
crypto-tracker/
βββ public/
β βββ index.html
β βββ favicon.ico
β βββ manifest.json
βββ src/
β βββ components/
β β βββ Dashboard/
β β β βββ Dashboard.js
β β β βββ Dashboard.module.css
β β βββ CoinCard/
β β β βββ CoinCard.js
β β β βββ CoinCard.module.css
β β βββ Chart/
β β β βββ PriceChart.js
β β β βββ PriceChart.module.css
β β βββ Watchlist/
β β β βββ Watchlist.js
β β β βββ Watchlist.module.css
β β βββ SearchBar/
β β βββ SearchBar.js
β β βββ SearchBar.module.css
β βββ hooks/
β β βββ useCryptoData.js
β β βββ useWatchlist.js
β β βββ useLocalStorage.js
β βββ services/
β β βββ cryptoAPI.js
β βββ utils/
β β βββ formatters.js
β β βββ constants.js
β βββ styles/
β β βββ global.css
β β βββ themes.css
β βββ App.js
β βββ App.css
β βββ index.js
βββ .env.example
βββ .gitignore
βββ package.json
βββ README.md
βββ LICENSE
# Start development server
npm start
# Build for production
npm run build
# Run tests
npm test
# Lint code
npm run lint
# Format code
npm run formatInstall recommended extensions:
- ES7+ React/Redux/React-Native snippets
- Prettier - Code formatter
- ESLint
- Auto Rename Tag
- Bracket Pair Colorizer
Use these VS Code snippets for faster development:
React Functional Component (rfc)
import React from 'react';
import styles from './ComponentName.module.css';
const ComponentName = () => {
return (
<div className={styles.container}>
{/* Component content */}
</div>
);
};
export default ComponentName;Custom Hook (chook)
import { useState, useEffect } from 'react';
const useCustomHook = () => {
const [state, setState] = useState(null);
useEffect(() => {
// Effect logic
}, []);
return { state, setState };
};
export default useCustomHook;We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use ESLint and Prettier for code formatting
- Follow React best practices
- Write meaningful commit messages
- Add comments for complex logic
This project is licensed under the MIT License - see the LICENSE file for details.
- CoinGecko for providing free cryptocurrency API
- Chart.js for beautiful charting library
- React team for the amazing framework
If you have any questions or need help, please:
- Open an issue on GitHub
- Check existing issues for solutions
- Contact the maintainers
β Don't forget to star this repository if you found it helpful!