How luanvarg/reto-kruger-vaccination-inventory works
Project’s Main Components
• Application Entry Point: VaccinationInventoryApplication.java, which boots up the Spring Boot application.
• Controllers: Under the “controller” package (e.g., EmployeeController.java) that expose endpoints for operations such as registering, updating, deleting, and fetching employee data.
• Entities: In the “entity” package (e.g., EmployeeEntity.java) representing the data model that maps to database tables.
• Repositories: In the “repository” package (e.g., EmployeeRepository.java) for data access and persistence logic.
• Services: In the “service” and “service/impl” packages (e.g., EmployeeService and EmployeeServiceImpl) that contain the business logic.
• Security: Under the “security” package (e.g., BasicAuthWebSecurityConfiguration.java) configuring basic HTTP authentication.
• Data Model Documentation: Referenced in the DataModel directory, which visually represents the database schema.
• External Components: PostgreSQL database deployed on GCP (with connection details provided in the README) and Swagger UI for API documentation.
Relationships and Interactions
• HTTP Client (or Swagger UI) → Controller: API calls are received by the controllers.
• Controller → Service: Controllers delegate requests to the Service layer to process business logic.
• Service → Repository: The Service layer calls Repository methods to interact with the PostgreSQL database.
• Database: The PostgreSQL database holds the persistent data.
• Security: All incoming HTTP requests are filtered and authenticated via the BasicAuthWebSecurityConfiguration.
• Maven and Build Tools: While not a runtime architectural element, the pom.xml and Maven Wrapper components indicate project configuration and dependency management.
Architectural Patterns and Design Principles
• Layered (n-tier) Architecture: The project is clearly separated into distinct layers (Controller, Service, Repository, Entity).
• RESTful API Design: Controllers expose HTTP endpoints following standard REST conventions.
• Security by Configuration: Basic HTTP authentication is configured centrally, ensuring that endpoints are protected.
• Dependency Injection: Spring Boot manages beans and wiring between controllers, services, repositories, and security components.