EHRI / ehri-frontend

The EHRI project's portal interface.
https://portal.ehri-project.eu
European Union Public License 1.2
14 stars 9 forks source link
ehri playframework scala

Build Status

Front-end for the EHRI REST web service.

This app has a few dependencies, with the main ones being:

These services can be instantiated using the docker-compose-dev.yml and docker-compose-minio.yml files:

sudo docker-compose -f docker-compose-dev.yml -f docker-compose-minio.yml up

(NB: during development it is convenient to use MinIO for file storage, but it's default port clashes with that of the Play Framework, so the docker config remaps its ports to 9100 and 9101.)

If this all works you should be able to visit the following URLs in your browser and see something:

If you have the PostgreSQL client libraries installed you should also be able to connect to the docview database like so:

psql -Udocview -hlocalhost docview

(Default password for development is 'changeme'.)

MinIO setup for development

EHRI Backend setup

curl  --header content-type:application/json \
      --header X-User:admin \
      --data-binary '{
           "id":"portal", 
           "type":"Group",
           "data":{"identifier": "portal", "name":"Portal"}
      }' \
      http://localhost:7474/ehri/classes/Group

Additional dev environment dependencies

Running the app:

At this point you should be able to access the admin pages and create data, e.g:

NOTE: certain functionality also depends on a valid AWS S3 configuration set in the conf/aws.conf file. Use the conf/aws.conf.example as a template.

Note on JS/CSS library assets

These assets live in the source tree in the modules/{module}/app/assets/{js,css}/lib directories but the reference for their versions is the package.json file that is managed by NPM. Modules within the node_modules directory are then copied to the source tree by the ./node_modules/.bin/grunt copy command.

The copying is configured to make a few small changes to some files for e.g. the relative font path in the font-awesome SASS file and to replace CRLF with LF where necessary.

Note: at present Grunt is only used for copying assets from node_modules. JS minification and SASS compilation is managed by the main SBT build system.

Testing

Running integration tests requires the same external services as for development, though in the conf/test.conf file their ports are non-default. You can set up these services using the default docker compose file, e.g.:

sudo docker-compose up

Note: you can keep test services and dev services all running together (at the expense, obviously, of more RAM) like so:

sudo docker-compose -f docker-compose.yml -f docker-compose-dev.yml -f docker-compose-minio.yml up