How anagonbu/tutorial_ludoteca works
Project type and purpose
• This is a full-stack web application (“Tutorial_Ludoteca”) for managing video-game loans in a library.
• Frontend: Angular-based SPA for CRUD operations on clients, authors, games and loans (filtering, pagination, validation).
• Backend: Java Spring Boot REST API exposing endpoints for each domain (client, author, category, game, loan), persisting to an in-memory H2 database.
File structure
• Top-level “FrontEnd” folder holds an Angular 17 project (angular.json, package.json, src/app with modules & components).
• Top-level “back” folder holds a Mavenized Spring Boot project (pom.xml, src/main/java/com/ccsw/tutorial with controllers, services, repositories, models; src/main/resources for configuration and data).
• Build scripts: npm (frontend), maven wrapper (back).
• Test suites: Jasmine/Karma for Angular (spec.ts files), JUnit 5 for Java (IT and unit tests).
README
• Describes modules: client, author, game, loan, common (pagination & filtering).
• Guides on pending work (error handling).
a. Main components
• UI Layer (Angular SPA)
• HTTP API Layer (Spring Boot Controllers)
• Business Logic Layer (Spring Services & Specifications)
• Data Access Layer (Spring Repositories, JPA)
• Database (H2 in-memory)
• External libraries/frameworks (Angular Material, RxJS, Spring Data JPA, ModelMapper)
b. Relationships & interactions
• UI initiates CRUD and filter requests via HttpClient → REST endpoints.
• Controllers map request DTOs → call corresponding Service.
• Services apply business rules (validation, loan restrictions) and delegate to Repositories.
• Repositories translate to JPA queries (including Specifications for dynamic filtering).
• Database returns persisted entities → mapped back via ModelMapper → returned as DTO → UI updates state (observables).
c. Architectural patterns & design principles
• Frontend: Component-based architecture, routing module, service layer for API abstraction, reactive programming with RxJS.
• Backend: Layered architecture (Controller → Service → Repository), use of DTOs and ModelMapper for mapping, Specification pattern for search criteria, pagination abstraction.
• Separation of concerns, single responsibility per component, RESTful API design.
d. Key technologies/frameworks
• Frontend: Angular 17, TypeScript, Angular Router, Angular Material, Bootstrap, RxJS, HttpClient.
• Backend: Java 21, Spring Boot (Web, Data JPA, Validation), H2, ModelMapper, JUnit 5, Maven.
Elements
• Clear labels: “Angular SPA”, “AuthorComponent”, “GameService”, “LoanRepository”, “H2 DB”, etc.
• UI → HttpClient → Controller
• Controller → Service → Repository → DB
• DB → Repository → Service → Controller → UI
• Blue rectangles for frontend components (modules, services).
• Green rectangles for backend layers (controllers, services).