Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trzpiot/spring-gradle-hexagonal-example
A Spring example application with a hexagonal (clean) architecture & multi modules with Gradle.
https://github.com/trzpiot/spring-gradle-hexagonal-example
clean-architecture gradle hexagonal hexagonal-architecture java multi-modules ports-and-adapters spring spring-boot
Last synced: 7 days ago
JSON representation
A Spring example application with a hexagonal (clean) architecture & multi modules with Gradle.
- Host: GitHub
- URL: https://github.com/trzpiot/spring-gradle-hexagonal-example
- Owner: trzpiot
- License: mit
- Created: 2019-04-15T11:12:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T13:54:34.000Z (12 months ago)
- Last Synced: 2024-01-01T14:52:04.118Z (12 months ago)
- Topics: clean-architecture, gradle, hexagonal, hexagonal-architecture, java, multi-modules, ports-and-adapters, spring, spring-boot
- Language: Java
- Homepage:
- Size: 138 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# spring-gradle-hexagonal-example
[![Maintenance](https://img.shields.io/maintenance/yes/2024)](https://github.com/trzpiot/spring-gradle-hexagonal-example/commits/main)
A Spring example application with a hexagonal (clean) architecture & multi modules with Gradle.
## Prerequirements
- JDK >= 21
- Docker
- Docker Compose## Run
#### Clone the project
```bash
# HTTPS
git clone https://github.com/trzpiot/spring-gradle-hexagonal-example.git# or
# SSH
git clone [email protected]:trzpiot/spring-gradle-hexagonal-example.git
```#### Go to the project directory
```bash
cd spring-gradle-hexagonal-example
```#### Start the Neo4j server
```bash
cd database-neo4j
docker-compose up -d
cd ..
```#### Start the example application server
```bash
./gradlew bootRun
```## API
You can use the [Bruno collection](/bruno) for testing the API ([What is Bruno?](https://github.com/usebruno/bruno)).
### Create person
#### Request
`POST /person/create`
```json
{
"name": "Name",
"firstName": "FirstName",
"age": 44
}
```#### Response
The Object ID of the created person entity.
```json
"b6b5a014-1829-4195-b7be-80b742455297"
```### Get person
#### Request
`GET /person/get/{objectId}`
#### Response
```json
{
"objectId": "b6b5a014-1829-4195-b7be-80b742455297",
"name": "Name",
"firstName": "FirstName",
"age": 44
}
```