OSF Preprints: The open preprint repository network
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
.github Update PR template Jun 28, 2018
app Merge branch 'release/next-interfaces' of https://github.com/CenterFo… Sep 20, 2018
config [IN-303][Preprints] Add withdrawn analytic to GA (#592) Aug 20, 2018
public [IN-91][IN-101][Preprints] Update EmberCLI version (#553) May 3, 2018
scripts [IN-65][Preprints] Add ESlint, Fix Errors (#565) May 17, 2018
tests Allow downloading previous versions of preprints (#617) Sep 5, 2018
vendor Initial Commit from Ember CLI v2.5.1 May 26, 2016
.bowerrc Point to new Bower registry Oct 11, 2017
.dockerignore Dockerfile build step Aug 15, 2016
.editorconfig Use nvmrc, update travis config, add editorconfig, update gitignore, … Jan 25, 2017
.ember-cli Move the assets script in to ember-cli-build (use es5 for without babel) Jan 26, 2017
.eslintignore Add coverage directory to eslintignore Mar 30, 2017
.eslintrc.js [IN-65][Preprints] Add ESlint, Fix Errors (#565) May 17, 2018
.gitignore Add docs to gitignore. Feb 3, 2017
.gitmodules Updated osf-assets submodule URL Jun 16, 2017
.nvmrc Update to Node.js version 8 Jun 16, 2017
.template-lintrc.js Fix submit; update template-lintrc (#574) May 31, 2018
.travis.yml Fix coveralls Nov 3, 2017
.watchmanconfig Initial Commit from Ember CLI v2.5.1 May 26, 2016
.yarnrc Mutli-stage docker build Nov 1, 2017
CHANGELOG.md Add Unreleased to CHANGELOG Sep 20, 2018
Dockerfile fix Dockerfile typo Jan 10, 2018
LICENSE Create LICENSE Aug 27, 2016
NOTICE.md Add license info Aug 15, 2016
README.md Typo on string #62 & #74 (#591) Jul 9, 2018
bower.json [IN-91][IN-101][Preprints] Update EmberCLI version (#553) May 3, 2018
ember-cli-build.js Remove ember-cli-sentry (#607) Aug 1, 2018
package.json Use latest ember-osf Sep 20, 2018
testem.js [IN-65][Preprints] Add ESlint, Fix Errors (#565) May 17, 2018
yarn.lock Use latest ember-osf Sep 20, 2018
yuidoc.json Use yuidoc.json from abought/demo-ember-osf. Feb 3, 2017

README.md

ember-osf-preprints

master Build Status: Build Status

develop Build Status: 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

  • git clone this repository
    • To pull in local preprint provider assets as well, use git clone --recursive instead (assuming you are using git >= 1.6.5).
  • yarn install --frozen-lockfile
  • bower install

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

  • To refresh your local assets, run: git submodule update
  • To update the assets submodule to the latest assets, run: npm run update-assets
  • To update to the latest assets and create a hotfix, run: npm run updates-assets-hotfix

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.

  • Populate the OSF's PreprintProvider model with data:

python -m scripts.populate_preprint_providers

  • Populate the OSF's Subject model with data:

python -m scripts.update_taxonomies

  • Create "fake" preprints using some additional arguments to the create_fakes script:

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

  • ember test
  • ember test --server

With Docker

  • docker build --tag preprints .
  • docker run preprints

Building

  • ember build (development)
  • ember build --environment production (production)

Further Reading / Useful Links