Source Code : https://github.com/therohk/hiberium
Documentation : Readme | Schema | Sample
Hiberium is a code generator to create working springboot+hibernate projects from a schema definition in csv.
Hiberium uses freemarker templates to render all the java classes required for a high-quality deployable webapp.
The key features are :
- Easy to Use : No coding required! Generate the entire web application from one yaml and two csv files.
- Clean Architecture : Generates the repository, service and controller layers for each entity.
- Compatible : Generates accurate jpa entities, table spec (postgres dialect) and elastic mappings from schema. Creates a docker postgres container with generated tables.
- Production Quality : Integration with swagger and prometheus. Proper request logging and error handling.
- Pragmatic : Explore other useful endpoints like paginated rsql search, bulk entity merge and csv import/export.
- Configurable : Configure attributes and merge behaviors using simple alphabetic flags.
- Extensible : Easily modify the project model or implement your own templates and coding patterns.
- Composable : Supports two-level nesting of concepts. Seamlessly transform between nested and flat models.
- Browsable : Generates html forms and submission apis with a browser using sleek bootstrap interfaces.
Follow these steps to render the sample project and bring up the application server.
To change the concepts and attributes in the sample definition refer to the schema document.
-
Clone this repository and open with Intellij
-
Run the gradle command
gradle clean build
-
Run the code from
RenderProject.java
orgradle render
-
Webapp has been generated under the child project
hiberium-war
-
Reimport/Refresh the gradle project then run
gradle clean build
-
Raise the spring webapp from
Application.java
orgradle bootRun
-
Explore the swagger api docs at
localhost:8080/hiberium/1.0/swagger-ui.html#
OR use local Docker:
- Raise the webapp with a postgres container using
docker-compose up -d
Start writing business logic and setup connection details in application-{profile}.properties
.
-
Full support for spring mongo and elastic search client.
-
Support rendering project from jar file and externalized config.
-
Support for running the application as a lambda function.
-
Integrate spring security with JWT tokens and user roles.
-
Ability to view the diff between any entity vs its persisted copy.
Code contributions are welcome via issues and pull requests.
This project is licensed under the terms of the Apache License 2.0.