- Copy
.env.exampleto.envand fill the required values. - Build:
npm install npm run build
- Run locally:
npm start
Build the image:~~~~
npm run docker:buildStart the stack:
npm run docker:upStop the stack:
npm run docker:downdocker-compose up -d prometheus grafana node-exporter
open http://localhost:3001 # admin/admin
- Copy
.env.exampleto.envon the VPS. - Fill in the real secrets and remote proxy URL.
- If you use Hetzner Germany, follow
HETZNER_GERMANY_SETUP.md. - Run the VPS setup helper:
chmod +x setup-vps.sh deploy.sh ./setup-vps.sh
- Then deploy the stack:
./deploy.sh
- Check service health:
docker compose ps docker compose logs -f backend
- Push the repository to GitHub.
- Connect the repo to Vercel.
- Add environment variables in Vercel:
NEXT_PUBLIC_CONTROL_API_URLNEXT_PUBLIC_TELEMETRY_WS_URL
- Use the helper script:
chmod +x deploy-vercel.sh VERCEL_ORG_ID=your_org_id VERCEL_PROJECT_ID=your_project_id ./deploy-vercel.sh
NEXT_PUBLIC_CONTROL_API_URL: URL publique de ton API backendNEXT_PUBLIC_TELEMETRY_WS_URL: WebSocket de télémétrieNEXT_PUBLIC_APP_TITLE: nom affiché dans l’UINEXT_PUBLIC_ENVIRONMENT:production
- The backend stack is designed pour tourner sur un VPS étranger.
- Utilise un proxy résidentiel HTTP/SOCKS5 si l’API Polymarket bloque les IP cloud.
- Si ton budget est serré, garde PostgreSQL en Docker sur le VPS, mais sauvegarde la DB régulièrement.
GET /health/live- liveness probeGET /health/ready- readiness probe (checks Redis and PostgreSQL)GET /health- general health endpoint (alias to readiness)GET /metrics- Prometheus metrics endpoint
POST /api/commands- enqueue bot commandsGET /api/snapshot- latest bot snapshotGET /api/circuit-breaker- circuit breaker stateGET /api/strategy-config- strategy configuration listGET /api/trades- historical tradesGET /api/risk-events- risk events
Run unit and API tests:
npm test