Skip to content

Configuration

.env File

The backend/.env file contains all system configurations.

Base Configuration

bash
# Application
APP_NAME="BetIntel"
DEBUG=false
ENVIRONMENT=production

# Database
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=soccer_predictions

# Redis
REDIS_HOST=redis
REDIS_PORT=6379

API Keys (Required)

bash
# Football-Data.org (10 req/min free tier)
FOOTBALL_DATA_API_KEY=your_key_here

# The-Odds-API (500 req/month free tier)
THE_ODDS_API_KEY=your_key_here

# API-Football v3 (100 req/day free tier)
API_FOOTBALL_KEY=your_key_here

# RapidAPI (for advanced odds)
RAPID_API_KEY=your_key_here

# OpenWeatherMap (optional)
OPENWEATHER_API_KEY=your_key_here

Telegram Bot

bash
# Bot token from @BotFather
TELEGRAM_BOT_TOKEN=your_bot_token

# Channel/group Chat ID
TELEGRAM_CHAT_ID=-100xxxxxxxxxx

# Enable notifications
TELEGRAM_ENABLED=true
TELEGRAM_MIN_CONFIDENCE=65.0
TELEGRAM_DAILY_SEND_TIME=09:00

Machine Learning

bash
# Models path
ML_MODELS_PATH=./ml_models

# Prediction thresholds
PREDICTION_CONFIDENCE_THRESHOLD=60
VALUE_BET_THRESHOLD=0.10
MAX_ODDS_FOR_VALUE=5.0

# Bankroll Management
INITIAL_BANKROLL=100.0
MAX_STAKE_PERCENTAGE=0.05
KELLY_FRACTION=0.25

Background Jobs

bash
# Cron expressions
JOB_COLLECT_FIXTURES_CRON=0 */6 * * *      # Every 6 hours
JOB_UPDATE_RESULTS_CRON=*/15 * * * *       # Every 15 min
JOB_GENERATE_PREDICTIONS_CRON=0 8,20 * * * # At 8 and 20
JOB_TRACK_ODDS_CRON=0 */3 * * *            # Every 3 hours

Production Environment Variables

Security

In production, always use secure passwords and never commit the .env file

bash
# Production settings
DEBUG=false
ENVIRONMENT=production
API_DOCS_ENABLED=false  # Disable Swagger in prod

# Database with SSL
DATABASE_URL=postgresql://user:pass@host:5432/db?sslmode=require

# Rate limiting
RATE_LIMIT_FOOTBALL_DATA=10
RATE_LIMIT_RAPID_API=100

Cache TTL

bash
# Cache time (seconds)
CACHE_TTL_MATCHES_LIST=300    # 5 minutes
CACHE_TTL_MATCH_DETAIL=600    # 10 minutes
CACHE_TTL_PREDICTIONS=1800    # 30 minutes
CACHE_TTL_ODDS=180            # 3 minutes

Bookmaker Filtering

bash
# Show only Italian ADM-authorized bookmakers
FILTER_ITALIAN_BOOKMAKERS=true

Configuration Validation

bash
# Verify configuration
docker compose exec backend python -c "from app.core.config import settings; print(settings)"

Next Step

API Setup - How to get API keys

Released under the MIT License.