Outbreak Science Rapid PREreview is an application for rapid, structured reviews of outbreak-related preprints. The platform allows any researcher with an ORCID iD to provide a quick high-level evaluation of preprints via a series of questions to assess the originality and soundness of the research findings. Aggregated data from these reviews is visualized to allow readers to identify the most relevant information. This tool has the capacity to be transformative for on-the-ground health workers, researchers, public health agencies, and the public, as it can quickly unlock key scientific information during an outbreak of infectious diseases.
Outbreak Science Rapid PREreview is a project born from the collaboration of PREreview and Outbreak Science.
PREreview is an open project fiscally sponsored by the non-profit organization Code for Science & Society. PREreview's mission is to increase diversity in the scholarly peer review process by empowering all researchers to engage with preprint reviews.
Outbreak Science is a non-profit organization aimed at advancing the science of outbreak response, in particular by supporting early and open dissemination of data, code, and analytical results.
This collaborative project is mainly funded by the Wellcome Trust Open Research Fund, but has also received support from the Mozilla Foundation.
Outbreak Science Rapid PREreview focuses on providing the best infrastructure to request / provide / analyze feedback (structured reviews) on existing preprints relevant to the outbreak community.
The feedback should be of use to:
- the outbreak community (academics)
- workers, editors, journalists (visualization etc.)
Outbreak Science Rapid PREreview does not focus on:
- coordinating research effort / data analysis / calling for research during emergency situations
- becoming / being a preprint server
-
gitis used for versioning in this project. -
Docker is used to manage services for local development.
This repo also contains configuration files for Visual Studio Code's Remote Containers which reduces the need to manually execute Docker commands; see the Visual Studio Code manual for more information about how to use these.
docker-compose -f .devcontainer/docker-compose.yml up --build
This command will keep running in the shell to display log output from all services; you can stop the server by typing Control+C.
docker-compose -f .devcontainer/docker-compose.yml exec web bash
The source folder will appear in the container as /workspace; change to that directory before running any npm commands.
You can edit these files with your preferred editor and the container will stay updated.
docker-compose -f .devcontainer/docker-compose.yml logs
You can optionally name a service whose logs you want to view; the default is to show logs for all services.
Service names are defined in docker-compose.yml and include 'web', 'cache', 'db'.
You should have everything needed to follow the rest of this README.
At the root of this repository run:
npm installIf you are having permission issues with npm checkout
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
Please note the section above labelled 'Running commands in the container.'
npm run initto setup the databases.
To seed the app with some data run:
npm run seedAfter, run:
npm startand visit http://127.0.0.1:3000/
If you want to start from an empty state (or reset the DB to an empty state) you can run:
npm run resetTo work (or test / demo) the extension you can:
- start a dev server (run
npm start) - follow the instruction below depending on whether you want to work with Chrome or Firefox.
- Run
npm run extension:watchthat will build and watch the extension in theextensiondirectory. ! DO NOT EDIT THE FILES THERE or do not tack them on git, with the exception ofmanifest.json,fonts/,icons/andpopup.html. - Navigate to
chrome://extensions/, be sure to toggle the "developer mode", click on "load unpacked" and select the content of theextensiondirectory.
- Run
npm run extension:watch-firefoxthat will build and watch the extension in theextensiondirectory. ! DO NOT EDIT THE FILES THERE or do not tack them on git, with the exception ofmanifest.json,fonts/,icons/andpopup.html. - Navigate to
about:debugging, and click on "Load Temporary Add-on" and select theextension/manifest.jsonfile.
Never run npm run extension:watch and npm run extension:watch-firefox at
the same time as they will overwrite each other. If you did:
- kill all the node processes (
ctr+cin each shell) - run
killal nodeto be sure you no longer have node processes running - restart the web server
npm startand one of the extension watchernpm run extension:watchORnpm run extension:watch-firefox
- Run
npm install - Set the
versionproperty of theextension/manifest.jsonfile - Run
npm run extension:build - Run
npm run extension:pack - Upload the created
extension.zipfile to the Chrome web store
- Run
npm install - Set the
versionproperty of theextension/manifest.jsonfile - Run
npm run extension:build-firefox - Run
npm run extension:pack-firefox - Upload the created
extension-firefox.zipfile to the Firefox web store
Note: to include the unbundled source code of the extension (asked by Mozilla
add on) run npm run extension:pack-src and include the following text when you
upload the generated extension-src.zip:
The extension is built with webpack (config is webpack-extension.config.js). See more details on the README.md file. The source code is also available on GitHub: https://github.com/prereview/rapid-prereview/
This supposes that you have followed the instruction from the rest of this README.
Suggested steps:
- Start the local services using
docker-compose -f .devcontainer/docker-compose.yml up. - In a shell attached to the 'web' container:
- run
npm run seedornpm run resetto either seed the database with sample data (or start from a clean state) - run
npm startto start the web server
- run
- In another terminal, run
npm run extension:watchand update the extension in your browser (see section above for instructions) - You can now visit http://127.0.0.1:3000/ and give a demo
When you are done with the demo you can use docker-compose down to shut down the server.
cdinto this repository- run
git fetchfollowed bygit merge origin/master - Connect a shell to the web container and run
npm install - Follow the First time instructions (see above)
If you want to work on component in isolation run:
npm run storybookand visit http://127.0.0.1:3030/.
To add stories, add a file that ends with .stories.js in the ./src/components directory.
Once cloudant and redis are running run:
npm testSeveral CouchDB views can give access to usage statistics. For instance, logging
in to Cloudant and visiting
/rapid-prereview-docs/_design/ddoc-docs/_view/byType?group_level=1 will report
a breakdown of the counts per types.
We use Azure and IBM Cloudant.
We use Azure App Service and run 2 apps:
rapid-prereviewfor the web serverrapid-prereview-servicefor a process that takes care of:- maintaining our search index (listening to CouchDB changes feed)
- updating the "trending" score of preprints with reviews or requests for reviews on a periodical interval
These 2 apps are run on the same service plan (rapid-prereview-service-plan).
The databases are hosted on IBM Cloudant (CouchDB) and are composed of 3 databases:
rapid-prereview-docs(public) storing the roles, reviews and requests for reviewsrapid-prereview-users(private) storing all the user data (and the links user <-> role)rapid-prereview-index(private) storing the preprint with reviews or request for reviews search index
We use Azure Cache for Redis to store:
- session data
- cached data for the payload of the public API.
We use Sendgrid (from the Azure marketplace) for emails.
Be aware that all the following will source the production environment variables (see the Azure section below for information to get them).
- Run
npm run cloudant:initto create the databases and push the design documents - Run
npm run cloudant:set-securityto secure the databases - Run
npm run cloudant:get-securityto verify the security object
To update the design documents run: npm run cloudant:ddocs.
To seed the production database (for demos only) run: npm run cloudant:seed
(!! note that this performs a hard reset and delete all data in the databases
before seeding).
To reset the production database (for demos only) run: npm run cloudant:reset (!! note that this performs a hard reset and delete all data in
the databases).
Visit https://portal.azure.com/ All the resources we used are defined in a
rapid-prereview resource group.
- Install Azure CLI (see https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest)
- Run
az loginto login to the CLI - Get the private files not checked in to GitHub:
./get-private.sh(if you later update those files, run./put-private.shto upload them back) - Run
npm run build(after having runnpm install) - Run
./deploy-app.shto deploy the app and./deploy-service.shto deploy the service
To see the logs, run ./log-app.sh or ./log-service.sh. We use
pino for logging.
Apps can be restarted with ./restart-app.sh and ./restart-service.sh.
To reset the redis cache run: npm run azure:reset-cache. Be aware that this
will source the production environment variables.
To reset all redis data (including sessions) run: npm run azure:reset-redis. Be aware that this will source the production environment
variables.
Some basic info about the service health can be found at https://rapid-prereview-service.azurewebsites.net/
Backups are stored in a blob storage container on azure.
- Install Azure CLI (see https://docs.microsoft.com/en-us/cli/azure/?view=azure-cli-latest)
- Run
az loginto login to the CLI - Run
npm run backupBe aware that this will source the production environment variables.