Create ~/.aws/credentials
and populate the credentials, e.g.:
[default]
aws_access_key_id=<key id>
aws_secret_access_key=<access key>
You may also create ~/.aws/config
:
[default]
region=<region>
Copy app-example.cfg
to app.cfg
and make the necessary configuration changes.
When using Docker for development, the configuration file is app-dev.cfg
instead.
It would very much have the same config but the database should point to the db
service (defined in docker-compose.override.yml).
- Docker and Docker Compose
make migrate-schema
This will download updates from AWS and populate the database with it. This may take a while. It will also download data from Crossref, which might fail, which is 'okay'.
make update-data-and-reload
Downloaded files and cache are stored to the .data
directory. Which in development is mounted to the host. To make the directory writable by the Docker user (elife
) call (writable to all users):
make fix-data-permissions
make start
- Python 3 (including dev dependencies, e.g.
python3-dev
on Ubunutu / Debian) - system dev dependencies (e.g.
build-essential
) - PostgreSQL (although SQLite may work too)
- Node.js and npm
If you want to use a separate virtual environment (venv
) for this project.
./install.sh
source venv/bin/activate
Assuming you already created and switched to your own virtual environment.
for line in $(cat requirements.txt); do pip install $line; done
Download SpaCy models (~1 GB).
python -m spacy.en.download all
The recommended database is PostgreSQL.
Assuming you want to create a database reviewer_suggestions_db with the user reviewer_suggestions_user and password 'password', you may use the following commands as a guidance:
sudo -u postgres psql -c "create user reviewer_suggestions_user;"
sudo -u postgres psql -c "create database reviewer_suggestions_db;"
sudo -u postgres psql -c "alter user reviewer_suggestions_user with encrypted password 'password';"
sudo -u postgres psql -c "grant all privileges on database reviewer_suggestions_db to reviewer_suggestions_user;"
python -m peerscout.preprocessing.migrateSchema
This will download updates from AWS and populate the database with it. This may take a while. It will also download data from Crossref, which might fail, which is 'okay'.
python -m peerscout.preprocessing.updateDataAndReload
cd client
npm install
npm run bundle
python -m peerscout.server
Then go to http://localhost:8080/. (If you are getting a 'Not Found' error you may not have compiled the client)
The server will provide the REST API http://localhost:8080/api/ and serve the static client bundle.
Use this option to develop the client, in addition to the python server (which will still provide the API).
cd client
npm start
Then server will be availabe under http://localhost:8081/.
./project_tests.sh
pytest
To watch tests, run pytest-watch
instead.
cd client
npm test
Watch:
cd client
npm run ~test