The Comunidades Vecinos backend is a Spring Boot 4 application running on Java 21. It exposes a stateless REST API secured with JWT authentication and connects to a MariaDB database. Before starting the server for the first time, you need to supply three environment variables and verify that your filesystem upload paths exist.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GuillermoNavarro/Proyecto_comunidades/llms.txt
Use this file to discover all available pages before exploring further.
Environment Variables
The following variables are required at runtime. The application will fail to start if any of them are missing, because Spring will be unable to resolve the${…} placeholders in application.properties.
The MariaDB (or MySQL) username used to connect to the
comunidad_vecinos database.The password for the database user specified in
DB_USER.A Base64-encoded secret key used to sign and verify JSON Web Tokens with HMAC-SHA256. Use a randomly generated string of at least 32 bytes (256 bits). You can generate one with
openssl rand -base64 32.Application Properties Reference
The full configuration lives inbackend/src/main/resources/application.properties. The table below covers every property that you are likely to need to change for a new environment.
| Property | Default | Description |
|---|---|---|
server.port | 8081 | The HTTP port the embedded Tomcat server listens on. |
spring.datasource.url | jdbc:mariadb://localhost:3306/comunidad_vecinos | Full JDBC connection URL. Change localhost and 3306 if your database is on a different host or port. |
spring.datasource.username | ${DB_USER} | Resolved from the environment variable at startup. |
spring.datasource.password | ${DB_PASSWORD} | Resolved from the environment variable at startup. |
spring.jpa.hibernate.ddl-auto | update | Hibernate schema management strategy. update creates missing tables and adds new columns on startup without dropping existing data. |
app.upload.dir | /var/www/comunidades/documents/ | Absolute filesystem path where uploaded PDF documents are stored. The directory must exist and be writable by the process user. |
app.upload.images.dir | /var/www/comunidades/images/ | Absolute filesystem path for uploaded images. Must exist and be writable. |
spring.servlet.multipart.max-file-size | 15MB | Maximum size for a single uploaded file. Increase this value if residents need to upload larger documents. |
spring.mail.host | localhost | SMTP server hostname. Set to your provider’s address for production. |
spring.mail.port | 1025 | SMTP port. 1025 is the default for MailHog/Mailpit. Use 587 (STARTTLS) or 465 (SSL) for production. |
spring.mail.properties.mail.smtp.auth | false | Enable SMTP authentication. Set to true for production mail providers. |
spring.mail.properties.mail.smtp.starttls.enable | false | Enable STARTTLS encryption. Set to true when using port 587 with a real SMTP server. |
jwt.secret | ${JWT_SECRET} | Resolved from the environment variable. Must be a valid Base64 string. |
Running the Backend
Set your environment variables
Export the required variables in your shell session before running the application:
Start the development server
From the You can also inline the environment variables for a one-liner:The server will start on
backend/ directory, use the Maven wrapper to compile and launch the application:http://localhost:8081.Mail Configuration
By default, the application expects a local SMTP development server (such as MailHog or Mailpit) listening onlocalhost:1025. These tools capture outgoing emails and display them in a web UI — no real emails are sent.
To connect to a production SMTP provider, update the following properties:
Common production SMTP providers include SendGrid, Mailgun, Amazon SES, and Brevo (formerly Sendinblue). Each provides its own
host, port, and credential values.Swagger UI and API Docs
The API documentation is automatically generated by springdoc-openapi and is publicly accessible without authentication — no JWT token is required to browse the docs.| URL | Description |
|---|---|
http://localhost:8081/swagger-ui/index.html | Interactive Swagger UI for exploring and testing all endpoints. |
http://localhost:8081/v3/api-docs | Raw OpenAPI 3 JSON specification, suitable for import into Postman or other API clients. |
The
/swagger-ui/**, /v3/api-docs/**, and /api/login paths are explicitly allowed in SecurityConfig without requiring a Bearer token. All other endpoints require a valid JWT in the Authorization: Bearer <token> header.