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 is structured around a classic three-tier architecture. The Presentation Layer consists of Jakarta EE Servlets and JSP views running inside Tomcat 10.1, responsible for handling all HTTP interactions with the browser. The Business Logic Layer lives entirely inside an external SOAP service — ControllerWS — which the web layer calls via JAX-WS for every meaningful operation (login, proposals, collaborations, PDF generation, and more). The Data Layer is a MySQL 8 database managed through JPA/EclipseLink, seeded from copia.sql on first boot. All three tiers communicate through well-defined contracts: HTTP/HTML for the browser, SOAP over HTTP for the business service, and JDBC/JPA for the database.

Presentation Layer

The presentation layer is built on the Jakarta EE 10 Servlet API (web-app version 6.0). Each feature area maps to a dedicated HttpServlet registered with @WebServlet, and JSP files in src/main/webapp/ render the HTML responses. Servlets include:
ServletURL PatternResponsibility
BuscadorPropuestas/BuscadorWelcome page; proposal search (configured as <welcome-file> in web.xml)
Login/LoginAuthenticates users via ControllerWS; enforces mobile restriction for Proponentes
Registro/RegistroRegisters new users
AltaPropuesta/AltaPropuestaCreates a new cultural event proposal
Colaboraciones/ColaboracionesLists collaborations for a proposal
GenerarConstancia/GenerarConstanciaRequests a PDF certificate from ControllerWS and streams it to the browser
TrelloApi/TrelloApiExports a Proponente’s proposals and collaborations to a Trello board
PerfilUsuario/PerfilUsuarioDisplays user profile data
RankUsuario/RankUsuarioShows the user activity ranking
Seguidores / Seguir / DejarDeSeguir/Seguidores, /Seguir, /DejarDeSeguirSocial follow/unfollow actions
Front-end stack:
  • Bootstrap 5 — responsive grid and UI components (CSS files bundled locally in cssBootstrap/)
  • Vanilla JavaScript — client-side interaction scripts in src/main/webapp/JS/ (e.g., favourite toggling, follow/unfollow, form validation, payment pop-ups)
  • Custom CSSCssPersonalizado/Styles.css and CssPersonalizado/propuestas.css
Session management: Sessions are container-managed by Tomcat. The web.xml sets a session timeout of 30 minutes:
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>
On successful login, the Login servlet stores two session attributes — logueado (the user’s nickname) and tipoUser ("Proponente" or "Colaborador") — which are read throughout the JSP views to control access and rendered content.
Mobile restriction for Proponentes: The Login servlet checks the User-Agent request header on every login attempt. If the header contains Mobi, Android, iPhone, iPad, or Touch, and the authenticated user is a Proponente, the login is denied with the message “Acceso denegado: Los Proponentes no pueden iniciar sesión desde dispositivos móviles.” Colaboradores have no device restriction. A complementary client-side script (detectarDispositivo.js) also redirects unauthenticated mobile visitors to the login/registration page.

Business Logic Layer

All business logic is delegated to ControllerWS, an external SOAP web service. The web layer contains no business rules of its own — it constructs a JAX-WS client proxy at runtime using the endpoint URL assembled from config.properties, then calls service methods directly. SOAP endpoint construction:
String dir = "http://" + host + ":" + port + serv + "?wsdl";
URI uri = URI.create(dir);
URL url = uri.toURL();
ControllerWS_Service service = new ControllerWS_Service(url);
ControllerWS portU = service.getControllerWSPort();
Where host, port, and serv come from config.getProps("WEB_SERVICES_HOST"), config.getProps("WEB_SERVICES_PORT"), and config.getProps("SERVICE") respectively. With default values this resolves to:
http://localhost:9125/controllerWS?wsdl
WSDL stub classes are generated at build time by the jaxws-maven-plugin (wsimport goal, generate-sources phase) from the live WSDL URL — meaning the SOAP service must be running when mvn clean install is executed. REST endpoint for Proponente profile data: An optional REST service provides Proponente profile information (including created proposals and their collaborations). The TrelloApi servlet and the front-end datosProponente.js script call this endpoint to retrieve a Proponente’s data by nickname:
http://{WEB_SERVICES_HOSTR}:{WEB_SERVICES_PORTR}/proponentes/{nick}
With default config values this resolves to:
http://localhost:9126/proponentes/{nick}

Data Layer

The database layer uses MySQL 8 managed by JPA 3.0 / EclipseLink (the default JPA provider for Jakarta EE 10). The persistence unit is declared in src/main/resources/META-INF/persistence.xml:
<persistence version="3.0"
  xmlns="https://jakarta.ee/xml/ns/persistence">
  <persistence-unit name="my_persistence_unit">
  </persistence-unit>
</persistence>
In the Docker Compose deployment, the database container is configured with:
SettingValue
Imagemysql:8.0.17
Database nameCulturarte
Usertecnologo
Passwordtecnologo
Root passwordtecnologo
Host port3307 (maps to internal 3306)
Seed filecopia.sql (mounted at /docker-entrypoint-initdb.d/copia.sql)
PersistenceNamed volume db_data at /var/lib/mysql
The copia.sql seed file is automatically executed by the MySQL container on first startup, initializing all tables and loading sample data.

Configuration

The config class (package Config) is a thread-safe singleton that loads ~/.Culturarte/config.properties at application startup.
// Singleton access
config conf = config.getInstance();
String host = conf.getProps("WEB_SERVICES_HOST");
Bootstrap behaviour:
  1. On first instantiation, config checks for the directory ~/.Culturarte/.
  2. If the directory does not exist, it is created via configDir.mkdirs().
  3. If the file ~/.Culturarte/config.properties does not exist, the bundled default config.properties (from the WAR classpath at src/main/resources/config.properties) is automatically copied there.
  4. The Properties object is then loaded from the external file, so any user edits to ~/.Culturarte/config.properties are picked up on the next application restart without repackaging the WAR.
The Maven build also reads the same file during the initialize phase (via the properties-maven-plugin) so that WEB_SERVICES_HOST and WEB_SERVICES_PORT are available as properties for the wsimport WSDL URL.

Trello Integration

The Trello API integration uses the Unirest HTTP client (v3.13.11) to make POST requests to the Trello REST API. The TrelloApi servlet first calls the REST service to retrieve a Proponente’s proposals, then performs the following Trello operations in sequence:
  1. Create a boardPOST https://api.trello.com/1/boards/ — named "Propuestas de {nickname}".
  2. Create a list per proposalPOST https://api.trello.com/1/lists — named with the proposal title and publication date.
  3. Attach the proposal image (if present) — POST https://api.trello.com/1/cards/{id}/attachments — the image is decoded from Base64, written to a temp file, and uploaded as a multipart attachment.
  4. Create a card per collaboratorPOST https://api.trello.com/1/cards — the card name is the collaborator’s nickname; the description contains the amount, return type, and collaboration date.
Trello API credentials (API_KEY and API_TOKEN) must be set in config.properties for this feature to work.

Key Dependencies

DependencyVersionPurpose
jakarta.jakartaee-api10.0.0Servlet API, JPA, CDI, and all Jakarta EE 10 specifications (provided scope — supplied by Tomcat 10.1)
com.sun.xml.ws · jaxws-rt (Metro)4.0.2JAX-WS runtime for consuming the ControllerWS SOAP service; compatible with Java 21
com.google.code.gson · gson2.10.1JSON parsing for the Trello API and REST service responses
com.konghq · unirest-java3.13.11HTTP client used by TrelloApi to make multipart and JSON requests to the Trello REST API

Build docs developers (and LLMs) love