This is sample Spring Boot Single Page Application using Angular. The main features of this proect are Asset Pipeline and Client Dependencies Management using Gradle integration.
- Download/clone the project.
- Open command prompt and go to the root location of the downloaded project. Then run following command to install bower dependencies:
gradlew clientInstall
- This will install client dependencies in side src/assets/vendor. Once installed client dependencies, import project in Spring Tool Suite (STS) from File > Import > Gradle (STS) Project. Note that you need to install Gradle plugin in STS first if not installed yet.
- In STS, right click on the project and click on Gradle (STS) > Refresh Dependencies.
- Now open application.properties file and change database related properties as per your MySql database. Change for both spring datasource and flyway datasource. Also create a databse with name you have specified in application.properties. In this demo I have named database as demo.
- Open App.java and Run as Java Application. This will start the application and you can check on http://localhost:8080
- Note that, when you run the app for first time, Flyway will create tables for you by executing V1__create_db.sql placed in resources/db/migration.
- Once application started, you can login with provided credentials on index page.
This Spring boot web project has implementaion of simple CRUD operation of User and Task entities. The implementaion is based on Angular JS. So for User entity, there is a seperate folder called user under src/assets/javascript/bootdemo. This folder has controllers, services, directives and templates related to User module.
Typical structure of Angular JS files for each module/entity will be as follow:
└── src
└── assets
└── javascripts
└── bootdemo
└── user
└── controllers
└── services
└── directives
└── templates //all html template files goes here
└── bootdemo.user.js //main js file of module.
└── routes.js //configuring routes for this module
The project also has Spring Security and Auditor Aware cofigured with it. Authentication in Spring Security is done from database.
Added Spring Security (database authentication) and AuditorAware to track who edited/added entity. Most of the code related to Spring Secuty has been taken from jhipster-sample-app.
MIT