An open API service indexing awesome lists of open source software.

https://github.com/brmendez/crypto-lens

Real-time cryptocurrency market tracker built with React, TypeScript, and Vite. Fetches live data from CoinGecko API with light/dark theme toggle.
https://github.com/brmendez/crypto-lens

coingecko-api cryptocurrency css-modules frontend react typescript vite

Last synced: 3 months ago
JSON representation

Real-time cryptocurrency market tracker built with React, TypeScript, and Vite. Fetches live data from CoinGecko API with light/dark theme toggle.

Awesome Lists containing this project

README

          

# CryptoLens
πŸ”— **Live Demo:** https://crypto-lens.onrender.com/

CryptoLens is a minimal, real-time cryptocurrency market tracker built with Vite, React, and TypeScript. It fetches live market data from CoinGecko and displays key metrics for top coins in a clean, theme-switchable interface.

## Features

- **Live Market Data:** Fetches up-to-date prices and 24h changes for major cryptocurrencies using the CoinGecko API.
- **Minimal UI:** No icons, images, or extra stylingβ€”just the essentials for fast, distraction-free tracking.
- **Theme Toggle:** Switch between light and dark modes. Theme preference is saved in localStorage.
- **TypeScript & React:** Built with modern React and TypeScript for reliability and maintainability.
- **Vite Powered:** Fast development and build times with Vite.

## Getting Started

### Prerequisites
- Node.js (v18 or newer recommended)
- npm or yarn

### Installation

```bash
# Clone the repository
$ git clone https://github.com/your-username/crypto-lens.git
$ cd crypto-lens

# Install dependencies
$ npm install
# or
yarn install
```

### Running Locally

```bash
# Start the development server
$ npm run dev
# or
yarn dev
```

Open [http://localhost:5173](http://localhost:5173) in your browser to view the app.

## Project Structure

```
crypto-lens/
β”œβ”€β”€ public/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ components/
β”‚ β”‚ β”œβ”€β”€ CoinListItem.tsx
β”‚ β”‚ β”œβ”€β”€ CryptoTracker.tsx
β”‚ β”‚ β”œβ”€β”€ fetchCoinGeckoMarkets.ts
β”‚ β”‚ β”œβ”€β”€ LoadingSkeleton.tsx
β”‚ β”‚ β”œβ”€β”€ ThemeContext.tsx
β”‚ β”‚ β”œβ”€β”€ types.ts
β”‚ β”‚ └── styles/
β”‚ β”‚ β”œβ”€β”€ CoinCard.module.css
β”‚ β”‚ β”œβ”€β”€ CryptoTracker.module.css
β”‚ β”‚ β”œβ”€β”€ LoadingSkeleton.module.css
β”‚ β”‚ └── theme.module.css
β”‚ β”œβ”€β”€ App.tsx
β”‚ β”œβ”€β”€ main.tsx
β”‚ └── index.css
β”œβ”€β”€ index.html
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ vite.config.ts
└── README.md
```

## API Reference

- [CoinGecko Markets API](https://www.coingecko.com/en/api/documentation)

## Customization

### Adding More Coins
To add more coins or change the data source, update the API URL in `src/components/fetchCoinGeckoMarkets.ts`.

### Styling
Component styles are organized using CSS Modules in `src/components/styles/`:
- `theme.module.css` - Shared theme variables and color palette
- Component-specific `.module.css` files are colocated with their components
- Global styles (resets, fonts, base elements) are in `src/index.css`

To customize colors or theme, edit the CSS variables in `src/components/styles/theme.module.css`.

## License

This project is MIT licensed.

---

*CryptoLens: Fast, simple, and open-source crypto market tracking.*
```