Home

Awesome

ember-osf-preprints

master Build Status: Master Build Status

develop Build Status: Develop Build Status

Coverage Status

This is the codebase for OSF preprints. This guide will help you get started if you're interested.

Prerequisites

You will need the following things properly installed on your computer.

Installation

Preprint Provider Assets

If you will be using local preprint provider assets (rather than the CDN):

  1. If you did not clone the repository using --recursive, run: git submodule update --init --recursive
  2. Set the PROVIDER_ASSETS_URL environment variable to 'local'

Updating Assets

Running / Development

For local development, this is designed to run alongside (and from within) the flask application for osf.io.

  1. Check out this OSF feature branch: https://github.com/CenterForOpenScience/osf.io/tree/feature/ember-preprints
  2. Start your Ember server: ember serve
  3. Copy these lines to your website/settings/local.py file. Uncomment '/preprints/': 'http://localhost:4200', and restart your flask app.
  4. Visit your app at http://localhost:5000/preprints/

Provider Domains

  1. Start the API server
  2. Run sudo ./scripts/add-domains.js. This will add the domains to your /etc/hosts. Use --dry for a dry run.
  3. Visit your app at one of the provider domains with https://local.<domain>:4200 (e.g. http://local.socarxiv.org:4200)

If you encounter problems, make sure that your version of ember-osf is up to date. If login fails, try logging in from any other OSF page, then returning to the preprints app.

Generating test data on the OSF

There are a few scripts to run to populate your local preprint providers list, and help generate some "fake" preprints locally so you can begin testing using the OSF API.

python -m scripts.populate_preprint_providers

python -m scripts.update_taxonomies

python -m scripts.create_fakes -u user@email.io --nprojects 2 --preprint True --preprintprovider osf,psyarxiv

notes: You can enter as many providers as you like, separated by commas. Also, this script does not currently create actual fake files, only fake file metadata; the file itself won't render in a preprint view, but you can still request its information from the API.

Code Generators

Make use of the many generators for code, try ember help generate for more details

Running Tests

You can run tests either with ember installed on your machine or by using Docker

On your local machine

With Docker

Building

Further Reading / Useful Links