Welcome to the Pet API, a modern Spring Boot-based REST API for managing virtual pets. This API follows a Hexagonal Architecture approach, ensuring a modular and maintainable design by separating the domain logic, infrastructure, and application layers.
There is also an MVC version of this project that you can find here
β
Hexagonal Architecture β Decoupled design for scalability and testability.
β
Pet Management β Create, update, delete, and track virtual pets with persistent storage.
β
User System β Pets are associated with users, enabling personalized experiences.
β
Persistence with JPA β Uses Spring Data JPA with MySQL for robust storage.
β
Domain-Driven Design (DDD) β Clear separation of concerns with ports & adapters.
β
RESTful API Design β Fully documented with OpenAPI (Swagger) for easy integration.
β
Unit & Integration Tested β Ensures reliability with JUnit and Mockito.
- Java 21
- Maven 3.6.3
- Spring Boot 3.4.1
- MySQL 9.1.0
- Spring Web
- Spring Data JPA
- Lombok
- Swagger (Springdoc OpenAPI)
- JUnit 5
- Mockito
flowchart TD
A[Client] -->|REST API| B[Pet API]
B -->|Handles Pet Requests| C[PetRESTController]
C -->|Calls Application Logic| D[PetService]
D -->|Interacts with Domain Layer| E[PetRepositoryPort]
E -->|Persistence Logic| F[PetRepositoryImpl]
F -->|Stores Data| G[(MySQL)]
Move to the base folder of the project you want to run and:
- Compile the project
mvn compile- Pack the project
mvn package- Clean the project
mvn clean- Execute the application
mvn spring-boot:runhttp://localhost:8080/swagger-ui.html