Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta2/llms.txt

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

Futsal League Manager is a full-stack web application that centralises every aspect of running a futsal competition. League administrators can create seasons, organise groups, schedule matches on specific fields, and manage teams and players — all through a dedicated admin panel. Referees lock matches before editing, record live goals and disciplinary events, and finalise results. Registered fans browse the match calendar, follow their favourite teams, cast outcome predictions, and earn points on a seasonal leaderboard. Anyone can view standings and statistics without an account.

Quick start

Register an account and make your first API calls in minutes.

Matches

Schedule matches, record live events, and view results.

Standings

Automatic league table updates after every completed match.

Admin dashboard

Full control over seasons, groups, teams, and audit logs.

Architecture

Futsal League Manager is a full-stack application split into two independently deployable layers. Frontend — Built with Angular 20 and served as a single-page application. The UI uses Bootstrap 5 for layout, Bootstrap Icons for iconography, SweetAlert2 for confirmations, and jsPDF for generating downloadable PDF reports. Route-level guards (authGuard, adminGuard, noAuthGuard) control access based on the JWT payload decoded in the browser. Backend — A Node.js/Express API (port 3000 by default) with modular route files for each domain: auth, users, matches, teams, players, standings, statistics, admin, seasons, groups, and fields. Password hashing uses bcrypt. Email delivery for verification and password resets uses nodemailer via Gmail. Image uploads are handled by multer and stored on Cloudinary. Scheduled cleanup tasks (for example, removing unverified accounts after 24 hours) run via node-cron. Database — PostgreSQL stores all persistent data across 15 tables covering seasons, groups, teams, players, matches, match events, votes, statistics, and audit logs. The unaccent extension enables accent-insensitive username lookups. Caching and rate limiting — Redis (via ioredis) backs both a caching layer and the Express rate limiter on authentication endpoints (10 requests per IP per 15 minutes). The application falls back to in-memory rate limiting when Redis is unavailable.

User roles

The platform enforces three roles, stored in the users table and embedded in every JWT token.
RoleDescriptionToken lifetime
adminFull access to the admin panel, all CRUD operations on seasons, groups, teams, players, and users, plus audit log visibility.6 hours
refereeCan lock and unlock matches, update live scores, and record match events (goals, yellow cards, red cards).6 hours
userCan browse public data, follow teams, vote on match outcomes, and view their own prediction statistics.7 days
The role is set to user at registration and can only be promoted to referee or admin by an existing administrator through PUT /admin/users/:id.

Key features

Match scheduling

Admins create matches with date, home and away teams, field, group, and phase (group stage, quarter-final, semi-final, or final).

Live scoring

Referees lock a match, then record goals and cards per player in real time. Scores update immediately across the platform.

Automatic standings

Team stats (played, won, drawn, lost, goals for/against, points, cards) are recalculated after every finalised match.

Player statistics

Season-by-season goal tallies, yellow and red card counts, and matches played — queryable per player or as a global ranking.

Prediction voting

Registered users vote local, empate (draw), or visitante on upcoming matches. Correct predictions earn points tracked on a leaderboard.

Admin dashboard

A dedicated /admin interface shows a summary of the active season, plus management pages for competitions, teams, players, and users.

PDF reports

The frontend uses jsPDF and jspdf-autotable to generate downloadable reports from standings and match data directly in the browser.

Team following

Users follow teams with a single toggle. Followed teams surface relevant match and statistics updates on the user’s profile.
Every protected endpoint requires a JWT bearer token. Tokens are issued by POST /login and carry the user’s id, username, and role. Admin and referee tokens expire after 6 hours; regular user tokens after 7 days. Include the token in every authenticated request as Authorization: Bearer <token>.

Build docs developers (and LLMs) love