An example of Spring Boot 2 and Angular 6 integration with the help of Maven, Yarn, Kotlin.
Also includes Spring Security Authentication
configured for a single page application client. The backend has no control over the frontend and only responds with 200/40x HTTP statuses. All login/logout redirects are performed on the client's side. Username and password are any Latin strings.
Consists of server and client modules.
In production mode, they both are compiled and built into a single WAR archive which can be deployed to a web application server or run directly as a standalone Java application.
In development mode, you work with both modules separately. The server is built and run with the help of Maven from the 'server' directory. The client is operated via Yarn from the 'client/src/main/ng' directory.
# build both server and client
mvn clean install -Pprod
# build the server module without the client jar dependency
# (can be run from the root or from the 'server' directories)
mvn clean install
# install client's npm dependencies (it's necessary for the first build only)
# navigate to the 'client/src/main/ng' directory and run the following command
yarn install
# navigate to the 'server' directory and run the following command
mvn spring-boot:run
Access UI App at http://localhost:9001
# navigate to the 'server' directory and run the following command
mvn spring-boot:run
# navigate to the 'client/src/main/ng' directory and run the following command
yarn start
Access UI App at http://localhost:9002