winweb / spring-boot-vue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple CRUD with Vue.js and Spring Boot

This example app shows how to build a basic CRUD app with Spring Boot 2.5.x, Spring Data, and Vue.js 3.x.

Please read Build a Simple CRUD App with Spring Boot and Vue.js to see how this app was created.

Prerequisites: Java 8, Node.js, and Yarn.

Getting Started

To run the server, run:

./gradlew bootRun

Install yarn

npm install --global yarn

To run the client, cd into the client folder and run:

yarn install && yarn run serve

Deployment

To build client and server package for prepare deployment

Build Client

To build client, cd into the client folder and run:

yarn build

Will generate output at folder client/dist

Build Jar

To build an execute jar run:

gradlew build

Will create jar file at build/libs/todo-app.jar

Try

java -jar build/libs/todo-app.jar

Try for Stress Test

java -jar build/libs/todo-app.jar -server -Xms2G -Xmx2G -Xshareclasses -XX:+UseParNewGC -XX:CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly -XX:TieredStopAtLevel=1 -noverify

=======

Docker

Build

docker build -f Dockerfile -t spring-boot-vue:latest .

Run

docker run --rm -p 9000:9000 spring-boot-vue:latest

Open

http://localhost:9000

Run Stress test on Windows 10

$  C:\xampp\apache\bin\ab.exe -k -p test.json -T application/json -n 1000000 http://localhost:9000/todos

References:

About


Languages

Language:Vue 30.6%Language:CSS 29.1%Language:Java 28.1%Language:JavaScript 6.6%Language:Dockerfile 2.4%Language:HTML 2.2%Language:Makefile 0.9%