Last updated: 2024-04-19

  1. Learn
  2. Spring Boot
  3. PetClinic

Creating your custom PetClinic with Bootify

The PetClinic is the classic example of a Spring Boot application. This article explains how to create our customized PetClinic prototype using Bootify, where some features of the original application are missing and others are added on top. Each app can be individually adapted to your own wishes and all libraries are up to date - currently based on Spring Boot 3.2.5.

Starting the project

First, a new project should be started in Bootify, directly in the browser without registration. Normally we would start an empty project via the link in the header and then create the PetClinic database schema as entities using the SQL import. To skip this step, you can instead directly use this link to create a project with the prepared database schema and some preferences.

UML preview of the PetClinic schema in Bootify

UML preview of the PetClinic schema in Bootify

Each created project can be accessed via its individual URL and is also saved in a cookie.

Preferences and CRUD operations

A project with Java, Lombok and Gradle is created with the above link - if desired, you can switch to Kotlin or Maven instead. MySQL is preset as the database. As the option for docker compose is also active, you should have Docker available so that it is automatically connected via a container. Alternatively, you can also select an embedded database or configure the database connection after the download.

Each entity class is named in the singular, whereby the actual table names are kept in the plural as in the original PetClinic application.

Thymeleaf with Bootstrap is chosen as the frontend, so that the latest version of Bootstrap is integrated as a WebJar. The other frontend options provide a configuration with Angular or Thymeleaf and Webpack, including the build integration. The CRUD operations for the frontend are already activated for all tables.

Selecting the CRUD options of an entity

Selecting the CRUD options of an entity

The frontend could also be deactivated completely. To provide CRUD operations as a REST API, the corresponding options can be activated directly at the entities. Using Swagger UI, the provided API can be explored locally after starting the application.

Download and start the application

If you are satisfied with the settings, the code of your individual PetClinic application can be explored and downloaded. If you have stayed with Gradle, you can launch your application using gradlew bootRun. The exact instructions for starting and building the project are contained in the README.md and correspond to your chosen preferences.

Creating a visit in our new application

Creating a visit in our new application

Since an application can be created in Bootify with any schema, the code is more generic overall than the original version of PetClinic. Thymeleaf with the layout dialect is also used for the frontend, whereby WebPack, HTMX or Tailwind CSS can be "booked" on top. All features shown so far are fully included in the Free Plan.

The Professional Plan unlocks extended features for the application - including form-based login with Spring Security, creation of a multi-module application, integration tests with Testcontainers and much more.

See Pricing
or read quickstart