☕🍵🍶🍼🍺🍸🍹🍷
This is a Vaadin-on-Kotlin example application, used to demonstrate features of the Vaadin Flow Java framework. A full-stack app: uses the H2 database instead of a dummy service. Requires Java 17+.
The Starter demonstrates the core Vaadin Flow concepts:
- Building UIs in Kotlin with components
such as
TextField
,Button
,ComboBox
,DatePicker
,VerticalLayout
andGrid
(seeCategoriesList
) - Creating forms with
Binder
(ReviewEditorDialog
) - Making reusable Components on server side with
KComposite
(AbstractEditorDialog
) - Creating Navigation with the Router API (
MainLayout
,ReviewsList
,CategoriesList
) - Browserless testing: see the test suite package for the complete test implementation.
This version of Beverage Buddy demoes the possibility of developing a Vaadin web application purely server-side in the Kotlin language. There is no JavaScript code in this project. We use Vaadin to avoid touching JavaScript after all.
See the online demo.
Please see the Vaadin Boot documentation on how you run, develop and package this Vaadin-Boot-based app.
Without the database, we could store the categories and reviews into session only, which would then be gone when the server rebooted. We will use the Vaadin-on-Kotlin's SQL database support. To make things easy we'll use in-memory H2 database which will be gone when the server is rebooted - touche :-D
We will use Flyway for database migration. Check out Bootstrap.kt on how the migration scripts are ran when the app is initialized.
The Category
and Review
entities are mapped to the database tables; inheriting from Entity and Dao
will make it inherit bunch of useful methods such as findAll()
and save()
. It will also gain means of
providing all of its instances via a DataProvider
. See the CategoriesList.kt
Grid configuration for details.
For a JOOQ version of this app, please see beverage-buddy-jooq.