This repository currently requires the Virtual Machine specified by https://github.com/datagovuk/dgu_deploy so you should use that repository to generate your working environment.
To build the development environment, you will need to have the following software installed:
Follow the instructions at https://github.com/datagovuk/dgu_deploy
On your local machine you need to have the following installed:
If you are using homebrew you should get all the deps that you need with the following:
brew update
brew install elixir # Want v1.3.x
brew install nodejs
brew install npm
brew install elm
npm install -g npm
Once you have all of the dependencies installed you should be able to do the following (assuming the VM is running):
cd src/dguweb/
mix local.hex # If this is your first elixir app
mix local.rebar # If this is your first elixir app
mix deps.get
mix deps.compile
mix ecto.create
mix ecto.migrate
npm install
elm-package install
mix run priv/repo/seeds.exs # Load seed data
For development, you can run the backend server with the following command:
mix phoenix.server
As live-reloading is enabled, any changes you make to src/dguweb/web/static/{css,js}
or src/dguweb/web/elm/*.elm
or src/dguweb/web/templates/*.eex
should be reflected in the browser without reloading or restarting anything.
Until authentication is addressed you must perform a manual step to set up your users in the prototype.
Connect to your new CKAN from the dgu_deploy repository, and register some users and assign to the appropriate organisations.
For each user, visit their user profile and obtain their API keys. You may use the UI, or access the public."user" table in the ckan database.
In the dguweb_dev database you need to assign these API keys to users who have registered in the prototype front-end. You can do this in the public.users table in the dguweb_dev database.
Once this is complete, when users log in to the prototype the list of organisations they can manage is retrieved and stored against their connection so that user and permitted organisations are available to the prototype.
It's kind of nice to be able to provide translations into languages used in the UK - such as Welsh.
To re-generate the PO files use
mix gettext.extract --merge
To make something translatable, use <%= gettext "My text string" %>
You can test for now by passing ?locale=en
as a querystring until we provide a proper route.