-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration Reference
Complete guide to all environment variables for BetTrack MCP Server and Dashboard.
- MCP Server Configuration
- Dashboard Backend Configuration
- Dashboard Frontend Configuration
- Configuration by Deployment Type
- Common Issues
Environment variables for the BetTrack MCP Server running in Claude Desktop.
Type: String
Required: Yes
Description: API key from The Odds API for accessing live betting odds
How to get:
- Visit https://the-odds-api.com
- Sign up for a free account
- Copy your API key from the account dashboard
- Free tier: 500 requests per month
Example:
ODDS_API_KEY=abc123def456ghi789jkl012mno345Type: Comma-separated string
Required: No
Default: All bookmakers included
Description: Filter odds results to only specific sportsbooks
Common bookmakers:
-
draftkings- DraftKings -
fanduel- FanDuel -
betmgm- BetMGM -
caesars- Caesars Sports -
barstool- Barstool Sports -
pointsbet- PointsBet -
bet365- Bet365 -
bovada- Bovada -
williamhill- William Hill
Example:
# Focus on major US sportsbooks
BOOKMAKERS_FILTER=draftkings,fanduel,betmgmNote: Filtering reduces API quota usage and focuses results on your preferred books.
Type: Integer
Required: No
Default: 5
Description: Maximum number of bookmakers to include in odds results per game
Example:
BOOKMAKERS_LIMIT=3Use case: Show only top 3 bookmakers to keep API response sizes small.
Type: String
Required: No
Default: INFO
Description: Logging verbosity level
Valid values:
-
DEBUG- Detailed debug information -
INFO- General information (default) -
WARNING- Warning messages only -
ERROR- Error messages only -
CRITICAL- Critical errors only
Example:
LOG_LEVEL=DEBUG # For troubleshootingEnvironment variables for the Node.js backend server.
Use individual variables to build the connection string:
DATABASE_TYPE=postgresql
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_NAME=sports_betting_dashboard
DATABASE_USER=sports_user
DATABASE_PASSWORD=sports_password_change_in_productionPriority: If DATABASE_URL is set, these variables are ignored.
Provide a complete connection string:
DATABASE_URL=postgresql://sports_user:sports_password@localhost:5432/sports_betting_dashboardFormat: postgresql://username:password@host:port/database
Note: Use this option for cloud-hosted databases (Heroku, AWS RDS, Railway, etc.)
Type: String
Required: Yes (for odds sync jobs)
Description: Same as MCP server - required for backend to fetch and sync odds
ODDS_API_KEY=your_odds_api_key_hereType: String
Required: No
Description: Optional API key for API-Sports (alternative sports data source)
Type: String
Default: pro
Valid values: basic, pro, advanced
Description: API-Sports subscription tier (if using API_SPORTS_KEY)
Type: Integer
Required: No
Default: 3001
Description: Port for Express server to listen on
PORT=3001Type: String
Default: development
Valid values: development, production, test
Description: Environment mode for optimizations and logging
Type: String
Required: Yes
Description: Public base URL for the backend server
Examples:
# Development
BASE_URL=http://localhost:3001
# Production
BASE_URL=https://api.bettrack.example.comType: String
Required: Yes (for frontend requests)
Description: URL of the frontend application (for CORS headers)
Examples:
# Development
CORS_ORIGIN=http://localhost:5173
# Production
CORS_ORIGIN=https://bettrack.example.comType: String
Default: none
Valid values: none, oauth2
Description: Authentication strategy
Options:
-
none- Standalone mode, no user authentication -
oauth2- Multi-user with OAuth2 (requires Microsoft/Google config)
Type: String
Required: Yes (if AUTH_MODE=oauth2)
Description: Secret key for session encryption
Generate a secure value:
openssl rand -hex 32Type: String
Required: Yes (if using API token authentication)
Description: Secret key for JWT token signing
Generate a secure value:
openssl rand -hex 32Only required if AUTH_MODE=oauth2.
MICROSOFT_CLIENT_ID=your_client_id
MICROSOFT_CLIENT_SECRET=your_client_secret
MICROSOFT_TENANT_ID=commonGOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secretType: Boolean
Default: true
Description: Enable WebSocket connections for real-time game updates
Type: Integer
Default: 15000
Description: Interval in milliseconds for polling live game stats
STATS_POLL_INTERVAL_MS=15000 # 15 secondsType: Integer
Unit: Minutes
Default: 10
Description: How often to sync fresh odds from The Odds API
ODDS_SYNC_INTERVAL=10 # Sync every 10 minutesType: Boolean
Default: false
Description: Automatically run database migrations on startup
Use cases:
- Docker deployments where migrations should auto-run
- CI/CD pipelines
- Development environments
AUTO_MIGRATE=trueType: String
Required: No
Description: Redis connection URL for caching and session storage
Format:
REDIS_URL=redis://localhost:6379Environment variables for the React application.
Type: String
Required: Yes
Description: Base URL for backend API requests
Examples:
# Development
VITE_API_URL=http://localhost:3001/api
# Production
VITE_API_URL=https://api.bettrack.example.com/apiNote: Must include /api path; frontend appends routes to this URL.
Minimum required:
ODDS_API_KEY=your_api_key_hereOptional:
BOOKMAKERS_FILTER=draftkings,fanduel
BOOKMAKERS_LIMIT=3
LOG_LEVEL=INFOBackend .env:
DATABASE_HOST=postgres
DATABASE_PORT=5432
DATABASE_NAME=bettrack
DATABASE_USER=bettrack_user
DATABASE_PASSWORD=secure_password
ODDS_API_KEY=your_odds_api_key
SESSION_SECRET=<openssl rand -hex 32>
JWT_SECRET=<openssl rand -hex 32>
NODE_ENV=production
BASE_URL=http://localhost
CORS_ORIGIN=http://localhost
AUTO_MIGRATE=true
PORT=3001Frontend .env:
VITE_API_URL=http://localhost/apiUse Docker secrets for sensitive values:
Create secrets:
mkdir -p secrets
echo -n "your_odds_api_key" > secrets/odds_api_key.txt
echo -n "$(openssl rand -hex 32)" > secrets/session_secret.txt
echo -n "$(openssl rand -hex 32)" > secrets/jwt_secret.txtBackend .env:
DATABASE_HOST=postgres
DATABASE_NAME=bettrack
DATABASE_USER=bettrack_user
NODE_ENV=production
BASE_URL=https://api.example.com
CORS_ORIGIN=https://example.com
AUTO_MIGRATE=false
# Secrets are loaded automatically from /run/secrets/Priority order:
- Docker secrets (
/run/secrets/*) - Environment variables
- .env file values
Cause: Missing or incorrectly set API key
Solutions:
- Verify key is set in your
.envfile (no trailing spaces) - For MCP: Check config directory path matches your OS
- Restart Claude Desktop after changing .env
- Get a new key from the-odds-api.com
Cause: Incorrect DATABASE_URL or database not running
Solutions:
- Verify PostgreSQL is running:
psql -U postgres - Check DATABASE_URL format is correct
- Ensure database user exists:
CREATE USER sports_user WITH PASSWORD 'password'; - Create database:
CREATE DATABASE sports_betting_dashboard;
Cause: CORS_ORIGIN doesn't match frontend URL
Solutions:
- Check CORS_ORIGIN matches exactly (including protocol and port)
- Frontend at
http://localhost:5173→ setCORS_ORIGIN=http://localhost:5173 - Restart backend after changing CORS_ORIGIN
Cause: Free tier limit (500 requests/month) reached
Solutions:
- Upgrade to paid tier at the-odds-api.com/pricing
- Increase
ODDS_SYNC_INTERVALto sync less frequently - Use
BOOKMAKERS_FILTERto reduce response size and requests
- Installation Guide - Full setup walkthrough
- Troubleshooting - Common problems and solutions
- Quick Start - Get running in 5 minutes