Spring Boot REST API – Hexagonal Architecture
This project is a Spring Boot REST API built with Hexagonal Architecture (Entities & DataSources) to promote separation of concerns, testability, and maintainability.
The main goal is to keep the domain model independent of external frameworks and infrastructure, ensuring that business logic remains at the core of the application.
✅ Architecture Validation with ArchUnit
To enforce the Hexagonal Architecture rules, the project uses ArchUnit . ArchUnit provides automated tests that validate the package structure and ensure dependencies flow correctly.
Some examples of validated rules:
Domain layer does not depend on Spring, JPA, or other frameworks.
Adapters depend only on application ports, never directly on domain internals.
Application layer depends only on the domain layer.
This guarantees that the architecture remains consistent as the project evolves.
🚀 Tech Stack
Java 17+
Spring Boot 3+
Maven
ArchUnit (for architecture validation)
JUnit 5
REST API (Spring Web)