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.
- Right click on a project folder and select
Run As
-->Maven build..
. After that a configuration window is opened. - In the window set the value of the Goals field to
spring-boot:run
- You can optionally select
Skip tests
checkbox - All the other settings can be left to default
Once configurations are set clicking Run
will start the application
- On the right side of the window, select Maven --> Plugins-->
spring-boot
-->spring-boot:run
goal - Optionally, you can disable tests by clicking on a
Skip 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 |
---|---|
src/main/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 |
- Read the documentation at vaadin.com/docs.
- Follow the tutorials at vaadin.com/tutorials.
- Watch training videos and get certified at vaadin.com/learn/training.
- Create new projects at start.vaadin.com.
- Search UI components and their usage examples at vaadin.com/components.
- View use case applications that demonstrate Vaadin capabilities at vaadin.com/examples-and-demos.
- Discover Vaadin's set of CSS utility classes that enable building any UI without custom CSS in the docs.
- Find a collection of solutions to common use cases in Vaadin Cookbook.
- Find Add-ons at vaadin.com/directory.
- Ask questions on Stack Overflow or join our Discord channel.
- Report issues, create pull requests in GitHub.
//TODO
The application is packaged as Docker image which can be deployed as Docker compose or as a Kubernetes deployment. Here we will demonstrate deployment using Kubernetes running as a Docker Desktop (just for fun ;-p). These are NOT a recommendation for a production grade environment.
We will be using MySQL as our choice for the RDBMS. We will be using the MySQL Operator for Kubernetes for deploying a simple single node cluster
kubectl create ns vaaladin
helm repo add mysql-operator https://mysql.github.io/mysql-operator/
helm repo update
helm install mysql-operator mysql-operator/mysql-operator --namespace vaaladin
helm upgrade --install vaaladin-mysql-db mysql-operator/mysql-innodbcluster -n vaaladin --values deployment/mysql-values.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
We will be using https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack for monitoring, logging and alerting requirements. This will help to profile a typical Vaadin application resources footprint under load.
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install --values deployment/loki-values.yaml loki --namespace=vaaladin grafana/loki
helm upgrade --install kube-prometheus-stack prometheus-community/kube-prometheus-stack -f deployment/prom-values.yaml -n vaaladin
Import Grafana Dashboard
Install Kafka using Strimzi
kubectl create namespace kafka
kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka
kubectl apply -f deployment\strimzi.yaml -n kafka