How ssdd-2025/grupo-16 works
Project Type and Purpose
• This is a full-stack web application for purchasing concert tickets, where users (anonymous, registered, and administrators) can search for artists and concerts, view detailed artist pages, purchase tickets, and administrators can manage (add/modify/delete) concerts and artists.
File Structure and Identify Key Layers
• The project is structured as a Maven-based Spring Boot application.
• Top-level directories include:
• “entrega1”: the main project module with Java source code.
• Within “src/main/java”, the packages are divided under “es/ticketmaster/entrega1”, with subpackages for controllers (both REST and web), services, repositories, model, dto, and security.
• Resources include configuration files (application.properties), static assets (CSS, JS, media) and templates (HTML pages).
• Test code is organized under “src/test”.
• This layered partitioning indicates a clean separation into:
• Presentation layer: Web controllers (handling HTML view templates) and REST controllers.
• Business logic layer: Services that hold the main application logic for users, artists, concerts, and tickets.
• Data access layer: Repositories (JPA interfaces plus custom queries) interacting with the underlying database.
• Domain layer: Entities (UserEntity, Artist, Concert, Ticket) and associated DTOs for transferring data.
• Security layer: Components for authentication, JWT, password management, and session management via a SessionScope “ActiveUser” component.
Key Components and Their Interactions
• Client/Web Browser: Users interact with the application via a web interface (HTML pages, static resources) served by Spring Boot.
• Controllers:
• Web endpoints (e.g., MainController, UserController, TicketController, ArtistController, ConcertController) route user interactions to services.
• REST endpoints manage API calls.
• Service Layer: Contains business logic for user validation, ticket purchases, artist and concert management, and security checks.
• Data Layer: Repositories for each entity (ArtistRepository, ConcertRepository, TicketRepository, UserRepository) – repositories use JPA and custom queries to interact with the database.
• Security Components: JWT filters, WebSecurityConfig, and CSRF-related configurations secure the application.
• Assets and Views: Static resources (CSS, JS, media) and Mustache/HTML templates are used for the user interface.
Architectural Patterns and Design Principles
• Layered (n-tier) architecture: Separate controllers, services, repositories, and domain logic.
• MVC pattern: Controllers route requests to views (HTML templates) in the web layer.
• Hexagonal (Ports & Adapters) Architecture: The services serve as intermediaries between the controllers and repositories.
• Use of DTOs for data transfer between layers and mapping between domain models and client data.
• Security and session management is modularized (using JWT and session-scoped components).
Essential Elements
• Clear Labels: Each component (controller, service, repository, entity, security component, client device, database) should be labeled.