Central Bot API server for managing distributed Twitter bots. Deploys to Heroku free tier.
- Device heartbeat monitoring
- Real-time command dispatch
- Fleet status monitoring
- Emergency controls
- Activity logging
- Performance analytics
- Heroku account (free)
- Heroku CLI installed
- Git installed
# 1. Initialize git repo
git init
git add .
git commit -m "Initial Central Bot API"
# 2. Create Heroku app
heroku create your-twitter-central
# 3. Deploy
git push heroku main
# 4. Check logs
heroku logs --tailPOST /api/device/<id>/heartbeat- Device status updatesGET /api/device/<id>/commands- Get pending commandsPOST /api/device/<id>/activity- Log completed activities
POST /api/control/stop/<id>- Stop specific devicePOST /api/control/restart/<id>- Restart specific devicePOST /api/control/emergency_stop_all- Emergency stop all devices
GET /api/status/all- Complete fleet statusGET /api/status/analytics- Aggregated analyticsGET /health- Health check
# Test basic connectivity
curl https://your-app.herokuapp.com/
# Test health check
curl https://your-app.herokuapp.com/health
# Send test heartbeat
curl -X POST https://your-app.herokuapp.com/api/device/test_device/heartbeat \
-H "Content-Type: application/json" \
-d '{"uptime_hours": 1, "actions_today": {"tweets": 5}}'- Python 3.10.8
- Flask web framework
- Gunicorn WSGI server
- Heroku cloud platform