Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danielsl4/TFG_DAM_2526/llms.txt

Use this file to discover all available pages before exploring further.

Teams and players are the core entities that populate every match, standings table, and statistics ranking in FutsalManager. Team profiles carry contact and visual identity information; player profiles track biographical data. Both are season-aware: rosters, statistics, and match participation are always scoped to a specific season, defaulting to the active one when no season_id is provided.

Team profile

A team record stores the following fields:
FieldDescription
nameOfficial team name
logo_urlURL to the team’s logo image (uploaded via Cloudinary)
kit_colorPrimary kit colour (hex or colour name)
delegateName of the team delegate or contact person
coachHead coach name
phoneContact phone number
These fields are set by admins when creating or editing a team and are displayed on the public team profile page.

Team season data

When you request a team’s detail (GET /teams/:id), the response includes season-specific data alongside the static profile fields.
The list of players registered to the team for the requested season, ordered by jersey number (numeric sort, then alphabetical for non-numeric or missing numbers). Each entry includes:
  • id and name
  • photo_url
  • jersey_number (the number the player wears in this specific season)
  • goals scored in the current season (from player_stats)
A single team_stats row for the requested season and group, containing all standings fields: points, played, won, drawn, lost, goals_for, goals_against, yellow_cards, red_cards, and the group name. Returns null if the team has no stats yet (e.g. no matches played).
All matches involving the team for the requested season, ordered by date ascending. Each entry includes both teams, the score (if played), the field, and the match status. The response also includes a filtered upcomingMatches list containing only matches still in pendiente status.

Team following

Authenticated users can follow or unfollow any team with a single toggle endpoint. The follow state is stored in the team_followers join table.
POST /teams/:id/toggle-follow
Authorization: Bearer <token>
The response returns { "isFollowing": true } or { "isFollowing": false } depending on the new state. When you fetch a team’s detail while authenticated, the isFollowing field in the response reflects whether the current user follows that team.
Use isFollowing to conditionally render a “Follow” or “Unfollow” button on the team profile page without a separate API call.

Player profile

A player record contains:
FieldDescription
nameFull player name
birth_dateDate of birth (used for age calculations and eligibility)
photo_urlURL to the player’s profile photo
The player detail endpoint (GET /players/:id) also returns the player’s current team (from the active season’s team_players record) and their season statistics.

Player season statistics

When fetching a player detail, the backend joins player_stats for the active season. The stats object includes:
FieldDescription
goalsGoals scored in the season
yellow_cardsYellow cards received
red_cardsRed cards received
matches_playedMatches in which the player appeared in at least one event
matches_played is incremented atomically at match finalization for every player who has at least one event (goal or card) recorded in that match. Players who were on the pitch but had no events are not counted.

Paginated team and player lists

Both the team list (GET /teams) and the admin player list (GET /players) support pagination and search.
GET /teams?season_id=3&page=2&limit=10&search=tigres
ParameterDefaultDescription
season_idFilter to teams active in this season
page1Page number (1-indexed)
limit10Results per page
search""Case-insensitive name search (ILIKE)
When season_id is provided, only teams that have entries in team_stats or team_players for that season are returned. This filters out teams from past seasons automatically.The response includes a pagination object:
{
  "teams": [ ... ],
  "pagination": {
    "total": 24,
    "page": 2,
    "limit": 10,
    "totalPages": 3
  }
}

Season-aware defaults

All team and player queries default to the active season when season_id is not specified. The active season is the one where seasons.is_active = true. This means:
  • GET /teams/:id without season_id shows the current squad and current standings.
  • GET /players/:id without season_id shows stats from the active season.
  • Passing an explicit season_id lets you browse historical seasons without modifying the active season record.
Only one season can be active at a time. Admins manage season activation from the admin panel. See Managing seasons for details.

Teams API endpoints

Full reference for list, detail, create, update, delete, follow, and roster endpoints.

Players API endpoints

Full reference for player detail, list, create, edit, register, and unregister endpoints.

Player and team statistics

Season-wide rankings built from the same stats stored on player and team records.

Match scheduling

How matches reference teams and record per-player events that feed stats.

Build docs developers (and LLMs) love