How dws-2025/project-grupo-r-2 works
Main Components
• Frontend Client:
• Web user interface built using Thymeleaf templates (HTML files under src/main/resources/templates) and static assets (CSS, JavaScript, images).
• Additional details for the static resources (styles.css, market.js, etc.) which support dynamic client-side interactions.
• Backend Application (Spring Boot):
• Controllers: Separate groups within the project for web controllers (e.g., WebController, LoginController, AdminController, MarketController, MembershipsController) that handle page requests, and REST controllers (e.g., CombatClassRestController, MembershipRestController, ProductRestController, UserRestController, and LoginRestController under the auth package) for API requests.
• Service Layer: Components that include business logic for each entity (UserService, MembershipService, CombatClassService, ProductService, ImageService) and possibly additional services like UserLoginService.
• Repository Layer: Interfaces that abstract data persistence operations (e.g., UserRepository, MembershipRepository, CombatClassRepository, ProductRepository).
• Domain Model & DTOs: Entities (User, Membership, CombatClass, Product) showcasing business data; related DTO objects for data transfer; and mappers to convert between entity and DTO representations.
• Security Module:
• JWT-based authentication and authorization handled by classes in the security and security/jwt packages, including configuration, filters, token providers, and handlers.
• CSRF handling and other security-specific configurations.
• Database:
• Although the specific type isn’t detailed, DatabaseInitializer and the pom.xml configuration imply that a relational database (or similar) is used with an ORM like JPA/Hibernate.
Relationships and Data Flow
• How the frontend interacts with the backend. For example, user actions (such as login, product purchase, membership subscription) are sent as HTTP requests to the respective controllers.
• Controllers delegate operations to the service layer.
• Services interact with repositories to perform CRUD operations on the database.
• Bidirectional relationships:
• The relationship between Users, Memberships, Products, and Combat Classes as laid out in the README.
• That a User can have multiple products and a subscription to a membership, while a membership is associated with one combat class (which can be part of several memberships).
• Integration of the JWT-based security mechanism filtering requests between the client and backend resources, ensuring secure access based on user roles (Admin vs. Regular User).
Architectural Patterns and Technologies
• Layered (MVC) pattern:
• Controllers handle HTTP requests.
• Services embed business logic.
• Repositories interact with the database.
• Use of Data Transfer Objects (DTOs) for decoupling domain models from external interfaces.
• Optionally, mention the integration testing (files under src/test) used to ensure the correctness of the application.