Skip to content

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

Notifications You must be signed in to change notification settings

Ramonrz/hexagonal-architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages