/spring-boot-hexagonal

Spring Boot example approach for implementing a Hexagonal Architecture

Primary LanguageJava

Spring Boot Hexagonal

Project shows, how to use hexagonal architecture in your spring boot applications

Hexagonal Architecture

Implemented integrations:

  • Mysql (Spring Data JPA)
  • Redis (Spring Data Redis)

Prerequisites

  • JDK 17
  • this project uses Lombok, so enable annotation processing in your IDE
  • this project uses Testcontainers, so run Docker on your local machine

Getting Started

gradle testBootRun

Project Structure

└──com/
    └── yourcompany/
        ├── adapter/                # Adapter logic
        │   ├── in/                 # Incoming requests adapters
        │   │   └── http/
        │   └── out/                # Outgoing requests adapters
        │       ├── cache/
        │       ├── kafka/
        │       └── persistense/
        ├── application             # Core logic
        │   ├── domain/
        │   │   ├── model/
        │   │   └── service/
        │   └── port/               # Core logic API
        │       ├── in/
        │       └── out/
        └── common/                 # Neither business logic nor adapters

See More