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=6379API 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_hereTelegram 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:00Machine 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.25Background 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 hoursProduction 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=100Cache 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 minutesBookmaker Filtering
bash
# Show only Italian ADM-authorized bookmakers
FILTER_ITALIAN_BOOKMAKERS=trueConfiguration 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