{"id":20266757,"url":"https://github.com/hirannor/springboot-hexagonal-ddd","last_synced_at":"2025-06-29T21:39:15.406Z","repository":{"id":169334779,"uuid":"628703249","full_name":"hirannor/springboot-hexagonal-ddd","owner":"hirannor","description":"Spring-Boot application based on hexagonal architecture and DDD","archived":false,"fork":false,"pushed_at":"2024-05-11T08:48:13.000Z","size":178,"stargazers_count":126,"open_issues_count":0,"forks_count":22,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-08T12:50:13.096Z","etag":null,"topics":["architecture","clean-architecture","ddd","ddd-patterns","event-driven","eventbus","hexagonal","hexagonal-architecture","java","jdk17","maven","messaging","port-and-adapters","rest","software-architecture","software-development","spring-boot","spring-data-jpa","spring-mvc","springframework"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hirannor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-16T19:01:36.000Z","updated_at":"2024-10-14T06:58:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"bbe4f9ba-cf89-4132-a0dc-229b54d3018d","html_url":"https://github.com/hirannor/springboot-hexagonal-ddd","commit_stats":null,"previous_names":["hirannor/springboot-hexagonal-ddd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Fspringboot-hexagonal-ddd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Fspringboot-hexagonal-ddd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Fspringboot-hexagonal-ddd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hirannor%2Fspringboot-hexagonal-ddd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hirannor","download_url":"https://codeload.github.com/hirannor/springboot-hexagonal-ddd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230527866,"owners_count":18240051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","clean-architecture","ddd","ddd-patterns","event-driven","eventbus","hexagonal","hexagonal-architecture","java","jdk17","maven","messaging","port-and-adapters","rest","software-architecture","software-development","spring-boot","spring-data-jpa","spring-mvc","springframework"],"created_at":"2024-11-14T12:11:15.006Z","updated_at":"2024-12-20T03:09:33.026Z","avatar_url":"https://github.com/hirannor.png","language":"Java","readme":"# Spring-Boot - Ports-And-Adapters / Hexagonal Architecture with DDD\n\n\n## Overview\nAn example of a Spring-Boot application, which based on the port and adapters/hexagonal architecture and DDD.\n\n|Build Status|License|\n|------------|-------|\n|[![Build Status](https://img.shields.io/github/actions/workflow/status/hirannor/springboot-hexagonal-ddd/.github/workflows/maven.yml)](https://github.com/hirannor/springboot-hexagonal-ddd/actions/workflows/maven.yml)|[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)|\n\n## Prerequisites for development\n\n- [Git](https://git-scm.com/downloads)\n- [JDK 17](https://adoptium.net/)\n- [Maven](https://maven.apache.org/download.cgi)\n- [Docker Desktop](https://www.docker.com/products/docker-desktop/)\n\n## Implementing a new adapter\n\nIn the application the whole component scan for the adapter package is excluded, so the unnecessary adapter beans won't be loaded into the application context, just the configured ones.\nEach adapter defines her own spring configuration class, which is imported via the **@Import** annotation (on top of the application's main class) but only those get component scanned where the condition(s) fulfills for it via **@ConditionalOnProperty** annotation.\n\nBased on the below example if you define \"spring-data-jpa\" value as a persistence adapter in the application-[profile].yml, \nthen it will activate the corresponding Configuration class, which is going to component scan the underlying packages for spring beans.\n\n### Example\n\n```java\n@Configuration\n@EnableJpaRepositories\n@ComponentScan\n@ConditionalOnProperty(\n        value = \"adapter.persistence\",\n        havingValue = \"spring-data-jpa\"\n)\npublic class JpaPersistenceConfiguration {\n\n}\n```\n\napplication-[profile].yml\n```YAML\nadapter:\n  authentication: basic\n  persistence: spring-data-jpa\n  messaging: spring-event-bus\n  web: rest\n```\n\n## Build and test with Maven\n```\nmvn clean verify\n```\n\n**Building and verifying the application requires a running docker, since some tests are using\nTestcontainers library!\n\n\n### Test catalog and Maven lifecycle bindings\n\n| Test catalog type | Maven lifecycle |\n|:-----------------:|:---------------:|\n|     Unit test     |      test       |\n|  Component test   |      test       |\n|   ArchUnit test   |      test       |\n| Integration test  |     verify      |\n|  Functional test  |     verify      |\n\n## API Documentation\nYou can access the API documentation locally at the following URL:\n\n[http://localhost:8080/swagger-ui/index.html](http://localhost:8080/swagger-ui/index.html)\n\n\n![Preview](img/openapi-swagger-ui.PNG)\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirannor%2Fspringboot-hexagonal-ddd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhirannor%2Fspringboot-hexagonal-ddd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhirannor%2Fspringboot-hexagonal-ddd/lists"}