StaffManager is a backend architecture laboratory designed to manage the complexity of organizational structures. This project serves as a technical environment for implementing professional design patterns, focusing on referential integrity, layer decoupling, and clean persistence logic.
This project prioritizes a clean separation of concerns and robust dependency management:
- Pattern Decoupling (DTO): Strict separation between JPA persistence entities and Data Transfer Objects (DTO) to prevent domain leakage into the API layer.
- Constructor Injection: Use of constructor-based dependency injection to ensure service immutability and improve testability, moving away from field-level
@Autowired. - Global Error Handling: Centralized exception management via
@RestControllerAdvice, ensuring that the API provides semantic, consistent, and controlled HTTP responses.
The technical core of the system focuses on the orchestration of complex data relationships:
- Defensive Entity Logic: Implementation of internal helper methods (e.g.,
addProject) within entities to maintain synchronization in@ManyToManybidirectional relationships. - Soft Delete Engine: Logical deletion management via the
isActivestate flag. This preserves data for auditing purposes while keeping the active dataset clean for standard operations. - Atomic Operations: Strategic use of
@Transactionalat the service layer to guarantee data consistency during multi-entity updates.
| Component | Technology |
|---|---|
| Runtime | Java 17 (Amazon Corretto) |
| Framework | Spring Boot 3.4.x |
| Persistence | Spring Data JPA / Hibernate |
| Database | PostgreSQL 15 |
| Documentation | OpenAPI 3 (Swagger UI) |
| Infra | Docker & Docker Compose |
This project follows a continuous improvement path. Current development focuses:
- MapStruct Integration: Transitioning from manual mappers to automated code generation to eliminate boilerplate.
- Advanced Domain Validation: Implementing strict business rules within the service layer (e.g., workload limits and status-based assignments).
- Security Layer: Integrating Spring Security 6 with JWT for Role-Based Access Control (RBAC).
- Performance Tuning: Solving N+1 query issues through the implementation of
EntityGraphsand specialized JPQL fetching.
- Clone the repository:
git clone [https://github.com/aguspq/StaffManager.git](https://github.com/aguspq/StaffManager.git)
- Spin up infrastructure (Database):
docker-compose up -d
- Run the application:
mvn spring-boot:run
- Explore the API:
Access
http://localhost:8080/swagger-ui/index.htmlonce the server is running.
Developed with a focus on SOLID principles, Clean Code, and professional engineering standards.