in Uncategorized

Spring Boot Database Admin: automatically generated CRUD web UI for Spring Boot/JPA apps

TLDR: Spring Boot Database Admin (now renamed SnapAdmin) is a lightweight dependency that you can integrate into your Spring Boot/JPA applications to have an automatically generated CRUD management interface based on your JPA classes. It’s released on Github and distributed on Maven.

If you want to see what it looks like, you can check the live demo, too! Don’t be afraid to make edits, the database resets every hour.


I’m positive that if you are a web developer you’ve found yourself many many times in the situation where you have to build yet another CRUD interface. This happens often, even when the project has a very simple client-facing front-end, because you’ll usually need to have other functionalities available for administration purposes.

This task is very repetitive and time-consuming. Other frameworks, like Django, have solutions like the admin site, which automate most of this process or at least heavily simplify it. From my research, something similar was missing in the Spring Boot ecosystem so I decided to build it on my own.

Before introducing Spring Boot Database Admin, let’s see what the alternatives are.

Bootify

Bootify allows you to build the initial scaffolding and automatically generated code for your project using a web interface. After you specify your database schema and other information about your project, a fully-working code base with CRUD features is generated for download. You can then start working on it and customize it according to your needs.

This is a good solution if you want to start a project from scratch, but its biggest limitation is that you won’t be able to use it on an already established code base. Also, the responsibility to update the code falls on you, meaning that if you change your classes you will also need to update the respective views.

If you need high customization, this might be the right solution. It will save you time at the beginning and provide a nice and clean skeleton which you can build upon. If you want a set and forget management interface that automatically updates when you change your class definitions, that you can integrate in an already existing project, keep reading.

JHipster

JHipster is a full-fledged development platform for web applications. It does so many cool things, and its scope is way bigger than just CRUD features. It provides you with authentication/authorization, database setup, front-end stack configuration, and more. Among the pletora of features, it also provides a very good database management interface with CRUD operations.

I haven’t used it extensively, but it looks very powerful. Due to the difference in the intended goals, a comparison with Spring Boot Database Admin is not useful. Spring Boot Database Admin is intended as a simple, lightweight dependency and not as a powerful framework for web app development. If the latter is what you need, I would suggest giving JHipster a try.

Spring Boot Database Admin SnapAdmin

Besides Bootify and JHipster, I haven’t found other solid alternatives. Somebody on Reddit mentioned Grails, but I didn’t include it because it seems more Groovy-oriented. Also, like JHipster, it’s a complete web framework so you might not want to pull all that just for the CRUD features.

Spring Boot Database Admin is intended as a lightweight dependency that you can pull into any existing Spring Boot/JPA application. It should work with minimal configuration and provide an out-of-the-box interface which has standard CRUD features (and hopefully more in the future). It doesn’t generate actual code that you have to integrate, but everything is done at runtime by scanning your JPA classes when the application starts.

At the time of this writing, the project is still at a very early stage. It’s been almost one month since I started working on it and I’ve fixed some core issues thanks to the kind people that reported them on Github. However, there’s still a long way to go, especially in terms of robustness.

If you want to give it a try, you can check the Github repo. It contains detailed instructions on how to run it.

For the next few weeks the plan is to introduce some new features but mostly gather feedback and failure modes with different Spring configurations, in order to make it as robust as possible. If you do give it a try, please let me know any feedback or don’t hesitate to open an issue if you find any problem.

Cheers!