Git Product home page Git Product logo

openregister.show-the-mess's Introduction

OpenRegister Show The Mess

Data repository configuration

To add a data comparison page for lists in a data repository, there are two steps.

Add maps/index.yml

Add a maps/index.yml file to the data repository to configure which lists to include in the data comparison page. You define labels and primary key fields here as well.

For example if you have a prison-data repository with the following maps files:

maps/contracted-out.tsv
maps/nomis-code.tsv

Create a maps/index.yml file with an entry for each map file. Add a first entry for the register data. For example:

---
prison:
  description: Prison in prison register
  key: prison
nomis-code:
  description: NOMIS code and name (includes former prisons)
  key: nomis
contracted-out:
  description: Prison name in NOMS spend data over £25,000 files
  key: contracted-out

You use the name of register or TSV file as the root level key in the maps/index.yml, e.g. prison, nomis-code, contracted-out.

Set description with the label to show for the data on the data comparison page.

Set key as the field name from the TSV file that is the primary key for that register or data list, e.g. prison, nomis, contracted-out.

Add link from application homepage:

Open the ./web/templates/page/contents_list.html.eex template and add a link for the new data repository.

You'll need to define the following parameters in the link href:

register=[name of register]
data=[path to register data file]
maps=[path to maps directory]

For example:

register=prison
data=prison-data/master/data/discovery/prison/prisons.tsv
maps=prison-data/master/maps

So, in the ./web/templates/page/contents_list.html.eex template the link markup is:

<li><a href="/?register=prison&data=prison-data/master/data/discovery/prison/prisons.tsv&maps=prison-data/master/maps">Prison</a></li>

Clearing the cache

The application caches data retrieved from data repositories.

To clear the cache, visit the following link /clear:

https://[host]/clear

Deployment

To setup a fresh heroku deployment:

heroku create --region eu \
       --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir.git" \
       --org <org>

heroku buildpacks:add https://github.com/gjaldon/heroku-buildpack-phoenix-static

heroku apps:rename <your-app-name>

heroku config:set HOST=<host domain e.g. example.herokuapp.com> \
                  POOL_SIZE=18 \
                  SECRET_KEY_BASE="`mix phoenix.gen.secret`"

git push heroku master
# or
git push heroku yourbranch:master

heroku open

Local development

Install Elixir, if not already installed:

brew update
brew install elixir

To start the Phoenix app locally:

# Install dependencies with:
mix deps.get

# Install Node.js dependencies with:
npm install

# Start Phoenix endpoint with:
mix phoenix.server

Now you can visit localhost:4000 from your browser.

openregister.show-the-mess's People

Contributors

robmckinnon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.