Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DJmarketing/Solana-Tracker

Repository files navigation

const readme = `# Solana Price Monitor

A real-time Solana price monitoring service with SMS alerts and web dashboard.

Features

  • 🚀 Real-time Solana price tracking
  • 📱 SMS alerts via Twilio (optional)
  • 📊 WebSocket live updates
  • 📈 Price history and charts
  • 🔔 Customizable alert thresholds
  • 🌐 REST API endpoints
  • 💨 Easy cloud deployment

Quick Start

Local Development

  1. Clone the repository

  2. Install dependencies: ```bash npm install ```

  3. Create a `.env` file with your configuration: ``` PORT=3000 TWILIO_ACCOUNT_SID=your_sid_here TWILIO_AUTH_TOKEN=your_token_here TWILIO_PHONE_NUMBER=+1234567890 ```

  4. Start the server: ```bash npm start ```

  5. Open http://localhost:3000 in your browser

Deployment Options

Deploy to Render (Recommended - Free Tier)

  1. Fork/upload this code to GitHub
  2. Go to render.com
  3. Connect your GitHub account
  4. Create a new "Web Service"
  5. Select your repository
  6. Use these settings:
    • Environment: Node
    • Build Command: `npm install`
    • Start Command: `npm start`
  7. Add environment variables in Render dashboard
  8. Click "Create Web Service"

Deploy to Railway

  1. Install Railway CLI: `npm i -g @railway/cli`
  2. Run: `railway login`
  3. Run: `railway init`
  4. Run: `railway up`
  5. Add environment variables in Railway dashboard

Deploy to Vercel

  1. Install Vercel CLI: `npm i -g vercel`
  2. Run: `vercel`
  3. Follow the prompts
  4. Add environment variables in Vercel dashboard

Deploy to Heroku

  1. Install Heroku CLI
  2. Run: ```bash heroku create your-app-name heroku config:set TWILIO_ACCOUNT_SID=your_sid heroku config:set TWILIO_AUTH_TOKEN=your_token heroku config:set TWILIO_PHONE_NUMBER=+1234567890 git push heroku main ```

API Endpoints

  • `GET /api/price` - Get current Solana price
  • `GET /api/history` - Get price history
  • `GET /api/alerts` - Get recent alerts
  • `POST /api/subscribe` - Subscribe to SMS alerts
  • `POST /api/unsubscribe` - Unsubscribe from alerts
  • `PUT /api/subscription` - Update alert settings
  • `GET /health` - Health check endpoint

WebSocket Events

Connect to WebSocket for real-time updates:

```javascript const ws = new WebSocket('wss://your-app.com');

ws.on('message', (data) => { const message = JSON.parse(data); // Handle price updates and alerts }); ```

Environment Variables

Variable Description Required
PORT Server port (default: 3000) No
TWILIO_ACCOUNT_SID Twilio account SID No
TWILIO_AUTH_TOKEN Twilio auth token No
TWILIO_PHONE_NUMBER Your Twilio phone number No

Setting up Twilio (for SMS)

  1. Sign up at twilio.com
  2. Get a phone number from Twilio
  3. Copy your Account SID and Auth Token
  4. Add them to your environment variables

License

MIT `;

// Export all configuration files module.exports = { packageJson, serverCode, envExample, vercelConfig, renderConfig, railwayConfig, dockerfile, readme };

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published