This is the Individual Electoral Registration (aka ERTP) Frontend app. The point of it is to provide a simple Register to Vote form to the public.
To run this app you will need;
- Java 7 (we use openJDK 7)
- Ruby 1.9.3
- Sass.
- Bundler.
All other dependencies (Play framework, Scala, sbt, etc) will be installed as part of the sbt start script.
-
git clone git@github.gds:gds/ier-frontend.git -
In a terminal execute
./sbtto open the Play console -
Wait (Downloading the entire internet)
-
In the SBT console execute
compileto compile the app
If you encounter SSL handshake errors this will probably be caused by the 'Lets Encrypt' certs used on the build server. Add the Lets Encrypt certs into your local JAVA Keystore, usually located here:
/Library/Java/JavaVirtualMachines/jdk<version>.jdk/Contents/Home/jre/lib/security/
You can grab the root and intermediate certs from https://letsencrypt.org/certificates/
And install each like so (remember to use a different alias each time)
sudo keytool -importcert -alias letsencryptroot -file /Users/<username>/Downloads/isrgrootx1.der -keystore cacerts
-
Create directory
/var/log/ierwith write access rights for the current user, e.g:_sudo mkdir /var/log/ier_ _sudo chown root:users /var/log/ier_ _sudo chmod 770 /var/log/ier_ -
In the SBT console execute
runto start the app -
Go to http://localhost:9000/
[Note: I got an internal error had to re-
gem install sassto fix it ]
-
In a terminal execute
./sbtto open the SBT console -
In the SBT console execute
runto start the app -
Or just
./sbt run -
Go to
http://localhost:9000/
The CSS and JS files Play serves are compiled versions of those in the ./assets folder.
There are Gulp tasks to build the compiled CSS and JS in the ./scripts/gulp folder.
The ./scripts/gulp folder has a guide to setting up Gulp and to the tasks in its README.
Testing for the ier-frontend project is via the sbt command line as follows...
-
In the terminal execute
./sbtto open the SBT console -
In the SBT console execute
testto begin ALL the tests -
Or just
./sbt test
NB : Make sure you follow the Bootstrap Step 5 above to make the /var/log/ier/ folder locally writable.
NB : To run a specific test rather than all of them "test-only FULL_PATH_OF_TEST_CLASS"
eg. ./sbt "test-only uk.gov.gds.ier.transaction.overseas.passport.PassportFormTests"