All runtime configuration for the CoworkingBooking API is driven by Spring Boot’sDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/devdavco/backend_1/llms.txt
Use this file to discover all available pages before exploring further.
src/main/resources/application.properties file. Sensitive values (database host, port, name, credentials) are externalised into environment variables so that the same artifact can run in development, staging, and production without code changes.
Database Configuration
The datasource URL is assembled at startup from five environment variables:Hostname or IP address of the PostgreSQL server. Examples:
localhost, db.abcxyz.supabase.co.Port on which PostgreSQL is listening. Standard value is
5432. Supabase connection-pooler port is 6543.Name of the target database. Example:
coworking_db.Database username. Example:
coworking_usr.Password for the database user. Keep this out of version control.
Local development override
application.properties ships with commented-out local overrides that bypass environment variables entirely, useful for quick local testing without exporting variables:
${DB_*} variants above them) to connect directly to a local PostgreSQL instance on port 5433.
Connection Pool (HikariCP)
Spring Boot’s embedded HikariCP pool is configured with two explicit settings:| Property | Value | Effect |
|---|---|---|
maximum-pool-size | 10 | Upper bound on the number of live connections in the pool. Increase for high-concurrency workloads; reduce for constrained hosted databases. |
schema | public | Pins every connection to the public schema, matching the currentSchema=public query parameter in the JDBC URL. |
SSL
SSL is mandatory in this configuration and cannot be disabled without modifying both the JDBC URL and the Hibernate driver properties. Three settings work together to enforce it:sslmode=require in the JDBC URL instructs the PostgreSQL JDBC driver to negotiate a TLS connection and reject the connection if the server does not support SSL. The matching Hibernate properties (hibernate.connection.ssl=true and hibernate.connection.sslMode=require) enforce the same constraint at the ORM layer.
OpenAPI Documentation
The OpenAPI 3 specification path is customised from the default (/v3/api-docs) to a shorter path:
| URL | Description |
|---|---|
http://localhost:8080/api-docs | Raw OpenAPI 3 JSON specification |
http://localhost:8080/swagger-ui.html | Interactive Swagger UI browser interface |
springdoc-openapi-starter-webmvc-ui dependency (3.0.2) declared in pom.xml and requires no additional configuration to enable.
JPA / DDL Auto
ddl-auto=update tells Hibernate to compare the JPA entity model against the live database schema at startup and apply any additive changes (new tables, new columns). It will not drop columns or tables that have been removed from the entity model.
show-sql=true logs every SQL statement issued by Hibernate to standard output. This is convenient during development but produces significant noise at scale; set it to false in production or route it to a debug log level.
CORS Configuration
Cross-Origin Resource Sharing is configured at the controller level using Spring’s@CrossOrigin annotation. All three controllers (EspacioController, ReservaController, UsuarioController) carry identical annotations pointing to the deployed Next.js dashboard:
localhost:3000 variant is present but commented out. To switch between local development and the deployed frontend, swap which line is commented:
Local development (Next.js on port 3000):
EspacioController.java, ReservaController.java, and UsuarioController.java.
For a more maintainable approach in the long term, consider centralising CORS configuration in a
WebMvcConfigurer bean (via addCorsMappings), where you can define allowed origins from a single property and even pull the allowed origin from an environment variable.