The installation process is composed of two parts: install and run Invenio backend, and install and run JS frontend (Single Page Application). At the moment, InvenioILS is still under development. The following quickstart guide is to run InvenioILS in a development environment.
Clone the project repository from GitHub: https://github.com/inveniosoftware/invenio-app-ils.
Start all dependent services using docker-compose (this will start PostgreSQL, Elasticsearch, RabbitMQ and Redis):
docker-compose up -d
Make sure you have enough virtual memory for Elasticsearch in Docker.
Bootstrap the instance (this will install all Python dependencies and build all static assets):
Next, create database tables, search indexes, message queues and demo data:
The previous step created a set of demo data that allows to try the product. You can find the list of demo users in the homepage of InvenioILS when you run it. Otherwise, here the list:
|firstname.lastname@example.org||123456||super admin user, can access also to /admin|
|email@example.com||123456||user with "librarian" rights, can access to backoffice|
|firstname.lastname@example.org||123456||a patron user, cannot access to backoffice|
|email@example.com||123456||a patron user, cannot access to backoffice|
|firstname.lastname@example.org||123456||a patron user, cannot access to backoffice|
|email@example.com||123456||a patron user, cannot access to backoffice|
Since the InvenioILS web server is running on a different HTTP port (
:5000) of the UI web server (
:3000), we will have to tune Invenio configuration
to allow HTTP requests from different domain (CORS). To do that, we override the default configuration via the
Navigate to your virtualenv, e.g.
~/.virtualenvs/invappils/var/instance, and create a new file
CORS_SEND_WILDCARD = False CORS_SUPPORTS_CREDENTIALS = True
If you re-run the
setup script and re-generate the demo data, you will have to update this value.
Do not forget to restart the InvenioILS backend webserver if already running.
Enable CSRF for development¶
If you have enabled the csrf check during development, you need to follow one of the below steps in order to be able to make it work:
Start the UI application react-invenio-app-ils app with the command
npm run start:secure. This will run the react application over
httpsand the csrf cookie will be set corectly.
In case you run the UI application over
httpthen you will need to add in the config.py file of invenio-app-ils the following:
CSRF_FORCE_SECURE_REFERRER = False SESSION_COOKIE_SECURE = False
Clone the project repository from GitHub: https://github.com/inveniosoftware/react-invenio-app-ils.
Then, install the
The easiest way to run and develop is to run separately Invenio, for REST APIs, and the UI app using the npm web development server.
Start the Invenio backend web server (remember to have the virtualenv activated):
cd invenio-app-ils ./scripts/server
Start the celery worker:
celery worker -A invenio_app.celery -l INFO
The user interface is a single page React application created using create-react-app.
cd react-invenio-app-ils npm start
Run the backend tests, run:
For the frontend tests:
cd ui npm test
You can build the documentation with:
python setup.py build_sphinx
Vocabularies are indexed using Elasticsearch and can be indexed from a JSON
source file. To manage vocabularies use the
ils vocabulary CLI.
Some pre-defined vocabulary generators are available. To generate a JSON file with a list of languages or countries use:
ils vocabulary generate languages -o languages.json ils vocabulary generate countries -o countries.json
To add vocabularies from a JSON file use the
ils vocabulary index json [file1.json, file2.json, ...]
To add custom vocabularies or modify the text or data of an existing vocabulary
use the same
index command as above.
If you change the
key attribute of a vocabulary or if you remove a vocabulary
you also need to remove it from Elasticsearch. Use the
delete command to
remove a vocabulary:
ils vocabulary delete country # remove all countries ils vocabulary delete country --key CH # remove only Switzerland
Example vocabularies are available in
Vocabulary-specific configuration is available in
Develop React-invenio-app-ils as a npm linked library¶
- Setup react-invenio-app-ils ready for development
cd <react-invenio-app-ils dir> npm install npm run build
- Link the distribution (the scripts are already provided in package.json) and refresh on changes - it will build your dist folder
cd <react-invenio-app-ils dir> npm link npm run watch
- Go to your app, where you specified react-invenio-app-ils as your dependency and link the locally developed react-invenio-app-il
cd <my-react-app> npm install npm link @inveniosoftware/react-invenio-app-ils
UI network errors¶
If you are seeing in your application UI errors:
Something went wrong Network Error
You can find out more about the error by checking the console in your browser's developer tools.
- The backend server is running correctly (the console showing no exceptions)
- You have followed the installation guide
- the CORS policy is disabled for your local instance (not for any production environments!): check backend installation tutorial
- your browser has the exception for the https temporary certificate of the local instance.
Adding the certificate to the browser exceptions:¶
- In your browser go to:
- You will see a warning about the certificate. You need to proceed to the website and agree for adding the certificate to the exceptions
- Reload your UI.