How joel-x-x/prueba-tecnica-shenzhen works
Main Components
• Frontend (Angular 19):
• Modular architecture with separate modules such as AdminModule, AuthModule, and PublicModule.
• Components like login, registration, post listing, and administrative interfaces (user and post management).
• Integration aspects like the HTTP interceptors for JWT handling and state management (NgRx or Signals).
• Backend (Spring Boot 3.2.6):
• Major layers according to the Clean Architecture principles: the Controller layer, Service layer, and Repository/Data Access layer.
• Controllers: AuthController, PostController, and UserController.
• Domain layer that contains entities and DTOs for users, posts, roles, and auditing.
• Infrastructure components such as SecurityConfiguration, SwaggerConfiguration, JWT components (JwtAuthenticationFilter, JwtService), and exception handling (ErrorHandler).
• Mention integration with Hibernate (JPA) and use of migration scripts (under resources/db/migration).
• Database (SQL Server):
• How the backend communicates with the SQL Server using Hibernate JPA and JDBC drivers.
• Auxiliary/Integration Components:
• Docker & Docker Compose:
• Docker containers for running the backend and SQL Server.
• Docker-compose setup that orchestrates these containers.
• Documentation and Testing:
• Swagger UI (available at http://localhost:8080/swagger-ui.html) for API documentation.
• Postman collection and unit/integration tests for various modules.
Relationships and Interactions
• Frontend-to-Backend:
• JWT authentication flow: authentication request → backend issues token → token stored on frontend → subsequent requests include the token.
• Backend-to-Database:
• That backend services interact with the SQL Server through JPA repositories.
• External Dependencies:
• Where necessary, note supporting services such as Docker for environment orchestration and SQL Server CLI for database management.
Architectural Patterns & Design Principles
• Clean Architecture / Layered Architecture:
• Distinct layers (Controller, Service, Repository, Domain, and Infrastructure).
• Usage of DTOs and entity separation to decouple data representation.
• Security & Token-based Authentication:
• JWT and Spring Security as key design elements, highlighting filters (JwtAuthenticationFilter) and security configurations.
• Modularization in Frontend:
• Lazy loading and modular structure (Admin, Auth, Public) in Angular, which aids in scalability and maintainability.