Skip to content

SpringFlow Documentation

Auto-generate complete REST APIs from JPA entities with a single annotation.

Build Status Maven Central License Coverage


What is SpringFlow?

SpringFlow is a Spring Boot library that reduces 70-90% of boilerplate code by automatically generating:

  • Repositories (JpaRepository with Specifications)
  • Services (CRUD operations with transaction management)
  • REST Controllers (Complete CRUD endpoints)
  • DTOs (Input/Output mapping with validation)
  • OpenAPI Documentation (Swagger UI integration)

All from a single @AutoApi annotation on your JPA entities.


Quick Example

@Entity
@AutoApi(path = "products")
public class Product {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotBlank
    @Size(min = 3, max = 100)
    private String name;

    @Min(0)
    private BigDecimal price;

    @Hidden
    private String internalCode;

    @ManyToOne
    private Category category;
}

That's it! SpringFlow automatically generates:

  • GET /api/products - List with pagination & sorting
  • GET /api/products/{id} - Get by ID
  • POST /api/products - Create
  • PUT /api/products/{id} - Update
  • DELETE /api/products/{id} - Delete
  • Complete OpenAPI/Swagger documentation
  • Input validation with JSR-380
  • DTO mapping (excludes @Hidden fields)
  • Repository, Service, and Controller beans

Key Features

Zero Boilerplate

Write only your domain model. SpringFlow generates everything else at runtime.

Production Ready

  • Transaction management
  • Exception handling
  • Input validation (JSR-380)
  • Security integration
  • Soft delete support
  • Audit trail

Flexible & Extensible

  • Override generated behavior
  • Add custom endpoints
  • Configure via annotations or YAML
  • Works with existing Spring components

Advanced Filtering

@Filterable(types = {FilterType.EQUALS, FilterType.LIKE, FilterType.RANGE})
private String name;

Enables: GET /api/products?name_like=Phone&price_range=100,500

Built-in Security

@AutoApi(
    path = "users",
    security = @Security(
        enabled = true,
        roles = {"ADMIN", "USER"}
    )
)

Soft Delete

@Entity
@AutoApi
@SoftDelete
public class Article { ... }

Adds GET /api/articles?includeDeleted=true and POST /api/articles/{id}/restore


Installation

Maven

<dependency>
    <groupId>io.github.tky0065</groupId>
    <artifactId>springflow-starter</artifactId>
    <version>0.5.1</version>
</dependency>

Gradle

implementation 'io.github.tky0065:springflow-starter:0.5.1'

Getting Started

  1. Quick Start Guide - Get up and running in 5 minutes
  2. Installation - Detailed setup instructions
  3. First Project - Build your first API

Requirements

  • Java 17 or higher
  • Spring Boot 3.2.1 or higher
  • Maven 3.6+ or Gradle 7.0+

Language Support

SpringFlow supports both Java and Kotlin:

@Entity
@AutoApi(path = "products")
public class Product {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @NotBlank
    private String name;
}
@Entity
@AutoApi(path = "products")
data class Product(
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    val id: Long? = null,

    @field:NotBlank
    val name: String
)

See Kotlin Support Guide for details.


What's Next?

Core Concepts

Advanced Topics

Contributing


Community & Support


License

SpringFlow is released under the Apache License 2.0.