ADocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt
Use this file to discover all available pages before exploring further.
Participante is the social identity of every person on the platform. While a Usuario account is created to hold authentication credentials, the Participante record is what the rest of the application sees and interacts with — it carries the display name, profile picture, event memberships, administered events, and friend connections. One Participante is created automatically for every Usuario registration, and the two are bound together in a permanent one-to-one relationship.
The Participant Profile
TheParticipante entity lives in the participantes table and exposes the following fields:
| Field | Type | Default | Description |
|---|---|---|---|
id | Long | Auto-generated | Primary key; used as a stable reference throughout the API. |
nombreParticipante | String | Copied from Usuario.nombre | Display name, 6–20 characters. Kept in sync with the linked user’s nombre field. |
imagenParticipante | String | "default.png" | Filename of the profile picture stored under images/usuarios/. New accounts start with the platform default image. |
eventos | Set<Evento> | Empty set | All events the participant has joined as a regular member. |
eventosAdministrados | Set<Evento> | Empty set | All events the participant manages as an administrator. |
amigos | Set<Participante> | Empty set | The participant’s friends — a many-to-many self-referential relationship backed by the participante_amigos join table. |
ParticipanteDTO, a flat Java record that replaces nested entity sets with lists of IDs:
Participant vs User
The separation betweenUsuario and Participante follows a deliberate design choice: authentication concerns belong to Usuario, and social concerns belong to Participante. This keeps the security layer independent of the social graph.
Usuario
Holds credentials and access control:
nombre— login usernamepassword— BCrypt-hashed passwordemail— unique email addressrol— Spring Security role (USUARIOby default)tokens— linked JWT token records
UserDetails so Spring Security can authenticate directly against it.Participante
Holds social identity and community data:
nombreParticipante— display name (mirrorsUsuario.nombre)imagenParticipante— profile image filenameeventos— joined eventseventosAdministrados— administered eventsamigos— friend connections
UsuarioSalidaDTO containing { nombre, email }. When a client needs social profile data — event history, friends, profile image — it queries ParticipanteDTO. Most social API calls identify the target by participanteId, not usuarioId.
Friend System
Spring Community’s friend system is built on a many-to-many self-referential association betweenParticipante records, backed by the participante_amigos join table. Adding a friend is a one-directional operation (similar to a follow model), and duplicate entries are prevented at the domain level by agregarAmigo().
Search for participants by name
Use the search endpoint to find participants whose display name contains a given string. This is the typical first step before adding someone as a friend.Returns a set of
ParticipanteDTO objects whose nombreParticipante contains the search term (case-insensitive partial match).Add a friend
Send a Returns
POST request with the target participant’s ID in the path. The server resolves the authenticated user’s participant and calls agregarAmigo().200 OK with an empty body on success. The domain method enforces that a participant cannot add themselves and that the ID must be valid.View your friends list
Retrieve the full friends list of the currently authenticated participant:Returns a set of
ParticipanteAmigoDTO objects, each containing the friend’s ID, display name, their own friend IDs, and their linked user ID:Profile Images
Every participant has a profile image stored as a filename inimagenParticipante. New accounts default to "default.png". To upload a custom picture, send a POST to /api/participantes/imagen with the image attached as a multipart/form-data part named image.
images/usuarios/ directory and updates the imagenParticipante field on the authenticated user’s Participante record. To serve the image to a browser, request it from:
Listing Participants
Two endpoints expose participant data to authenticated clients:GET /api/participantes
Returns all participants in the system as a list of
ParticipanteDTO. Useful for admin views or building a member directory.GET /api/participantes/{id}
Returns a single
ParticipanteDTO by participant ID. Use this to load a specific user’s social profile, including their event memberships and admin roles.Participant Lifecycle
A
Participante is created automatically when a new user registers via POST /auth/crear. The service method createUsuarioParticipante() persists both the Usuario and its linked Participante in a single transaction. The nombreParticipante is initialised from Usuario.nombre, and imagenParticipante defaults to "default.png". Clients do not need to create participant records manually.TokenResponse containing an access token and a refresh token. The new participant is immediately accessible at GET /api/participantes/{id}.