This project is an application skeleton for a SpringBoot & AngularJS web app. You can use it to quickly bootstrap your web app projects or a java microservice.
spring-boot-starter-webto create a stand-alone Spring applicationsspring-boot-starter-data-jpato access database with JPAh2the Java SQL databasespring-boot-starter-testto create a Spring Unit test
angularjsthe popular JavaScript-based front-end web application frameworkng-tablesimple table with sorting and filtering on AngularJSrestangularAngularJS service that simplifies common GET, POST, DELETE, and UPDATE requestsbootstrapthe popular HTML, CSS, and JS framework for developing responsive, mobile first projects
To get you started you can simply clone this repository and install the dependencies.
- JDK 1.8
- Maven 3.0+
- Eclipse or other IDE
git clone https://github.com/leonllll/webapp-springboot-angularjs-seed.git
mvn clean package
java -jar webapp-springboot-angularjs-seed.jar
then browse to the app at http://localhost:8080/index.html
____pom.xml
|____src
| |____main
| | |____config
| | |____java
| | | |____com
| | | | |____leonlu
| | | | | |____code
| | | | | | |____sample
| | | | | | | |____webapp
| | | | | | | | |____ws
| | | | | | | | | |____App.java --> main class of SpringBoot
| | | | | | | | | |____controller
| | | | | | | | | | |____UserController.java --> RESTful APIs of User Management
| | | | | | | | | |____domain
| | | | | | | | | | |____User.java --> user info
| | | | | | | | | |____exception
| | | | | | | | | | |____GlobalExceptionHandler.java --> self-defined exception handler
| | | | | | | | | | |____UserNotFoundException.java --> self-defined exception
| | | | | | | | | |____repository
| | | | | | | | | | |____UserRepository.java --> Spring JPA repository
| | | | | | | | | |____rest
| | | | | | | | | | |____RestResultResponse.java --> response for status
| | | | | | | | | |____service
| | | | | | | | | | |____UserService.java --> user service
| | |____resources
| | |____webapp
| | | |____css
| | | |____img
| | | |____index.html
| | | |____js
| | | | |____app.js --> the angular application module
| | | |____vendor
| | | | |____angular
| | | | | |____angular.js
| | | | |____bootstrap
| | | | | |____bootstrap.min.css
| | | | |____lodash
| | | | | |____lodash.js
| | | | | |____lodash.min.js
| | | | |____ng-table
| | | | | |____ng-table.js
| | | | | |____ng-table.min.css
| | | | |____restangular
| | | | | |____restangular.js
| | | | | |____restangular.min.js
| |____test
| | |____java
| | | |____com
| | | | |____leonlu
| | | | | |____code
| | | | | | |____sample
| | | | | | | |____webapp
| | | | | | | | |____ws
| | | | | | | | | |____controller
| | | | | | | | | | |____UserControllerTest.java --> SpringBootTest
- get info of all users
GET /users - create a new user
POST /users - get a user
GET /users/{id} - update a user
PUT /users/{id} - delete a user
DELETE /users/{id} - Request Parameters
- JSON format:
{"name":"string","age":int}
- JSON format:
- Response Messages
- Success
- 200 OK
- Failure
- 400 Bad Request
- 404 User Not Found or Not Found
- 500 Internal Server Error
- Success