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.

Your profile is your personal dashboard within FutsalManager. It shows who you are, how well you are doing in the match predictor, and what is coming up for the teams you follow. The profile page is only accessible when you are logged in — the Angular app enforces this via authGuard, which redirects unauthenticated visitors to /login.

What your profile contains

Account details

Your username and email address, as stored when you registered.

Porra score and rank

Your total prediction points and your position in the global leaderboard.

Followed teams

A grid of every team you follow, each linking to the team’s detail page.

Upcoming matches

The next five pending matches for all the teams you follow, from the active season.

Fetching your profile data

The Angular ProfileComponent (route: /profile) calls two endpoints on load and combines the results:

Full profile — GET /user/profile

Returns your basic account information, the list of teams you follow, and their upcoming matches. Requires authentication.
curl https://your-api/user/profile \
  -H "Authorization: Bearer <your-token>"
{
  "user": {
    "id": 42,
    "username": "maria_gol",
    "email": "[email protected]"
  },
  "followedTeams": [
    {
      "id": 5,
      "name": "FC Rápidos",
      "logo_url": "https://..."
    }
  ],
  "upcomingMatches": [
    {
      "id": 101,
      "date": "2026-05-20T18:00:00",
      "status": "pendiente",
      "homeTeam": { "name": "FC Rápidos", "logoUrl": "https://..." },
      "awayTeam": { "name": "Norte United", "logoUrl": "https://..." },
      "field": { "name": "Pabellón Central", "location": "Calle Mayor 1" },
      "userVote": "local",
      "votingStats": { "local": 12, "draw": 5, "away": 8, "total": 25 }
    }
  ]
}
The upcomingMatches array is capped at five entries and only includes matches from the currently active season with a future date.

Porra stats — GET /statistics/user-stats

Returns your total points, global rank, and your last 20 vote history entries. Requires authentication.
curl https://your-api/statistics/user-stats \
  -H "Authorization: Bearer <your-token>"
{
  "totalPoints": 19,
  "globalRank": 2,
  "history": [
    {
      "my_prediction": "local",
      "points_awarded": 1,
      "match_id": 17,
      "home_goals": 3,
      "away_goals": 1,
      "status": "finalizado",
      "home_team_name": "FC Rápidos",
      "away_team_name": "Deportivo Sur",
      "real_result": "local"
    }
  ]
}
Your totalPoints and globalRank are displayed prominently at the top of the profile page. The history entries show whether each past prediction was correct, along with the actual match result.
The profile page does not currently expose a form to update your username, email, or password. Contact an administrator if you need to change your account details.

Understanding your porra score

Each entry in history tells you:
FieldMeaning
my_predictionWhat you predicted: local, empate, or visitante
real_resultThe actual outcome after the match finished
points_awarded1 if your prediction was correct, 0 otherwise; null for pending matches
statusfinalizado (finished) or pendiente (still upcoming)
A correct prediction is where my_prediction === real_result and the match status is finalizado.

Profile in the Angular app

The /profile route is protected by authGuard. If you navigate to it without a valid session, Angular automatically redirects you to /login. Once you log in, the ProfileComponent fetches both endpoints above in parallel and renders your followed teams as a clickable grid and your upcoming matches as scrollable match cards.
You can navigate directly to any followed team’s detail page by clicking its logo or name on the profile page.

Authentication

Register or log in to access your profile.

Match voting

Learn how to earn porra points and climb the ranking.

Following teams

Follow teams to populate your profile’s upcoming matches section.

Build docs developers (and LLMs) love