How uzeyr77/prempredictor works
Premier League Predictor serves match and season forecasts through a Flask dashboard and scenario-analysis flow. Requests pass through route handlers and a prediction orchestration service to the statistical engine and repository; the repository reads league and match data and maintains cached results. Separate job endpoints trigger match-data, standings, and cache-refresh tasks. The README documents scheduled updates from Football-Data.org, but sampled job code does not show the API client or its database writes, so those links are marked unverified where appropriate.
Main entry points: prediction_service.py Prediction orchestration · app_factory.py Flask app setup · jobs_routes.py Job endpoints · dashboard_routes.py Dashboard routes
Components 19
Web experience
- Dashboard routes
routes/dashboard_routes.py - Dashboard view
templates/index.html - Scenario routes
routes/scenario_routes.py - Scenario view
templates/scenario.html - Flask app setup
app_factory.py
Prediction services
- Prediction orchestration
services/prediction_service.py - Prediction engine
services/predictions.py - Scenario validation
services/validators.py - Response contracts
models/contracts.py
Data access
- Prediction repository
services/repository.py - Database connection
database.py - PostgreSQL
Data operations
- Job endpoints
routes/jobs_routes.py - Match data update
scripts/jobs/update_match_data.py - Standings update
scripts/jobs/update_league_table.py - Cache refresh
scripts/jobs/refresh_cache.py
Other components
- Dashboard user
- Job scheduler
- Football-Data.org
Connections 28
- Dashboard user → Dashboard routes: requests dashboard
README.md - Dashboard routes → Prediction orchestration: gets summary
routes/dashboard_routes.py - Dashboard routes → Dashboard view: renders
routes/dashboard_routes.py - Dashboard user → Scenario routes: submits scenario
README.md - Scenario routes → Scenario view: renders
routes/scenario_routes.py - Scenario routes → Prediction orchestration: runs scenario
routes/scenario_routes.py - Flask app setup → Dashboard routes: registers
app_factory.py - Flask app setup → Scenario routes: registers
app_factory.py - Flask app setup → Job endpoints: registers
app_factory.py - Flask app setup → Prediction orchestration: constructs
app_factory.py - Flask app setup → Prediction repository: constructs
app_factory.py - Prediction orchestration → Prediction engine: calls modeling
services/prediction_service.py - Prediction orchestration → Prediction repository: reads data
services/prediction_service.py - Prediction orchestration → Scenario validation: validates overrides
services/prediction_service.py - Prediction orchestration → Response contracts: uses response types
services/prediction_service.py - Prediction repository → Database connection: opens connections
services/repository.py - Database connection → PostgreSQL: connects
database.py - Job scheduler → Job endpoints: triggers jobs
README.md - Job endpoints → Match data update: starts update
routes/jobs_routes.py - Job endpoints → Standings update: starts update
routes/jobs_routes.py - Job endpoints → Cache refresh: starts refresh
routes/jobs_routes.py - Job scheduler → Match data update: runs periodically
README.md - Job scheduler → Cache refresh: runs periodically
README.md - Match data update → Football-Data.org: fetches match data
- Match data update → PostgreSQL: syncs records
- Standings update → Football-Data.org: fetches standings
- Standings update → PostgreSQL: syncs records
- Cache refresh → Prediction orchestration: refreshes predictions
scripts/jobs/refresh_cache.py