Skip to content

ministryofjustice/correspondence_tool_public

Repository files navigation


MoJ logo

Correspondence Tools - Public

repo standards badge

A simple application to allow public users to submit correspondence. A present this only forwards the request to a set email address.

Development

Working on the Code

Work should be based off of, and PRed to, the main branch. We use the GitHub PR approval process so once your PR is ready you'll need to have one person approve it, and the CI tests passing, before it can be merged.

Basic Setup

Cloning This Repository

Clone this repository then cd into the new directory

$ git clone [email protected]:ministryofjustice/correspondence_tool_public.git
$ cd correspondence_tool_public

Installing the app for development

Latest Version of Ruby

If you don't have rbenv already installed, install it as follows:

$ brew install rbenv ruby-build
$ rbenv init

Follow the instructions printed out from the rbenv init command and update your ~/.bash_profile or equivalent file accordingly, then start a new terminal and navigate to the repo directory.

Use rbenv to install the latest version of ruby as defined in .ruby-version (make sure you are in the repo path):

$ rbenv install

Dependencies

Node.js:

$ brew install node

Yarn

$ brew install yarn

Postgresql

$ brew install postgresql

Setup

Use the following commands to install gems and javascript packages then create the database

$ bin/setup
$ yarn install

Running locally:

Use the dev command to run the application. This will use Foreman to start the rails server as well as compiling the css and js. Any changes to the css and js will be live updated.

$ bin/dev

The site will be accessible at http://localhost:3000.

Running tests

$ bundle exec rspec

Emails

Emails are sent using the GOVUK Notify service. To configure this in the production environment ensure that the SETTINGS__GOVUK_NOTIFY_API_KEY environment variable is set with a production API key.

Sidekiq

Email requests are put in a queue and then processed by Sidekiq in turn and sent to GOV.UK Notify.

Exceptions

Any exceptions raised in any deployed environment will be sent to Sentry.