Annotations service backend
The project provides two images (a fpm
and a cli
one) that run as the www-data
user. They work in concert with others to allow to run the service locally, or to run tasks such as tests.
Build images with:
docker-compose build
Run a shell as www-data
inside a new cli
container:
docker-compose run cli /bin/bash
Run composer:
docker-compose run composer composer install
Run a PHP interpreter:
docker-compose run cli /usr/bin/env php ...
Run PHPUnit:
docker-compose run cli vendor/bin/phpunit
Run all project tests:
docker-compose -f docker-compose.yml -f docker-compose.ci.yml build
docker-compose -f docker-compose.yml -f docker-compose.ci.yml run ci
- Query received via the
annotations
api. - Retrieve annotation listing from
hypothes.is/api
based on query parameters. - Denormalize the annotations into an object model.
- Normalize the annotations to prepare the response which conforms to the eLife json schema. We rely on CommonMark to step through the Markdown content and prepare the structure that we need, sanitizing each HTML value as it is rendered with HTMLPurifier.
- Return the response to the client.