Skip to content

simasch/vaadin-jooq-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Vaadin/jOOQ Template

Introduction

This is a template project that shows how to integrate Vaadin and jOOQ and how to test it with Karibu Testing and Playwright.

It uses Testcontainers, for generating the jOOQ classes and integration testing and Flyway for the database migrations.

This project can be used as a starting point to create your own Vaadin application with jOOQ. It contains all the necessary configuration and some examples to get you started.

Running the Application

Before running the application the jOOQ metamodel has to be generated using the Maven plung:

./mvnw compile

Then you can simply run the application with a database started by Testcontainers from your IDE TestVjApplication.

Important: This class uses the Spring Boot Testcontainers support introduced with Spring Boot 3.1. Thus, Docker or Testcontainers Cloud must run on your local computer

Testing the Application

There are two base classes:

  • KaribuTest can be used for fast browser-less testing aka UI unit test. Karibu setups a Vaadin mock environment.
  • PlaywrightIT configures Playwright for E2E tests. This class uses SpringBootTest at a random port.

The Playwright test uses Mopo. Mopo simplifies the testing of Vaadin applications with Playwright

Deploying to Production

To create a production build, call mvnw clean package -Pproduction (Windows), or ./mvnw clean package -Pproduction (Mac & Linux).

This will build a JAR file with all the dependencies and front-end resources, ready to be deployed. The file can be found in the target folder after the build completes.

Once the JAR file is built, you can run it using java -jar target/vaadin-jooq-template-<version>.jar

Project structure

  • layout/MainLayout.java in src/main/java contains the navigation setup using App Layout.
  • views package in src/main/java contains the server-side Java views of your application.
  • themes folder in frontend/ contains the custom CSS styles.

Security Configuration

The example uses JWT authentication for better developer experience for example you don't have to re-login during development. Read more in the blog of Matti Tahvonen

Useful links

Vaadin

jOOQ

Spring Boot

Testcontainers

Karibu Testing

Playwright

About

Template Project that integrates Vaadin and jOOQ

Resources

License

Apache-2.0, Unlicense licenses found

Licenses found

Apache-2.0
LICENSE
Unlicense
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages