A full-stack cryptocurrency tracker built with React, Node.js, Express, and MongoDB.
The app fetches live crypto data from the CoinGecko API, displays it in a React dashboard, stores it in a database, and updates data automatically every 10min and every-hour using a cron job.
- Displays top 10 cryptocurrencies with:
Currency NameCurrent price24h price changeMarket capitalizationSorting FeatureHistoical Data(when clicked on coin name)
- Live fetching from CoinGecko API
- Stores current and historical data in MongoDB
- Scheduled cron job updates the database every 10min & 1-hour
- Clean and responsive React dashboard
Frontend runs on https://cryptoappav.netlify.app
Backend runs on https://crypto-app-u7rb.onrender.com
Frontend:
- React.js
- axios
- chart.js & react-chartjs
- CSS
Backend:
- Node.js
- Express.js
- Axios (for API calls)
- node-cron (for scheduled tasks)
- mongoose & mongodb
- CORS & dotenv
Database:
- MongoDB
The backend includes a cron job that runs every hour using node-cron.
- It automatically calls the
CoinGecko API. - Fetches the latest crypto prices and market data
every 10min. - Stores the latest data in the
CurrentCryptocollection. - Appends historical snapshots to
HistoricalCryptofor trend tracking.
This ensures the frontend always displays up-to-date information without manual intervention.
cd backend
npm install
# setup .env
npm run devcd frontend
npm install
npm startThe backend exposes the following endpoints:
Endpoint: GET /api/cryptos
Description:
Returns the latest data for the top cryptocurrencies stored in the CurrentCrypto collection.
This includes:
id— coin identifiername— coin namesymbol— coin symbolcurrent_price— latest price in USDmarket_cap— market capitalizationprice_change_percentage_24h— 24-hour price change percentage
Example Response:
[
[
{
"_id": "690b515b69c295516626a3e5",
"id": "bitcoin",
"name": "Bitcoin",
"symbol": "btc",
"current_price": 102522,
"market_cap": 2044512432188,
"price_change_percentage_24h": -1.11875,
"last_updated": "2025-11-05T13:29:41.331Z",
"__v": 0
},
...
]Endpoint: GET /api/historical/:coinid
Description:
Fetches historical snapshots for a specific cryptocurrency stored in the HistoricalCrypto collection.
Replace :coinid with the coin's id (e.g., bitcoin).
id— coin identifiername— coin namesymbol— coin symbolcurrent_price— latest price in USDmarket_cap— market capitalizationprice_change_percentage_24h— 24-hour price change percentagetimestamp— time
Example Response:
[
{
"id": "bitcoin",
"name": "Bitcoin",
"symbol": "btc",
"current_price": 104572,
"market_cap": 2086033954479,
"price_change_percentage_24h": -2.84248,
"timestamp": "2025-11-04T07:24:08.205Z"
},
...
]
(Add screenshots of your React dashboard here)
Avinash




