The backend is configured entirely through environment variables. No credentials or connection details are hardcoded — all sensitive values are injected at runtime, making it straightforward to target different databases or environments without modifying source code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSebax85/backend-prueba-fullstack/llms.txt
Use this file to discover all available pages before exploring further.
Environment variables
The following variables must be set before the application starts. If any are missing, the datasource will fail to initialize.| Variable | Example value | Description |
|---|---|---|
DB_URI | jdbc:postgresql://db:5432/prueba | Full JDBC connection string including host, port, and database name |
DB_USER | postgres | Database username |
DB_PASSWORD | 1234 | Database password |
DB_DRIVER | org.postgresql.Driver | Fully qualified JDBC driver class name |
Passing variables via Docker Compose
Thedocker-compose.yml file passes these variables to the backend service using the environment block:
docker-compose.yml
db service defined in the same Compose file. Docker Compose resolves the hostname db automatically within the shared network.
Overriding for a different database host or name
To point the backend at an external PostgreSQL instance, update theenvironment block:
docker-compose.yml
myhost.example.com, mydb, myuser, and mysecretpassword with your actual values. No other files need to change.
Connection pool settings (Hikari)
Spring Boot uses HikariCP as its default connection pool. Two settings are configured explicitly:application.properties
| Property | Value | Effect |
|---|---|---|
initialization-fail-timeout | 0 | The pool starts even if the database is not immediately reachable. Useful when the backend container starts before the database is fully ready. |
connection-timeout | 30000 | Requests for a connection from the pool wait up to 30 seconds before throwing an exception. |
initialization-fail-timeout=0 is what allows the depends_on health check in Docker Compose to act as a soft guard — the backend will retry acquiring a connection rather than crashing immediately on startup.
Schema management
application.properties
ddl-auto=update, Hibernate automatically inspects the database schema on startup and applies any changes needed to match the entity definitions. This means:
- Tables and columns are created if they do not exist.
- New columns added to entities are added to existing tables.
- Columns are not dropped automatically when removed from entities.
update mode is convenient for development but is not recommended for production environments where schema changes should be managed explicitly via migration tools such as Flyway or Liquibase.CORS configuration
The backend allows cross-origin requests from a single origin:CorsConfig.java
- Only requests from
http://localhost:3000are allowed by the browser’s CORS policy. - All HTTP methods used by the API (
GET,POST,PUT,DELETE,OPTIONS) are permitted. - All request headers are accepted.
allowedOrigins in CorsConfig.java to match.
Next steps
Database guide
Understand the schema, tables, and how to connect directly to PostgreSQL.
Docker deployment
Learn how to build and run the full stack with Docker Compose.