Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/17Franco/CulturarteWeb/llms.txt

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

CulturarteWeb has two distinct user roles, each with a different relationship to cultural proposals. Proponentes are cultural creators — they design, publish, and manage proposals for events they want to produce. Colaboradores are backers — they browse proposals, fund them through collaborations, and receive the agreed return if an event is successfully funded. Both roles share common social features such as following, profile pages, and a site-wide ranking.

User Registration

New users register via a single form that handles both Proponentes and Colaboradores. Endpoint: POST /Registro The form uses enctype="multipart/form-data" (annotated with @MultipartConfig) to allow uploading a profile image alongside the text fields.
ParameterDescription
NickNameUnique nickname (used as the primary key across all tables)
password2Account password
nombreFirst name
apellidoLast name
emailEmail address
fechaDate of birth (yyyy-MM-dd)
tipoUsuario"Proponente" or "Colaborador"
imgProfile image file upload
direccionStreet address (Proponentes only)
paginaWebPersonal or professional website URL (Proponentes only)
biografiaBiographical text (Proponentes only)
On success, the user is forwarded back to InicioSesion_Registro.jsp with a successMessage attribute. On failure, the same page is re-rendered with an errorMessage.

Real-time Validation (AJAX)

The registration form uses two AJAX endpoints to validate uniqueness before the form is submitted:
EndpointMethodDescription
GET /emailUsado?email=<value>GETReturns JSON indicating whether the email is already registered
GET /existeNickName?nick=<value>GETReturns JSON indicating whether the nickname is already taken
These endpoints are called via JavaScript as the user types, providing instant feedback without a full page reload.

User Login

Endpoint: POST /Login
ParameterDescription
NicknameThe user’s nickname
passwordThe account password
On successful authentication, two session attributes are set:
sesion.setAttribute("logueado", nick);      // the user's nickname
sesion.setAttribute("tipoUser", tipoUsuario); // "Proponente" or "Colaborador"
The user is then redirected to the application root (/), which resolves to GET /Buscador per the web.xml welcome-file configuration.

Mobile Restriction for Proponentes

The Login servlet inspects the User-Agent header of every login request. If the device is identified as mobile and the authenticating user is a Proponente, login is denied.
private boolean isMobileDevice(HttpServletRequest request) {
    String userAgent = request.getHeader("User-Agent");
    return userAgent.contains("Mobi")    ||
           userAgent.contains("Android") ||
           userAgent.contains("iPhone")  ||
           userAgent.contains("iPad")    ||
           userAgent.contains("Touch");
}

// In doPost:
if (esMovil && esProponente) {
    request.setAttribute("errorMessage",
        "Acceso denegado: Los Proponentes no pueden iniciar sesión desde dispositivos móviles.");
    request.getRequestDispatcher("/InicioSesion_Registro.jsp").forward(request, response);
    return;
}
Colaboradores can log in from any device.
Sessions expire after 30 minutes of inactivity, as configured in web.xml:
<session-config>
    <session-timeout>30</session-timeout>
</session-config>
After expiry, any servlet that checks request.getSession(false) will receive null and redirect the user to login.jsp.

User Profile

Endpoint: GET /PerfilUsuario?nick=<nick>&tipo=<tipo> The profile page displays a user’s information. The servlet fetches a type-specific DTO from the web service:
  • If tipo is "Proponente": calls portU.getDTOProponente(nick) → returns a DtoProponente with biography, address, website, and created proposals.
  • Otherwise (Colaborador): calls portU.getDTOColaborador(nick) → returns a DtoColaborador with collaborations and followed/following lists.
Both DTOs are forwarded to perfilUsuario.jsp under the infoPerfil attribute. From the profile page, a logged-in user can also navigate to:
LinkEndpointDescription
Collaborations/Colaboraciones?nick=<nick>&tipo=<tipo>View all collaborations made by this user
Followers/Seguidores?nick=<nick>&tipo=<tipo>View users who follow this user
Following/UsuariosSeguidos?nick=<nick>&tipo=<tipo>View users this user follows
Favorites/PropuestasFavoritaUsuario?nick=<nick>&tipo=<tipo>View proposals favorited by this user
Created Proposals/PropuestasCreadas?nick=<nick>&tipo=<tipo>View proposals created by this Proponente

Follow System

CulturarteWeb includes a social follow system allowing any user to follow any other user. Follow and unfollow actions both return lightweight JSON responses, suitable for use with asynchronous front-end calls.

Follow a User

Endpoint: POST /Seguir
ParameterDescription
seguidorNickname of the user who is following
seguidoNickname of the user being followed
// Response
{ "resp": true }

Unfollow a User

Endpoint: POST /DejarDeSeguir
ParameterDescription
seguidorNickname of the user who wants to unfollow
seguidoNickname of the user to unfollow
// Response
{ "resp": true }

Check Follow Status

Endpoint: GET /SigueAUsuario?seguidor=<nick>&seguido=<nick> Returns whether the seguidor currently follows the seguido user.
// Response
{ "seguido": true }

List Followers

Endpoint: GET /Seguidores?nick=<nick>&tipo=<tipo> Returns a list of DtoUsuario objects representing all users who follow the given user. Forwards to Seguidores.jsp.

List Following

Endpoint: GET /UsuariosSeguidos?nick=<nick>&tipo=<tipo> Returns a list of DtoUsuario objects representing all users that the given user follows. Forwards to UsuarioSeguidos.jsp. Follow relationships are stored in the usuario_seguidos table with a composite primary key of (seguidor, seguido):
CREATE TABLE `usuario_seguidos` (
  `seguidor` varchar(255) NOT NULL,
  `seguido`  varchar(255) NOT NULL,
  PRIMARY KEY (`seguidor`, `seguido`)
);

User Ranking

Endpoint: GET /RankUsuario Retrieves a ranked list of users ordered by their collaboration activity. The servlet calls portU.rankingUsuarios(), which returns a List<DtoUsuario> in ranked order. The list is forwarded to RankingUsuarios.jsp under the RankUser attribute.
List<DtoUsuario> p = portU.rankingUsuarios();
request.setAttribute("RankUser", p);
request.getRequestDispatcher("/RankingUsuarios.jsp").forward(request, response);
The ranking is computed by the web service layer (not the web tier), so the exact ranking formula — total collaboration amount, number of collaborations, or a combined score — is determined by the back-end logic.

Account Deletion

Endpoint: POST /EliminarCuenta
ParameterDescription
NickNameNickname of the account to delete
The servlet verifies that the user exists (portU.existe(nick)), then calls portU.eliminarProponente(nick). If successful, the current session is immediately invalidated and a JSON success response is returned.
// Success
{ "resp": true }

// Failure (user not found or deletion error)
{ "resp": false }
Account deletion is permanent and irreversible. The session is invalidated immediately after the deletion call. Ensure the user has confirmed their intent before calling this endpoint.

Build docs developers (and LLMs) love