How audio10/e-reservation works
Main Components
• Application Entry Point: Represent the core Spring Boot application that bootstraps the service (EReservationApplication.java).
• Model Layer (com.platzi.ereservation.modelo): This contains the domain entities like Cliente and Reserva. These classes represent the tables of the database (mapped via JPA and Hibernate).
• Business/Service Layer (com.platzi.ereservation.negocio): This layer includes components such as the repositories (ClienteRepository, ReservaRepository) and services (ClienteService) that handle business logic and persistence.
• View/Controller Layer (com.platzi.ereservation.vista): This layer implements the REST controllers (e.g., LoginController and ClienteResource) that expose endpoints to client requests. Additionally, it includes resources such as the VO objects (ClienteVO) and the templates/static resources (home.html, login.html, styles.css).
• Configuration & Utilities: Include utility classes (BasicConfiguration, SwaggerConfiguration) and configuration files (application.properties, application.yaml) that set up database connections, Swagger documentation, and general application configuration.
• External and Supporting Technologies:
• Spring Boot with embedded Tomcat for running a standalone web server.
• Spring Data JPA & Hibernate for ORM.
• Swagger (via Spring Fox) for API documentation.
• Maven as the build tool (pom.xml, mvnw scripts) and possibly Lombok to reduce boilerplate in models.
• A PostgreSQL database (as described in the README with Docker commands for setup).
Architectural Patterns & Design Principles
• MVC pattern: Separate the system into three clearly distinct layers – Model (data entities), View (web controllers and templates), and Controller/Service (business logic and REST layer).
• Dependency Injection as provided by Spring, showing that components like Controllers, Services, and Repositories are managed as Spring beans.
• Use of JPA/Hibernate for ORM, mapping database tables to Java objects.
• That the system is designed to be modular, with a clear separation between the layers which supports maintainability and scalability.