FeGen generates client code based on your Spring backend, so you can consume your Spring Data REST API in a type safe manner. Typescript and Kotlin are supported as frontend languages, so FeGen helps you create a web app, a native Android app or another Spring application.
If you are new to FeGen, have a look at the Documentation.
An example project demonstrating the usage of FeGen can be found in the git submodule fegen-examples
.
FeGen plugins are available for Gradle as well as Maven. Code generated by FeGen enables you to access the following Spring features:
- Call CRUD operations on
JpaRepository
s while using pagination and sorting - Fetch multiple related entities in one API call using projections
- Use repository- as well as custom searches to only access entities matching certain criteria
- Call custom endpoints
Code can be generated for the following target platforms:
- Typescript (To be used in e.g. a React app)
- Kotlin
- Inter service (To be used in another Spring application)
- Android
FeGen currently has some limitations such as the following which may be lifted in future versions:
- Embeddables can be used, but they may only contain primitive types since references to other entities are not yet supported
- A plugin for Swift (to use in iOS apps) exists, but is not yet publicly released
- Generating code for API endpoints used to up- or download files is not supported
- There are some tests for the generated code, however, currently no CI/CD pipeline exists
- Bean Validation support (similar to FeGen's support for Spring Security)
- Support for Feign as a generation target for service-2-service communication
- OpenAPI interoperability
The source code of FeGen is split into two gradle subprojects that correspond to the frontend languages that code can be generated for.
Additionally, fegen-core
contains the code that is independent of the target language.
Each of these directories contain two sub projects that contain code that is specific to maven and gradle respectively.