Appearance
Getting Started
CrudCraft helps you generate full CRUD REST APIs with minimal boilerplate.
Requirements
- Java 21
- Maven 3.9+
Add Dependencies
Include the CrudCraft BOM or individual modules in your pom.xml
to pull in annotations, the processor and runtime libraries.
xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>crudcraft-bom</artifactId>
<version>${crudcraft.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Annotate Entities
Mark your JPA entities with @CrudCrafted
and indicate which fields belong on DTOs or request objects.
java
@CrudCrafted(editable = true)
@Entity
public class User {
@Id
private UUID id;
@Dto
private String username;
@Request
private String password;
}
Build
Run mvn clean install
to generate DTOs, repositories, services and controllers. If editable
is enabled, stubs are created under target/generated-sources
.
Run the Sample App
Try the included sample application to see the endpoints in action:
bash
cd crudcraft-sample-app
mvn spring-boot:run
You now have a fully functional REST API based on your entity model.