How angelichazu/krugger_vacunas works
Main Components
• Docker & Docker Compose: Represent the orchestration of containers.
• One container for the PostgreSQL database (including the initialization script in dockerPostgres).
• One container for running the Spring Boot application.
• Spring Boot Backend Application:
• Controllers: For handling HTTP requests (e.g., EmpleadoController, LoginController).
• Services: Business logic implementation (like EmpleadoService).
• Repositories: Data persistence layer managing CRUD operations using JPA interfaces (e.g., EmpleadoRepository, RolRepository, etc.).
• Entities/Models: Domain objects (Empleado, Rol, Usuario, Vacuna, etc.) and Data Transfer Objects (EmpleadoDto, VacunaDto).
• Configurations: Including security (SecurityConfig), Swagger documentation (SwaggerConfig), and user configuration (UsuarioConfig).
• External Clients:
• Swagger UI: A web client used for testing the API endpoints.
• Any other client consuming the web services.
Relationships and Interactions
• Clients (like Swagger UI) send HTTP requests to the backend.
• Controllers receive and process these requests. They may call respective service components to handle the business logic.
• Services interact with repository components to perform database operations against the PostgreSQL container.
• The database container holds the persistent data as defined in the SQL initialization scripts.
• Additionally, the configuration layer (including security configurations) plays a crucial role in controlling access to endpoints as indicated (e.g., ADMIN vs. USER access).
Architectural Patterns & Design Principles
• Layered (MVC) Architecture: Segregate responsibilities into Controller, Service, and Repository layers.
• Containerization: Use of Docker and docker-compose to encapsulate environment specifics.
• API Documentation: Swagger integration ensures clear exposure of endpoints for testing and integration.
• Security: Via SecurityConfig, the application implements role-based access control.
Incorporate Technologies, Frameworks, and Tools
• Java (JDK 11) and Spring Boot for core development.
• Maven for build and dependency management.
• PostgreSQL as the database.
• Docker for containerization along with docker-compose for orchestration.
• Swagger for API documentation and interactive tests.
• Spring Security as configured in SecurityConfig for managing authentication and authorization.