DfE Service manual
Before you start
You will need to create a .env.development.local file in your root directory which contains actual values for the following
CONTENTFUL_API_KEY=xxxxxx
CONTENTFUL_SPACE=xxxxxx
Prerequisites
- Ruby 2.6.5
- NodeJS 10.x.x
- Yarn 1.16.x
Setting up the app in development
- Run
bundle install
to install the gem dependencies - Run
yarn
to install node dependencies - Run
bundle exec rails server
to launch the app on http://localhost:3000 - Run
./bin/webpack-dev-server
in a separate shell for faster compilation of assets
Running specs, linter(without auto correct) and annotate models and serializers
bundle exec rake
Running specs
bundle exec rspec
Linting
It's best to lint just your app directories and not those belonging to the framework, e.g.
bundle exec govuk-lint-ruby app config db lib spec Gemfile --format clang -a
or
bundle exec govuk-lint-sass app/webpacker/styles
Security vulnerabilites scanner
Brakeman is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities.
To get the report simply run:
brakeman
or
brakeman -o report.html
(if you want a report in a nicer format).
Please check https://brakemanscanner.org/docs/ for more details.