Real-time crypto price tracker built with Express and EJS. It pulls market data from CoinGecko, renders price cards, and shows a 7-day chart for a single coin.
- Node.js + Express + Axios
- EJS views with partials
- 7-day sparkline charts for coins
- Coin search by id (e.g.,
bitcoin,ethereum) - Server refreshes market data every 30 minutes
- Static assets in
public/(images, styles) - Environment configuration via
.env
- Node.js (16+ recommended)
- npm
- Install dependencies
npm install- Create a
.envfile
PORT=3000
COINGECKO_URL=https://api.coingecko.com/api/v3
API_KEY=your_demo_or_pro_key- Start the app
npm start
# or
node index.js- Open http://localhost:3000 (or the port you set)
GET /Home pageGET /pricesMarket list (top 12 by market cap)GET /search?query=coin-idSingle coin chart (7 days)
.
|-- .env
|-- .gitignore
|-- index.js
|-- package.json
|-- README.md
|-- public/
| |-- images/
| |-- styles/
| |-- main.css
| |-- coin.css
|-- views/
| |-- index.ejs
| |-- prices.ejs
| |-- coin.ejs
| |-- partials/
| |-- header.ejs
| |-- footer.ejs
- CoinGecko rate limits apply; use an API key if required.
- Check
package.jsonfor available npm scripts.
Netlify does not read your local .env file in production. Set these in the Netlify UI or CLI so Functions can access them at runtime:
COINGECKO_URL=https://api.coingecko.com/api/v3API_KEY= your CoinGecko key
CLI example:
netlify env:set COINGECKO_URL https://api.coingecko.com/api/v3
netlify env:set API_KEY your_demo_or_pro_keySubmit issues or pull requests. Keep changes focused and include tests where appropriate.