adding vaadin to an existing spring boot project

I have an existing Spring Boot => Angular project. I am trying to add Vaadin to it to replace the Angular but without success so far.

  1. Is there a tutorial for doing this? I’m trying to move various pieces from the tutorial to the new project, I can build but it has various issues.

  2. How are Vaadin views found by vaadin? How are they constructed? Does the BeanFactory get involved? Are constructed via the "new” keyword? If so how are they found? Does the routing make use of the Spring MVC foundation? Is the router a Spring Bean that I can access?

  3. The tutorial uses JPA, does vaadin require that? Or can it utilize any Spring Data Repository?

  4. How does the Vaadin UI communicate with the backend? Do I have any control over this? I already have a working REST backend for Angular, ideally I could just use it or the existing Repositories.

  5. What resources does vaadin need at runtime? How can I verify those are correct?

Notice I believe I can use the vaadin-core (free) libraries for now, so if that is easier to integrate let me know.

A few of the specific problems I’m facing:

  • No views found. It appears that Vaadin is being detected at partially started but not finding my views. Presumably this is due to the classpath? I have the vaadin views outside of the main package but have added them to the Spring classpath scanning. Spring is clearly scanning that path, Vaadin is not finding them. Or perhaps finds them but something is wrong? Notice these views work fine in the tutorial app with a dummy backend.
  • Thinking I was missing something I tried adding the @Theme(value = “flowcrmtutorial”) annotation from the Tutorial. This caused errors and the application did not start. Probably there is some resource I needed here as well?

Hi, I would suggest you to take a look and follow this tutorial : https://vaadin.com/docs/latest/guide . Just follow all of them step by step. It will give you an overview how to create an web apps using vaadin then you can refactor your angular + spring → vaading web apps…

What tutorial did you follow? Did you look at the spring integration documentation?

The tutorial uses JPA, does vaadin require that? Or can it utilize any Spring Data Repository?
Vaadin is backend agnostic, so there is no specific requirements for this. For Spring Data Paged queries there is support in data provider, but use of Spring Data is not a requirement per ce.

How does the Vaadin UI communicate with the backend? Do I have any control over this?
It is automatic, you do not need to anything, that is one of the major benefits of Vaadin.

I already have a working REST backend for Angular, ideally I could just use it or the existing Repositories.
As stated earlier, Vaadin is backend agnostic, you can consume REST backend as well as JPA, SpringData, jOOQ what ever you want.

What resources does vaadin need at runtime?
At minimum Vaadin just requires Java runtime and Servlet, anything else on top of that is dependent on your application. For example Spring is not requirement for Vaadin, but it is a known fact that big portion of Vaadin apps use it, as it is one of the best complementing frameworks with Vaadin.

Thinking I was missing something I tried adding the @Theme(value = “flowcrmtutorial”) annotation from the Tutorial. This caused errors and the application did not start.
This will require you to have corresponding theme folder under “frontend/themes”