Skip to content

dev onboarding

Ian Ibbotson edited this page Feb 7, 2020 · 3 revisions

This page is intended for new developers wanting to develop reshare

Re:Share is built using the OKAPI API Gateway and uses a number of modules from the FOLIO ecosystem. Development is traditionally split into backend and frontend modules. Developers will need a local backend or access to a remote system. Backend developers will want to run a system locally, frontend developers may be able to use a hosted remote service.

Backend

the Re:Share modules are spring boot applications implemented via the grails JVM language. Your first dependency will be the grails tooling. SDKMAN is a useful tool as it provides userspace access to JVM, Gradle and Grails dependencies and the ability to switch between different versions in different contexts. We suggest you download and install SDKMAN and then run

  • sdk install gradle 4.5.1
  • sdk install grails 3.3.11
  • sdk install java 8.0.232.j9-adpt
  • sdk default gradle 4.5.1
  • sdk default grails 3.3.11
  • sdk default java 8.0.232.j9-adpt

The backend also makes use of vagrant and the virtualbox engine for vagrant as per the standard FOLIO setup. Get those installed.

Your first task will be to stand up the core FOLIO system - mod-rs has a Vagrantfile at its root, so check out mod-rs and run

vagrant up

in it's root directory to start up a core folio system.

Re:Share currently has two primary modules, and the order is important:

mod-directory

Mod-directory provides information about the organisations in a resource sharing network and the connections between them. It is a peer-to-peer directory service with no central hub where consortia maintain their own membership lists and member libraries maintain their own records. Check out mod-directory.

Mod-directory is a grails application build it and start it with the following (Assuming you have used sdkman as above to provide java, gradle and grails

cd mod-directory/service
grails prod war
../scripts/run-external-reg.sh
../scripts/register-and-enable.sh

This sequence will start up mod-directory and register and enable the module for the diku tenant. On subsequent runs, you do not need to run register-and-enable.

At startup, mod-directory will harvest a default set of directory information from it's seed_data directory on github. This will be used to populate the module datastore. As it populates the datastore, mod-directory announces directory-entry-updated events to the Apache KAFKA install running inside the vagrant image. This is the only work we need mod-directory to do, and it can be safely shut-down (ctrl-c) after.

mod-rs

Start mod-rs with the following sequence

cd mod-rs/service
grails prod war
../okapi-scripts/run_external_reg.sh
../okapi-scripts/register_and_enable.sh

This sequence will build mod-rs, start it and then enable the module for the diku tenant. register_and_enable only needs to be run once at first install.

In your development workflow, you will often be editing code, and then re-running grails prod war; ../okapi-scripts/register_and_enable.sh

mod-rs also needs some additional system level configuration to route requests to the appropriate tenant based on incoming protocol messages. A utility script is provided using the groovy language. Use SDKMAN to provision groovy and then run the script:

cd mod-rs/other_scripts
sdk install groovy 2.5.6
sdk default groovy 2.5.6
groovysh
:load setupLocal.groovy

This script will configure mappings from various test ILL symbols to the tenant and create a test request.

Frontend

The following command is provided as a helper, YMMV, help and support is available on the reshare-dev channel. Reshare front end devs may not approve of this process ;) it's what lazy backend devs are using to quickly provision a setup:

curl -s "https://raw.githubusercontent.com/openlibraryenvironment/platform-rs/master/helper_scripts/setup" | bash
cd rs_ui/platform_rs
yarn install
stripes serve ./stripes.config.js --hasAllPerms

Once you have done this, you should be able to log on to localhost:3000 using the default diku admin user and password and see the various reshare front end applications in your browser.

Clone this wiki locally