The main Ontohub service that serves the data for the frontend and other clients via the GraphQL API.
Run the backend in development mode
You need to have the
rabbitmq services started.
This guide assumes that you have got the hets-agent located at
../hets-agent relative to the ontohub-backend repository.
We use the invoker process manager during development to run all the needed processes with one command.
You can start it with either
bundle exec rails invoker or
bundle exec invoker start invoker.ini (the former only calls the latter, but consumes more memory).
Alternatively, you can start the processes yourself by running each of these commands in a separate terminal:
bundle exec rails sneakers:runto run the sneakers workers
bundle exec rails serverto run the HTTP server of the backend in development mode
pushd ../hets-agent && bin/hets_agent; popdto run the HetsAgent
Access the backend
The backend is implemented in Ruby on Rails. First,
the Ruby version referenced in the file .ruby-version needs to
be installed, as well as the gem bundler.
git needs to
be installed as well. Invoking the command
bundle install in the directory
of this repository will then install all dependencies of the backend.
Set up a development environment
Build the REST API documentation
We maintain API documentation with a JSON schema description.
The schemas are located at spec/support/api/schemas.
You can build an HTML-representation of it with doca.
This requires the tools
yarn to be installed on your system and be in your
First, you need to install doca with npm. We created a Rake task for this:
Next, you need to create the documentation server files:
This initialization must be run whenever new schema files are created.
And finally, you can run the API documentation server (the default port is 3002):
rails apidoc:run # or to change the port: PORT=8001 rails apidoc:run
Then, visit http://localhost:3002 to see the REST API documentation. This server listens to changes on the JSON schema files and updates the documentation.