A web application that tracks real-time cryptocurrency prices, analyzes sentiment from X (Twitter), and determines slope direction (positive/negative trend) based on historical data.
- Real-time Prices: Fetches current prices for BTC, ETH, SOL, DOGE, and ADA from CoinGecko API
- Sentiment Analysis: Analyzes recent tweets about cryptocurrencies using Twitter API and sentiment analysis
- Slope Analysis: Uses linear regression on historical price data to determine if the trend is positive or negative
- Web Interface: Clean, responsive dashboard displaying all data
- Node.js (v14 or higher)
- Twitter Developer Account with API v2 access (for sentiment analysis)
- Clone or download the project
- Run
npm installto install dependencies - Create a Twitter app at https://developer.twitter.com and get your Bearer Token
- Update
.envfile with your Twitter Bearer Token:TWITTER_BEARER_TOKEN=your_actual_bearer_token_here
- Start the server:
npm start - Open your browser and go to
http://localhost:3000 - The dashboard will load with current prices and slope analysis
- Click "Refresh Data" to update all information
- Copy
.env.exampleto.env - Add your actual Twitter Bearer Token to
.env - Run
npm start
- Connect your GitHub repo to Vercel
- In Vercel dashboard → Project Settings → Environment Variables, add:
COINGECKO_API_URL:https://api.coingecko.com/api/v3TWITTER_BEARER_TOKEN: Your actual Twitter Bearer TokenPORT:3000(optional)
- Deploy
Important: Never commit your .env file - it's in .gitignore for security.
GET /api/prices- Get current cryptocurrency pricesGET /api/sentiment- Get sentiment analysis from TwitterGET /api/predict- Get slope direction analysis
- Backend: Node.js, Express.js
- APIs: CoinGecko, Twitter API v2
- Database: LowDB (JSON-based)
- Frontend: Vanilla JavaScript, HTML5, CSS3, Chart.js
- Libraries: Axios, Sentiment, Regression
- Price data is cached locally at 4-hour intervals for slope analysis
- Twitter API has rate limits; sentiment analysis may be limited
- Slope analysis improves with more historical data (run the app regularly to build history)
- Without a valid Twitter Bearer Token, sentiment analysis will show errors but prices and slope analysis will still work