Coder Social home page Coder Social logo

PREreview

A platform for reviewing preprints.

Requirements

Structure

Composed of 3 different parts:

  • A React-based frontend that provides a standalone webform tool to submit tickets.
  • A Koa-based backend that renders & serves the frontend and exposes an API used by the frontend.

These parts are located here in this repository:

src/backend  # The backend components
src/common   # Common code and assets
src/frontend # The React frontend

Configuration

PREreview is configured via variables either specified in the environment or defined in a .env file (see env.example for an example configuration that may be edited and copied to .env).

The backend parses the following configuration variables:

PREREVIEW_LOG_LEVEL       # Logging level (default: error)
PREREVIEW_HOST            # The host PREreview runs on (default: localhost)
PREREVIEW_PORT            # The port to bind to (default: 3000)
PREREVIEW_ADMIN_USERNAME  # The administrative user (default: 'admin')
PREREVIEW_ADMIN_PASSWORD  # The administrative password
PREREVIEW_DB_HOST         # Postgres database host (default: localhost)
PREREVIEW_DB_PORT         # Postgres port (default: 5432)
PREREVIEW_DB_DATABASE     # Postgres database name (default: prereview)
PREREVIEW_DB_USERNAME     # Postgres user (default: prereview)
PREREVIEW_DB_PASSWORD     # Postgres password
PREREVIEW_DB_POOL_MIN     # Postgres minimum connections (default: 0)
PREREVIEW_DB_POOL_MAX     # Postgres max connections (default: 10)
PREREVIEW_DB_TIMEOUT      # Postgres connection timeout (default: 0)

Additionally, we use the semi-standard NODE_ENV variable for defining test, staging, and production environments as well as log4js for setting logging verbosity.

Deployment

Standalone

First, clone this repository and from the root of the resulting directory install dependencies:

npm install

Then, build all components:

npm run build

Create the database:

npm run db:migrations

And start the running processes (with necessary environment variables if not defined in .env):

npm run start

(use npm run start:dev to run in development mode)

Additionally, components can be built or started individually using for example npm run build:backend, npm run start:worker, etc.

Docker

You can deploy this tool using Docker. There is an included docker-compose.yml file that will allow you to run it in a production configuration. First, clone the repo and from this directory run docker-compose:

docker-compose up --build -d

This will build the docker container from the current repository, download the official Postgres docker image, and configure them both (the -d flag will detach from the current shell so that you can leave it running, but you can omit it in order to leave the log output attached).

If this is the first time you've run it on this system, you'll want to run the database migrations to initialize the database:

docker-compose run prereview npm run db:migrations

By default, it runs on http://localhost:3000, but you can place it behind a proxy such as Nginx in order to provide TLS support and other features.

License

PREreview is an open-source software project licensed under the MIT License by PREreview.

PREreview's Projects

api icon api

A repository to host the code related to PREreview preprint reveiw platform API and third-party site integrations

documentation icon documentation

This repository contains the documentation for PREreview v2 platform

preprint-proxy icon preprint-proxy

transparent CORS proxy for bouncing PDF requests in the PREreview PDF reader

prereview-2 icon prereview-2

PREreview - Post, Read and Engage with preprint reviews (open source v2 in development)

prereview-feed icon prereview-feed

A script for generating feeds in various formats from the Outbreak Science Rapid PREreview API.

rapid-prereview icon rapid-prereview

An application for rapid, structured reviews of outbreak-related preprints

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.