This document provides an overview of the API endpoints available in the Stadia Championship Predictor application. The API allows clients to interact with the backend services for managing teams, fixtures, simulations, and league standings.
http://localhost:8000/apiPOST /api/league/initializeRequest Body:
{
"teams": [
{
"name": "Manchester City",
"power": 92,
"logo": "GB-ENG"
},
{
"name": "Bayern Munich",
"power": 90,
"logo": "DE"
},
{
"name": "Barcelona",
"power": 86,
"logo": "ES"
},
{
"name": "Liverpool",
"power": 87,
"logo": "GB-ENG"
},
{
"name": "Real Madrid",
"power": 91,
"logo": "ES"
},
{
"name": "Paris Saint-Germain",
"power": 88,
"logo": "FR"
}
]
}Response: League object with initialized state
GET /api/leagueResponse: Complete league state including teams, fixtures, and current week
GET /api/league/standingsResponse:
{
"standings": [
{
"id": "uuid",
"name": "Manchester City",
"power": 92,
"played": 3,
"won": 2,
"drawn": 1,
"lost": 0,
"goalsFor": 7,
"goalsAgainst": 2,
"points": 7
}
]
}POST /api/league/play-next-weekResponse: Updated league state after simulating next week's matches
POST /api/league/play-all-weeksResponse: Final league state after simulating all remaining weeks
PUT /api/league/match/:idRequest Body:
{
"homeScore": 3,
"awayScore": 1
}Response: Updated league state with recalculated standings
GET /api/league/predictionsResponse:
{
"week": 4,
"predictions": [
{
"teamId": "uuid",
"teamName": "Manchester City",
"probability": 67.5
}
]
}POST /api/league/resetResponse: League reset to initial state (no matches played)
GET /healthResponse:
{
"status": "healthy",
"service": "stadia-backend"
}- Access Swagger UI: http://localhost:8000/swagger/index.html
