Hexaboot is a CLI generator for Java and Spring Boot backend projects following Hexagonal Architecture.
Built with Node.js and Yeoman, it scaffolds a multi-module Maven project from a few configuration options and an optional JSON entity definition. It reduces repetitive project setup by generating the base architecture, CRUD components and persistence configuration for PostgreSQL, MySQL, Oracle or MongoDB.
- Java 17 + Spring Boot backend project.
- Multi-module Maven structure following Hexagonal Architecture.
- Controllers, services, use cases, repositories, domain models and persistence entities.
- Base CRUD operations from an entity definition.
- Entity relationships defined in JSON.
- Database-specific dependencies and persistence configuration.
- Generated mappings and boilerplate using MapStruct and Lombok.
The generator itself uses JavaScript, Node.js, Yeoman and .tpl templates to produce the Java source code.
- Node.js 20.14.0
- Java 17
- npm
- Yeoman CLI 4.3.1
Yeoman CLI 4.3.1 is recommended because of file-overwrite issues with Yeoman CLI 5.x.
Install Yeoman:
npm install -g yo@4.3.1Clone and install Hexaboot:
git clone https://github.com/sergioapi/hexaboot.git
cd hexaboot
npm install
npm linkRun the generator:
yo hexabootHexaboot will guide you through the configuration:
? What is the application name?
? Choose the database engine (MySql, Postgres, Oracle or MongoDB)
? What is the groupID of the project?
? What is the version of the project?
? Do you want to include a data model definition file?
? Enter the path to the entity definition file:
An optional JSON file can define the entities, fields and relationships used to generate the base application code.
{
"entities": [
{
"name": "Student",
"fields": [
{ "name": "name", "type": "String" }
],
"relations": [
{
"type": "ManyToMany",
"targetEntity": "Course",
"fieldName": "courses"
}
]
}
]
}The definition is parsed by the generator and used by the .tpl templates to create the corresponding components in the generated project.
generated-project/
├── application/
├── domain/
├── infrastructure/
└── shared-kernel/
The generated modules separate application logic, domain code and infrastructure concerns. The shared-kernel module contains shared elements such as the custom @UseCase annotation, allowing use cases to be identified without introducing Spring-specific logic into the application layer.
More detailed usage and implementation documentation is available in the documentation directory.