Simplify Getting Started with Vaadin Flow

I am currently writing a small series of articles for the (German-language) Java Magazin.
Part 1 is about Vaadin :grinning:.
During the preparation to this, I once again created a new Flow project with the Vaadin Starter start.vaadin.com. I realised that there is no way to start WITHOUT a database. (Ok, who wants that in real life? :wink:) Even for a small Hello World example, a database has to be selected and in the resulting pom.xml there are dependencies up to spring-data-jpa… which is huge.
For some time now, the Java community has been endeavouring to simplify the introduction to programming with Java as much as possible. The results here are, for example

JEP 330: Launch Single-File Source-Code Programmes
JEP 445: Unnamed Classes and Instance Main Methods (Preview)

With this in mind, I would suggest that the Vaadin Starter also offers a way to generate a super simple and lean app variant without persistence.

And the jbang integration that @Matti pointed out in his blog post in January makes it even easier to make Vaadin attractive for junior developers.

Kind regards
Dominik

1 Like

The example here GitHub - vaadin/skeleton-starter-flow-spring: Default project template for Vaadin using Spring Boot might be the ā€œsmallestā€

I share your pain here @todo42. The ā€œhello world startersā€, which I find most relevant in the evaluation phase, even if finally building a RDBMS + JPA app, were quite recently removed from the start.vaadin.com. I tried asking that already internally, but could maybe pose the question again.

They are not completely removed, but very well hidden into our docs (I just again needed to spend a minute to dig this link):

Other alternatives:

  • Maven archetypes (also listed in the above link)
  • Spring Initializr (also listed in the above link, best in a sense that evaluator can pick something familiar for him to play with the Vaadin UI, best used directly via IDE)
  • Viritin SB (project examples & archetype). These are at this point Flow only, but does the ā€œproduction buildā€ in a way I have been trying to advocate our official solution to go as well. People probably get better experience with these (faster and deploys with e.g. varios PaaS services out of the box), but as it is not an official solution, maybe better only use/try these with active community only.

I no longer use start.vaadin.com. I always use start.spring.io
Because I always use Testcontainers and other Spring dependencies this is the way better start

start.vaadin.com also contains Testcontainers nowadays. Are there any changes we could make to start.vaadin.com that would make it better than start.spring.io?

-Petter-

It’s fine for new developers. I used it a lot when starting with Vaadin.
But now as I know Vaadin well it’s too opinionated and then I have to refactor most of the generated code.
Plus AI is pretty good at creating Vaadin views

1 Like

worth mentioning is the Vaadin CLI via npm … generally I would prefer a CLI but nowadays, as Simon mentioned, the AI can do a lot in this area …

As somebody who has almost 2 decades worked in a UI component, it hurts me everytime somebody says the prefer CLI :rofl: But, installing Vaadin IDE integration, and using its UI is a nice approach (and supports non-spring-boot stubs, but not other deps like Sprin gInitializr).

There is an extra step to install a plugin before development, but that on the otherhand enhances the experience later if one starts to utilize live-reload/copilot.

Even smaller project would be GitHub - mvysny/vaadin-boot-example-maven: Vaadin example app running in Embedded Jetty - no Spring at all.

Well, here’s a fan of start.vaadin.com.

How do you mean ā€œcontains Testcontainersā€? I cannot see testcontainers in the pom.xml when i create a project.

I mean the Starter Project (Walking Skeleton). Go to start.vaadin.com, click Download.

Ah, I see. The problem is that it uses H2, and now, when I want to use a real database, I have to find out which dependencies to add or what the ServiceConnection must look like.
That’s why I use start.spring.io

I understand. We have to figure out a way of solving that, then! :slight_smile: