The project uses Gradle, Node.js, npm, Bower and gulp, but if you use the bundled Gradle wrapper, the only thing you need to have installed is Java 8.
If you wish to optimize your workflow a bit, you probably want to install the other tools as well.
To get started, start a standalone version of the project:
./gradlew runStandalone
When everything as been compiled and server has started, open your browser: http://localhost:8080/
The project includes project files for IntelliJ IDEA. There are some shared run configurations you probably want to use:
- web-api - Starts the backend in a Tomcat running inside IDEA.
- web-api lag - Same as web-api but adds a simulated lag of 1 second to every request.
- JS Debug - Connects JavaScript debugger to running frontend-module.
- gulp watch - Starts process for compiling client code.
The project is configured to use LiveReload to refresh changes automatically to browser without having to manually reload. Install extension for your browser.
You don't need to install Node.js or gulp manually to get the build working since Gradle can execute them with its own node-plugin. However, if running inside Gradle, you'll lose the colorization in console and gulp takes a little longer to start. So if you have a working Node.js environment, install gulp by saying:
npm install -g gulp
After this you can just execute gulp
in the frontend
directory to run the frontend server.
(If you haven't followed the steps of Quick-start above, you'll also need to run npm install
manually
in the frontend
-directory before running gulp.)
Unit-tests are using Karma. Run them by executing the following command
in frontend
-directory:
gulp test:unit
End-to-end tests are implemented using Protractor. First we need
install the driver for Chrome, by issuing the following in frontend
-directory:
node_modules/.bin/webdriver-manager update
After this we can start Selenium server:
node_modules/.bin/webdriver-manager start
When the server is running, we should start our application (e.g. using the method described in Quick-start) and then we can execute the tests against our application:
gulp test:e2e