This is a proof-of-concept for a Vue.js webapp with a springboot-backend. Frontend and backend are bundled into the same .war for production to be deployed on a Tomcat or similar.
cd Frontend
npm install
cd Frontend
npm run serve
(Only required for deployment)
cd Frontend
npm run build
The backend can be used like any normal Maven-App. Simply load it into Netbeans (or similar IDE) and run it from there.
API-Requests (requests from the frontend to the backend) can be performed as usual. The proxy built into the Dev-Server handles the connection.
Sample GET-Request to fetch all greeting-entities:
fetch("greetings");
See the following resources for further reading:
-
Official Vue.js documentation: https://vuejs.org/v2/guide/
-
Structuring Vue.js applications: https://vueschool.io/articles/vuejs-tutorials/structuring-vue-components/
-
Spring Boot documentation: https://docs.spring.io/spring-boot/docs/2.2.6.RELEASE/reference/html/documentation-overview.html