Default project template for Vaadin using Spring Boot
This project can be used as a starting point to create your own Vaadin application with Spring Boot. It contains all the necessary configuration and some placeholder files to get you started.
The best way to create your own project based on this starter is start.vaadin.com - you can get only the necessary parts and choose the package naming you want to use.
There are two ways to run the application : using mvn spring-boot:run
or by running the Application
class directly from your IDE.
You can use any IDE of your preference,but we suggest Eclipse or Intellij IDEA.
Below are the configuration details to start the project using a spring-boot:run
command. Both Eclipse and Intellij IDEA are covered.
Run As
--> Maven build..
. After that a configuration window is opened.spring-boot:run
Skip tests
checkboxOnce configurations are set clicking Run
will start the application
spring-boot
--> spring-boot:run
goalSkip Tests mode
blue button.Clicking on the green run button will start the application.
After the application has started, you can view your it at http://localhost:8080/ in your browser.
If you want to run the application locally in the production mode, use spring-boot:run -Pproduction
command instead.
Integration tests are implemented using Vaadin TestBench. The tests take a few minutes to run and are therefore included in a separate Maven profile. We recommend running tests with a production build to minimize the chance of development time toolchains affecting test stability. To run the tests using Google Chrome, execute
mvn verify -Pit,production
and make sure you have a valid TestBench license installed.
Vaadin web applications are full-stack and include both client-side and server-side code in the same project.
Directory | Description |
---|---|
frontend/ |
Client-side source directory |
index.html |
HTML template |
index.ts |
Frontend entrypoint |
main-layout.ts |
Main layout Web Component (optional) |
views/ |
UI views Web Components (TypeScript / HTML) |
styles/ |
Styles directory (CSS) |
src/main/java/<groupId>/ |
Server-side source directory |
Application.java |
Server entrypoint |
AppShell.java |
application-shell configuration |