This is the frontend application for viewing Service Performance data. It communicates with the gsd-api application to retrieve the data.
First you need the Ruby version defined in .ruby-version installed, which is currently 2.4.1. It's easy to switch Ruby versions on demand with rbenv, which you can do using Homebrew.
brew install rbenv
If you have rbenv installed, you can run
rbenv install 2.4.1
Next, you'll need Bundler in order to install all the dependencies you'll need to run the app.
gem install bundler
Installing Bundler means that you have it for the current version of Ruby. If you ever switch Ruby versions, you'll need to re-install Bundler. After bundle has been installed, install the dependencies for this application with
bundle
Once you have all the dependencies, you need to start the server.
- You can check out
Powfor a really easy no-config server solution. - You can do the more conventional
rails -scommand. If you're already running another app on port 3000 (the API, for example), then pass in a new port number withrails -s --port 3000
Create a .env file by copying .env.example and then make sure API_URL is pointing at the same place where the API is running and you should be good to go. 😎👍
Make sure you have npm installed, as well as a relatively recent version of node.
nvm is a pretty good way of installing different node versions. Follow the installation instructions from the nvm repository and afterwards install all the node versions you could ever want. Installing a node version is as easy as
nvm install 6.11.0
There's an .nvmrc file in the root directory of this repository that nvm will recognise when you call certain commands (like nvm use) without arguments.
To install the frontend dependencies, run
npm install
At GDS, we use standardjs.
npm run lint
Running npm run lint will lint the javascript files it finds in the app/assets/javascripts/* directory. It gives you some scary-looking npm error trace, but also plain-english messages about what's gone wrong.
We're using Jest for JavaScript unit tests.
./script/run-npm-test
Running ./script/run-npm-test will run any javascript test files it finds across the whole codebase.
The capybara-webkit gem relies on qt v5.5. To install the gem:
brew install qt@5.5
export PATH="/usr/local/opt/qt@5.5/bin:$PATH"
bundle install