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.

The admin panel, accessible at /admin, is the central control hub for every administrative operation in FutsalLeague Manager. From here, admins can monitor the health of the active season at a glance, review the most recent changes made across the platform, manage users and their roles, and upload optimized images for teams and players. The panel is split into dedicated sections — Teams, Players, Users, Competitions (seasons and groups), and Logs — each designed to keep league administration organized and auditable.

Dashboard summary stats

The dashboard loads aggregate statistics for the active season by calling GET /admin/summary. Pass season_id as a query parameter to scope all counts to a specific season; omit it for global totals.
GET /admin/summary?season_id=3
The response contains two top-level keys:
{
  "stats": {
    "totalTeams": 12,
    "totalPlayers": 144,
    "pendingMatches": 6,
    "totalUsers": 238
  },
  "recentActivity": [ ... ]
}
FieldDescription
totalTeamsTeams with stats or players registered in the season
totalPlayersDistinct players registered in the season via team_players
pendingMatchesMatches with status = 'pendiente' in the season
totalUsersTotal active user accounts across all seasons

Recent activity

The recentActivity array in the summary response contains the last 5 audit log entries. Each entry shows who performed an action and on which entity, giving you a live pulse of changes without navigating to the full logs view.
{
  "recentActivity": [
    {
      "id": 301,
      "user_id": 4,
      "username": "admin",
      "action": "Finalización de partido",
      "entity_type": "match",
      "entity_id": 88,
      "details": { "home_goals": 3, "away_goals": 1, "season_id": "3" },
      "created_at": "2026-05-14T18:45:00.000Z"
    }
  ]
}
The full audit log is available in the Logs section. See Audit logs for filtering and pagination options.

Admin panel navigation

Teams

Create, edit, soft-delete, and restore teams. Assign teams to seasons and groups.

Players

Manage player profiles, squad registration, jersey numbers, and per-season stats.

Users

View registered accounts, promote users to referee or admin, and deactivate accounts.

Competitions

Create and configure seasons and groups that define the structure of each edition.

Matches

Schedule matches, manage the trash/restore cycle, and export season reports.

Logs

Browse the append-only audit log with filters by user, date, and season.

Role-based access

FutsalLeague Manager has three user roles: user, referee, and admin.
CapabilityUserRefereeAdmin
View public match calendarYesYesYes
Vote on match outcomesYesYesYes
Lock and score live matchesNoYesYes
Finalize matchesNoYesYes
Full CRUD on teams, players, seasonsNoNoYes
Manage user rolesNoNoYes
Access audit logsNoNoYes
Upload imagesNoNoYes
Referees can acquire a match lock and record events during a live match, but they cannot create or delete matches, manage seasons, or access the admin log.
All admin panel endpoints require the admin role. Requests from users with the referee or user role will receive a 403 Forbidden response. To promote a user to admin, go to the Users section of the admin panel, find the account by username or email, and change their role from the dropdown. The change takes effect immediately on their next request.

User management

The Users section lets admins search, list, update, and deactivate accounts. List usersGET /admin/users supports search (matches username or email), page, and limit query parameters:
GET /admin/users?search=daniel&page=1&limit=10
Change a user’s rolePUT /admin/users/:id with { "role": "referee" } (valid values: user, referee, admin):
PUT /admin/users/42
{ "role": "referee" }
Deactivate a userDELETE /admin/users/:id performs a soft delete: the user’s is_active flag is set to false and their username and email are anonymized with a __deleted__<timestamp> suffix to preserve referential integrity while making the account inaccessible:
DELETE /admin/users/42
The deactivated account is excluded from all user listings. This action is logged in the audit log.

Image uploads

Admins can upload images for team logos and player photos via POST /admin/upload. The endpoint accepts a multipart/form-data request with a field named image.
POST /admin/upload?folder=teams&filename=team_logo_ajax
Query paramRequiredDescription
folderNoCloudinary folder name (default: general)
filenameNoOptional public ID override in Cloudinary
The file buffer is processed by Sharp for optimization (resizing, compression, format conversion) before being streamed to Cloudinary. The response returns the final CDN URL:
{ "url": "https://res.cloudinary.com/example/image/upload/v123/teams/team_logo_ajax.webp" }
Store the returned URL in the logo_url field when creating or updating a team, or in photo_url when updating a player.
Every admin action — role changes, user deactivations, image uploads, and all CRUD operations on teams, players, seasons, and matches — is recorded in the audit log automatically. There is no way to suppress logging for a specific action, and audit log entries cannot be deleted through the UI.

Build docs developers (and LLMs) love