/hr-monitor

Vaadin WebBluetooth example analysing heart rate using Suunto/Polar bluetooth HR belts

Primary LanguageJavaThe UnlicenseUnlicense

The first ever Vaadin based heart rate monitor application

This is a trivial WebBluetooth integration example for Vaadin. It can connect to heart rate belts that advertise themselves in a specific manner. Requires a compatible browser (Chrome on a non-iOS device will do fine).

TIP: Best experience with Polar H10, that provides also raw ECG data.

Check the code for the details, that is the documentation :-)

Running the application

The project is a standard Maven project. To run it from the command line, type mvn, then open http://localhost:8080 in your browser.

You can also import the project to your IDE of choice as you would with any Maven project. Read more on how to set up a development environment for Vaadin projects (Windows, Linux, macOS).

Deploying to Production

To create a production build, call mvn clean package -Pproduction. This will build a JAR file with all the dependencies and front-end resources, ready to be deployed. The file can be found in the target folder after the build completes.

Once the JAR file is built, you can run it using java -jar target/myapp-1.0-SNAPSHOT.jar (NOTE, replace myapp-1.0-SNAPSHOT.jar with the name of your jar).

Project structure

  • MainView.java in src/main/java is an example Vaadin view.
  • src/main/resources contains configuration files and static resources
  • The frontend directory in the root folder is where client-side dependencies and resource files should be placed.