Jezorko / vertx-vue-example

A minimal example application that uses VueJS on the front-end and Vert.x on the back-end.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vertx-vue-example

License: WTFPL Build Status

This is a minimal example application that uses VueJS on the front-end and Vert.x on the back-end.

API is exposed on paths starting with /api and contains only a single method, /api/health. The back-end serves the front-end on all other paths.

The front-end consists of a single component that displays the health status of the back-end.

Compilation and packaging

Single JAR file

To compile both FE and BE to a single JAR file, execute:

mvn clean && \
npm run build && \
mvn compile assembly:single

or as an npm script:

npm run package:jar

This will:

  • remove all files from the target directory
  • build the front-end with npm run build
    • install the dependencies
    • build app with vue-cli-service
    • write result to target directory
  • compile back-end sources and package them together with front-end to a single JAR

Local development

Repackaging the JAR file on every change would slow down the local development. Both applications may be run separately to avoid this issue.

Back-End

The back-end application may be run with the following command:

mvn exec:java \
    -Dexec.mainClass="jezorko.com.github.example.VertxVueApplicationKt"

By default, it will run on port 3000. Bear in mind the front-end will no be accessible through back-end if running this way.

Front-End

To only compile frond-end sources and run them in a development server, execute:

npm start

This will talk with the back-end running on localhost on port 3000 (default).

About

A minimal example application that uses VueJS on the front-end and Vert.x on the back-end.


Languages

Language:Kotlin 51.1%Language:Vue 24.2%Language:HTML 14.1%Language:JavaScript 10.6%