A Spring MVC powered boilerplate project for AngularJS projects.
Install Node.js and then:
> git clone https://github.com/cineris/ngSpringplate.git
> cd ngSpringplate
> sudo npm -g install grunt-cli karma bower
> cd web/src/main/webapp
> npm install
> bower install
> cd ../../../..
> mvn clean installYou now have a .war file that you can deploy to your favorite server!
Happy hacking!
ngSpringplate exists for one reason and one reason only: to make it easier
to spin up a Java-backed, enterprise level application with an AngularJS
front-end. It stubs out most of the wiring required for Spring MVC and Hibernate
on the back end, and contains a very scalable, modularized structure. It also
contains some specific support for development vs. production, particularly in
the .jsp file. This can be easily extended or stripped out.
This project is more focused more on the front end (AngularJS) than on the back end (Java). This is because it is designed with two types of users in mind:
- Java developers that need a solid, scalable front end structure to kickstart their project's development, as well as their knowledge of AngularJS.
- Javascript developers that want to hit the ground running with just enough back end to get their enterprise project working.
Both the Java and Javascript are built to be as scalable and extensible as possible, to allow this to very quickly become whatever you need it to be.
The front end is built out with popular frameworks to ensure extensibility and continued support going forward: AngularJS, Foundation, Angular-Foundation, LESS, and Grunt.
The back end is Spring MVC powered Java that is already wired up from the web controller through the DAO layer.
Grunt has been integrated into the maven build, so you don't have to worry about
drilling into the project and calling grunt build each time you want to build
the project. However, npm and bower are not integrated into the maven process,
since they do not need to run each time the project is built.
Front end unit testing is already stubbed out and running with Karma, and end-to-end testing is implemented through Protractor.
The unit testing runs each time the project is built as part of the standard Grunt build. The e2e tests have to be run manually, and requires the installation of some additional packages.
NOTE: The installation of phantomjs is optional. You can use it in place of a standalone (real) browser for running e2e tests.
Installing necessary packages:
> sudo npm -g install webdriver-manager phantomjs
> sudo webdriver-manager update --standaloneRun Selenium server:
> webdriver-manager startRun Protractor e2e tests:
> cd ngSpringplate/web/src/main/webapp
> grunt protractorHave ideas for improvement? Know of a best practice that is left out, violated, or ignored? Let me know! This is an attempt at improving the quality and efficiency of the code produced by our community, and I welcome any suggestions, tips, criticism, etc. Feel free to contact me directly, or fork this project and improve it yourself. If you have a gem that you would like to share with this project, please submit a pull request!