How ssdd-2025/practica-sistemas-distribuidos-2025-grupo-8 works
Main Components
• Frontend – The view layer comprises static HTML/CSS (with templates stored under “src/main/resources/templates” and “static”). These are used for the user interface (e.g., home page, account, routine, trainers, etc.).
• Controllers – Located in “controllers”, these are Spring MVC endpoints (e.g., UserController, TrainerController, ExerciseController) that receive clients’ requests.
• Services – Business logic is encapsulated in service classes (e.g., ExerciseServices, RoutineServices, CommentService) which process data and encapsulate logic.
• Repositories – Data persistence is managed by repository interfaces (e.g., UserRepository, TrainerRepository) that interface with the MySQL database.
• Database – MySQL holds the persistent data. The README even provides instructions for creating a “gymapp” schema.
• DTO & Mappers – These are used to transfer and map data between layers; they help in decoupling the internal model from the exposed API.
Relationships and Interactions
• When a user interacts with the web pages (front-end), their requests (either GET or POST) are routed to a specific Controller.
• The Controller then calls the corresponding Service to execute the necessary business logic.
• The Service uses one or more Repository components to perform CRUD operations on the MySQL database.
• Data is transformed via DTO classes and their associated Mapper classes before being sent to the view.
• GlobalControllerAdvice is in place to handle exceptions globally, so include it as a cross-cutting concern that intercepts errors from any component.
• There is also integration for handling user sessions, permissions (e.g., registered user vs. administrator), and file uploads (e.g., profile images).
Architectural Patterns and Technologies
• The application clearly implements the MVC pattern.
• It uses a multi-layered structure (Controllers → Services → Repositories → MySQL).
• Technologies include Java JDK, Spring Boot 3.4.2, Maven, and MySQL 8.0.33.0.
• The use of DTOs and Mappers shows the decoupling between internal representations (models) and external data transfer objects.
• The file structure suggests adoption of best practices in organizing code, with clear separations for configuration (application.properties), templates, and static content.
Final Elements
• Use clear labels for each component (e.g., “UserController,” “MaterialServices,” “MySQL Database”).
• Optionally, include an annotation or separate section for cross-cutting concerns like GlobalControllerAdvice.