Skip to content

ministryofjustice/find-moj-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find MoJ data

repo standards badge

Find MoJ data is an internal service for finding and sharing data across the Ministry of Justice. It is powered by Datahub, an open source data catalogue. This repository contains a custom UI that uses the GOV.UK design system, and focuses on data discovery.

Screenshot of the service showing the search page

Prerequisites

Npm

Required for building the front end javascript dependencies

Poetry

Required for managing python package dependencies. Follow installation instructions here https://python-poetry.org/docs/#installation

1Password

Organisational level tool for storing application secrets and passwords securely. There are a number of 1password utilities available to manage credentials from cli and desktop environments.

  1. Install the 1Password desktop app - https://support.1password.com/get-the-apps/
  2. Install the 1Password CLI app - https://developer.1password.com/docs/cli/get-started/
  3. Follow the steps to turn on and test the 1password desktop app integration

Chromedriver

Tests will require chromedriver at a version compatible with your chrome browser (https://googlechromelabs.github.io/chrome-for-testing/)

Datahub

Datahub is the backend for Find MoJ data. These instructions assume you will use the existing development environment hosted in cloud platform.

Quick start

Please refer to Prerequisites for dependencies and installation instructions

  1. Export a local var with the environment name export ENV=local
  2. Run make build to install dependencies and build the app
    1. Make any needed customizations required to .env file
  3. Run make test to run unit tests for the app. This step requires chromedriver up-to-date with your google chrome version: https://googlechromelabs.github.io/chrome-for-testing/
  4. Run make run to run the app locally on http://localhost:8000
export ENV=local
make build
make test
make run

Note: in local development we are using SQLite. Another option is running the app against RDS.

Reusing this frontend outside the MoJ

If you are considering reusing this frontend, please get in touch with us first.

We recommend you follow these steps:

  1. start with the latest release of Find MoJ data
  2. replace all references to Find MoJ data in locale/en/LC_MESSAGES/django.po
  3. generate an access token in Datahub
  4. review core/settings.py. Your deployment must set various environment variables for this to work, e.g CATALOGUE_URL, the URL to your Datahub instance, and CATALOGUE_TOKEN, the access token.
  5. alternatively, you can create your own settings.py and set the DJANGO_SETTINGS_MODULE environment variable.

Feature Switches

We have enabled feature switches in find-moj-data. These have been enabled using a package called django-waffle.

Switches can be managed via the cli or via the django admin page.

Our switches are created via the cli; the commands can be seen in the Dockerfile.

Current swicthes and default settings:

  • search-sort-radio-buttons off - switches on/off radio selection buttons for sort order of search results.
  • display-result-tags off - switches on/off the display of tags in search and results pages
  • show_is_nullable_in_table_details_column off - switches on/off the Is Nullable column in the table details page