Restorante is configured entirely throughDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/NicolasMPP/restorante-springboot/llms.txt
Use this file to discover all available pages before exploring further.
src/main/resources/application.properties. There are no environment-specific YAML files or external configuration servers — every runtime setting lives in this single file. The sections below document each property, the database seeding system, CORS policy, and build dependencies.
Database Configuration
The full contents ofapplication.properties as shipped with the project:
Property Reference
The logical name of the application, surfaced in logs and Spring Boot Actuator metadata. Change this if you deploy multiple instances under different names.
The JDBC connection string for the MySQL database. The
proyectorestorante database must be created manually before the application starts — Hibernate will not create the database itself, only the tables within it. The serverTimeZone=UTC parameter prevents timezone mismatch errors between the JVM and MySQL server.The MySQL user Restorante connects as. The default is
root. For production deployments, create a dedicated database user with only the permissions the application requires.The password for the configured MySQL user. The shipped default is an empty string, which works when MySQL is running locally without a root password. Set this to your actual password before running the application.
When
true, Hibernate prints every SQL statement it executes to standard output. This is useful during development to verify query behaviour, but produces substantial log noise. Set to false in production or staging environments.Controls how Hibernate manages the database schema on startup. The
update value instructs Hibernate to compare the current schema against the entity model and apply additive changes (new tables, new columns). It does not drop or rename existing columns.| Value | Behaviour |
|---|---|
update | Auto-migrates schema on startup. Safe for development. |
validate | Validates schema matches entities; fails fast if not. Recommended for production. |
create | Drops and recreates all tables on every startup. Data is lost. |
create-drop | Like create, but also drops tables when the context closes. |
none | No schema management. Fully manual. |
This property is commented out in the shipped configuration (
#spring.jpa.open-in-view=false). When left at its Spring Boot default (true), the JPA EntityManager is kept open for the duration of the HTTP request, allowing lazy-loaded associations to be resolved inside Thymeleaf templates. Setting it to false enforces stricter transaction boundaries and is generally recommended for REST APIs, as it surfaces LazyInitializationException errors that would otherwise be silently deferred.Database Seeding
Restorante ships with aInicializadorBD component (com.nicolasperez.restorantespringboot.config.InicializadorBD) that implements Spring Boot’s ApplicationRunner interface. It executes once immediately after the application context starts and seeds the database with a realistic set of sample data — but only when the personas table is completely empty. If any Persona records already exist, seeding is skipped entirely.
The following records are inserted on first run:
| Entity | Count | Details |
|---|---|---|
| Gerente | 1 | Martín Vargas — manages the menu and pantry |
| Chef | 2 | Carina Sosa, Andrés Martínez |
| Mesero | 1 | Ana Martínez |
| Cliente | 1 | Pedro Sánchez |
| Ingrediente | 16 | Tomate, Cebolla, Ajo, Pasta, Queso Parmesano, and 11 more |
| Receta | 4 | Pasta Carbonara, Bistec a la Parrilla, Ensalada Caprese, Pollo al Horno |
| Alimento | 10 | 3 PlatoFuerte, 2 Postres, 3 Bebida, 2 Adicionales |
| Menu | 1 | ”Menú Principal del Día” containing all 10 food items |
| Despensa | 1 | Linked to the Gerente, stocking all 16 ingredients |
The seed data is idempotent with respect to application restarts —
InicializadorBD checks personaRepository.count() > 0 before doing any work, so restarting the server never duplicates records.CORS Configuration
All REST controllers in Restorante are annotated with@CrossOrigin("*"), which permits cross-origin requests from any origin. This means browser-based clients running on any domain can call the API without being blocked by the same-origin policy.
Build Dependencies
Restorante is built with Gradle and uses the Spring Boot dependency management plugin. The following runtime and compile-time dependencies are declared inbuild.gradle:
| Dependency | Scope | Purpose |
|---|---|---|
spring-boot-starter-web | implementation | Embedded Tomcat, Spring MVC, REST support |
spring-boot-starter-data-jpa | implementation | Hibernate ORM, Spring Data repositories |
spring-boot-starter-data-rest | implementation | Hypermedia-driven REST endpoint generation |
spring-boot-starter-thymeleaf | implementation | Server-side HTML templating for /menu and /despensa views |
mysql-connector-j | runtimeOnly | MySQL JDBC driver |
lombok | compileOnly + annotationProcessor | Boilerplate reduction (@Getter, @Setter, @Builder, etc.) |