How xsergiodm/metaudla works
Project Type and Purpose
• Metaudla is a Spring Boot–based backend service (REST API) for an educational metaverse.
• It exposes HTTP endpoints for user and “isla” (virtual world) management, social interactions (comments, likes, favorites, ratings), and statistics.
High-Level Architecture
• Layered MVC style:
• Presentation/API Layer (Controllers)
• Business Logic Layer (Services + Mappers)
• Data Access Layer (Repositories + Entities)
• Infrastructure (Database, Security, Configuration)
Main Components
a. Clients
• Web front-end or mobile app
• API consumers (e.g., analytics tools, admin dashboards)
b. API Gateway / Load Balancer (optional)
c. Controllers (/api/usuarios, /api/islas)
d. DTOs & Mappers
• DTO packages under src/main/java/.../DTOs
• Mapstruct or manual mappers convert between DTOs and Entities
e. Services
• IGestionUsuario / GestionUsuarioImpl
• IGestionIsla / GestionIslaImpl
f. Repositories (Spring Data JPA interfaces)
• UsuarioRepository, IslaRepository, etc.
g. Entities (Domain Models)
• Usuario, Isla, Comentario, Favorito, MeGusta, Puntuacion, etc.
h. Database
• MySQL instance
i. Security Layer
• Spring Security config (SecurityConfig)
• Authentication (Session or JWT)
j. Configuration
• application.properties
• ServiceConfig, banner
Relationships & Data Flows
• Client → HTTP Request → Controller
• Controller invokes Service method
• Service applies business rules, uses Mappers to translate DTO↔Entity
• Service calls Repository methods
• Repository executes SQL on MySQL DB
• Data flows back through layers: Entity → Mapper → DTO → Controller → Client
• SecurityConfig intercepts incoming requests (authentication/authorization)
• Optional external services (e.g., email, file storage) can be shown as side-services
Architectural Patterns & Principles
• Layered pattern (separation of concerns)
• Dependency Injection (Spring context)
• Repository pattern (Spring Data JPA)
• DTO pattern (to decouple internal models from API)
• Configuration as code (Java & properties files)
• Liskov substitution for service interfaces (IGestionUsuario/IgestionIsla)
Technologies & Frameworks
• Java 21, Spring Boot 3.5.6
• Spring Web MVC (REST controllers)
• Spring Data JPA (repositories)
• Spring Security (authentication & authorization)
• Spring Validation
• MySQL (RDBMS)
• Lombok (boilerplate reduction)
• Maven (build tool)
Essential Details to Capture
• All REST endpoints grouped under their Controller.
• Service interfaces vs. implementations.
• DTOs and mappers as the translation boundary.
• Repository interfaces mapping to tables in MySQL.
• SecurityConfig intercepting requests before Controllers.
• application.properties settings (DB URL, credentials, JPA dialect).