trzpiot / spring-gradle-hexagonal-example

A Spring example application with a hexagonal (clean) architecture & multi modules with Gradle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spring-gradle-hexagonal-example

Maintenance

A Spring example application with a hexagonal (clean) architecture & multi modules with Gradle.

Prerequirements

  • JDK >= 21
  • Docker
  • Docker Compose

Run

Clone the project

# HTTPS
git clone https://github.com/trzpiot/spring-gradle-hexagonal-example.git

# or

# SSH
git clone git@github.com:trzpiot/spring-gradle-hexagonal-example.git

Go to the project directory

cd spring-gradle-hexagonal-example

Start the Neo4j server

cd database-neo4j
docker-compose up -d
cd ..

Start the example application server

./gradlew bootRun

API

You can use the Bruno collection for testing the API (What is Bruno?).

Create person

Request

POST /person/create

{
  "name": "Name",
  "firstName": "FirstName",
  "age": 44
}

Response

The Object ID of the created person entity.

"b6b5a014-1829-4195-b7be-80b742455297"

Get person

Request

GET /person/get/{objectId}

Response

{
  "objectId": "b6b5a014-1829-4195-b7be-80b742455297",
  "name": "Name",
  "firstName": "FirstName",
  "age": 44
}

About

A Spring example application with a hexagonal (clean) architecture & multi modules with Gradle.

License:MIT License


Languages

Language:Java 100.0%