How ppsegur/proyectopepeseguraacademia works
Main Components
• Frontend/User Interface: Represented by the static resources (CSS, JavaScript, images) and the Thymeleaf (or similar) HTML templates in the resources/templates folder. This layer handles the frontend presentation and user interactions.
• Web/Controller Layer: All controllers (located in the “controller” package) such as AdminControlador, CarritoControlador, CursoController, and others form the web layer that processes requests and returns responses.
• Service Layer: Business logic is encapsulated in service classes (e.g., CarritoServicio, CursoServicio, EstudianteServicio, etc.). They orchestrate operations between incoming client requests and database operations.
• Data Access Layer: The repository interfaces (located in the “repositorio” package) manage CRUD operations on the domain models.
• Domain/Model Layer: Entity classes (like Curso, Certificado, Estudiante, Venta, etc.) represent the data and business objects.
• Security Layer: Security configuration is provided under the “security” package (SecurityConfig, PasswordEncoderConfig) to manage authentication and authorization.
• Database: Not directly visible in the file tree but implied via the “import.sql” (which likely seeds data) and configuration properties from application.properties.
• Additional Utilities: Components such as mail service (MailService) and PDF export utility (UserPdfExporter) add supporting functionality.
Relationships and Interactions
• How the frontend (HTML templates, static resources) sends requests (via forms or Ajax) to the controller layer.
• That controllers process requests, delegate business logic to the service layer, and then use repositories for accessing or modifying data.
• Data flow in the reverse direction (responses and views) to the client.
• Exception handling and security filters that are applied to incoming requests (e.g., using Spring Security).
Architectural Patterns and Design Principles
• Follow the MVC (Model-View-Controller) pattern: clearly separate responsibilities among Controllers (handling HTTP requests), Services (business logic), and Repositories/Models (persistence and domain data).
• Dependency Injection and Inversion of Control, inherent in Spring Boot, which decouples component dependencies.
• Layered Architecture: Distinct separation between presentation, business, and data layers.
• Use of modular components enhances maintainability and extensibility (e.g., dedicated packages for security, exceptions, and utilities).