Skip to content

Facilitating the global conversation on academic literature

License

Unknown, AGPL-3.0 licenses found

Licenses found

Unknown
LICENSE
AGPL-3.0
COPYING
Notifications You must be signed in to change notification settings

weiqiao/peerlibrary

 
 

Repository files navigation

PeerLibrary

Facilitating the global conversation on academic literature.

https://peerlibrary.org/ | http://blog.peerlibrary.org/ | @PeerLibrary

Development installation

PeerLibrary is built upon the Meteor platform. You can install it with:

curl https://install.meteor.com | sh

If you do not have node.js installed on your system, you can use one provided by Meteor. To add it into your environment, add ~/.meteor/tools/latest/bin to your environment PATH variable. For example, by running:

export PATH=~/.meteor/tools/latest/bin:$PATH

To add tools to you shell permanently, run:

echo 'export PATH=~/.meteor/tools/latest/bin:$PATH' >> ~/.bash_profile

Maybe on your system you have to add the line to ~/.profile file instead.

PeerLibrary requires additional Meteor packages which are provided through Meteorite, a Meteor package manager. Install it as well:

npm install -g meteorite

Other requirements to run PeerLibrary

On first run, PeerLibrary compiles and locally installs additional Meteor packages, some of them have non-Meteor dependencies. The following libraries have to be available on your system for PeerLibrary to successfully run:

On Mac OS X you can get Cairo by installing X11 (Pango and FreeType are already available on the system) and run the following before you run mrt to configure the environment:

export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig

To be able to compile Meteor packages, you need Xcode with command line tools installed (from Preferences > Downloads > Components).

You can install pkg-config using Homebrew (MacPorts also works, if you prefer it):

brew install pkg-config

On Debian you can install all dependencies by:

sudo aptitude install libcairo2-dev libfreetype6-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++

Run it!

Recursively clone a PeerLibrary repository:

git clone --recursive https://github.com/peerlibrary/peerlibrary.git

This will give you the latest development version of PeerLibrary (development branch). The latest stable version is in the master branch.

And then run a development instance of PeerLibrary:

mrt

And open http://localhost:3000/, which is an address of your local development instance, to start an installation wizard process in which you create an admin user (which has username admin). After you create an admin user, PeerLibrary will reload.

To demo the tool, you will need to populate your instance of the database with publications. Log in as admin and go to Admin dashboard (http://localhost:3000/admin). Click on the Initialize database with sample data button, to initialize the database with the same publications from arXiv. It will fetch metadata, cache a few PDFs and process them. Publications will be searchable at your http://localhost:3000/.

For more information on configuring your installation, see settings.

ArXiv publications

To load and use arXiv publications, open Admin dashboard (http://localhost:3000/admin) and click on Sync arXiv metadata button first and after it loads all the metadata, click Sync arXiv PDF cache button to load all PDFs. After the caching finishes and PDFs are processed you will be able to search and open arXiv publications in PeerLibrary.

arXiv is a huge repository and loading all the publications takes a lot of space (few 100 GBs) and time. You probably do not want to do this. It consumes arXiv resources and costs you money. Use Initialize database with sample data to get a small sample of arXiv publications.

You will need AWS accessKeyId and secretAccessKey which you have to put into your settings.json file. All PDF transfer costs will be billed against this account.

Free Speech Movement publications

To load and use Free Speech Movement publications, open Admin dashboard (http://localhost:3000/admin) and click on Sync FSM metadata button first and after it loads all the metadata, click Sync FSM cache button to load all the TEI textual documents. After the caching finishes you will be able to search and open FSM publications in PeerLibrary.

You will need FSM API appId and appKey which you have to put into your settings.json file.

Troubleshooting

Sometimes when installing dependencies, Meteor will throw the following error:

npm ERR! cb() never called!
npm ERR! not ok code 0

This just means that there was a timeout while downloading a dependency, probably because of a networking issue. Just retry.

If you have not cloned recursively (if you forgot --recursive in git clone --recursive https://github.com/peerlibrary/peerlibrary.git), you will at some point get a such or similar error:

While building package `blob`:
error: File not found: Blob/Blob.js

Or similar errors for other packages, you just have to manually initialize git submodules we are using:

git submodule update --init --recursive

If you are getting an error like:

Error: Cannot find module '../build/Release/canvas'

Then there is an issue compiling the node-canvas dependency. Check if you have all required non-Meteor dependencies installed and retry by removing the whole meteor-pdf.js package and running mrt again:

rm -rf ~/.meteorite/packages/pdf.js/

If you are getting Stylus errors like:

error: Stylus compiler error: client/css/_viewer.styl:2

failed to locate @import file variables.styl

You are not running mrt in the top-level directory of PeerLibrary. This is a bug in Meteor.

If you notice that mrt command disappeared is this because you probably updated Meteor. You have to reinstall Meteorite (npm install -g meteorite).

Contributing

PeerLibrary is currently in active development where we are creating basic architecture. Major code refactoring and rewrites are thus common. Nevertheless, you are invited to join the development, but please understand that things might be changing under your feet so it is probably useful to discuss planned contributions in advance.

See the CONTRIBUTING file for more details and ideas.

About

Facilitating the global conversation on academic literature

Resources

License

Unknown, AGPL-3.0 licenses found

Licenses found

Unknown
LICENSE
AGPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published