spring-boot-maven-angular-starter

Spring Boot Angular 5 Multi-module Maven Starter Project

Github星跟蹤圖

spring-boot-maven-angular-starter Build Status

This is a multi-module Spring Boot Angular Maven starter app with good defaults.
The frontend Angular app is built using angular-cli. The project packages Angular application code as a WebJar. This project is geared towards building monolithic applications. I have also written a blog that explains step by step how to create this starter project.

This project provides productive setup for building Spring Boot Angular applications. The application is divided into two Maven modules:

  1. backend: This contains Java code of the application.
  2. frontend: This contains source code for the Angular based frontend.

This project uses following versions:

  1. Spring Boot v1.5.9
  2. Angular v5.0.4
  3. Node v8.9.0
  4. Yarn v1.3.2

Running the full application

You can build the package as a single artifact by running the ./mvnw clean install.
Next, you can run the application by executing:

$ java -jar backend/target/ngboot-app.jar

The application will be accessible at http://localhost:8080.

Features

This starter comes bundled with the following features:

  1. Multi module Maven project: A multi module project to modularize backend and frontend code separately.
  2. Maven wrapper: So, you don't need to install Maven on your machine.
  3. Checkstyle: Enforce sane coding standard guidelines.
  4. ErrorProne: Find errors in your code.
  5. Frontend packaged as a WebJar.
  6. CORS enabled: A global configuration is added to enable CORS so that frontend can work seamlessly with backend during development.
  7. REST API base path: Sets the base REST API path to /api. You can configure it by changing rest.api.base.path property.
  8. Maven release plugin
  9. CI: The project is preconfigured to use TravisCI as continuous integration server.

Running the backend for development mode

There are multiple ways to run the backend. For development, you can use your favorite IDE and run the
com.example.app.Application. As soon as your code compiles, Spring Boot DevTools will reload the code.

You can also run the application using Maven.

$ cd backend
$  ../mvnw spring-boot:run

Running the frontend for development mode

Make sure to install yarn on your development machine.

To install all the required binaries for your project, you can run following command.

$ cd frontend
$ ../mvnw frontend:install-node-and-yarn frontend:yarn

Once the above command finishes, you can start the frontend using the yarn start command.

Hot reloading

Both the front-end and back-end modules support hot reloading.

主要指標

概覽
名稱與所有者shekhargulati/spring-boot-maven-angular-starter
主編程語言HTML
編程語言Java (語言數: 5)
平台
許可證Apache License 2.0
所有者活动
創建於2017-11-06 02:27:13
推送於2023-03-07 00:50:46
最后一次提交2020-04-29 23:22:45
發布數1
最新版本名稱0.1.0 (發布於 2017-11-06 03:04:27)
第一版名稱0.1.0 (發布於 2017-11-06 03:04:27)
用户参与
星數147
關注者數17
派生數102
提交數23
已啟用問題?
問題數6
打開的問題數0
拉請求數2
打開的拉請求數14
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?