Develop¶
This documentation will guide you on how to setup your local development environment.
The installation process is composed of two parts: install and run the Invenio backend, and install and run the JavaScript frontend (Single Page Application).
Prerequisites¶
Make sure that you have installed the prerequisites below:
- Python 3, at the moment we are using Python 3.9.
- pipenv, e.g. via
pip
. - NodeJS version 14.
- InvenioCLI tool (see reference)
Quick start¶
Every time you want to run InvenioILS, you will need to:
- have the Docker services up and running
- have the InvenioILS backend development web server and celery workers running
- have the InvenioILS UI development web server running
1. Scaffold project¶
Scaffold your InvenioILS instance. Replace <version>
with the version you want to install:
invenio-cli init ils -c v4.0.0
You will be asked several questions. If in doubt, choose the default.
2. Start all dependent services using docker-compose¶
This will start PostgreSQL, Elasticsearch, RabbitMQ and Redis:
cd my-site/
docker-compose up -d
3. Build, setup and run backend part¶
./setup.sh
Run the backend server:
FLASK_ENV=development pipenv run invenio run --cert docker/backend/test.crt --key docker/backend/test.key
- Changing
REACT_APP_INVENIO_UI_URL
andREACT_APP_INVENIO_REST_ENDPOINTS_BASE_URL
variables inui/.env
file to run onhttp
instead ofhttps
. - Running the server without specifying the certificate:
FLASK_ENV=development pipenv run invenio run
In a new terminal, start the celery worker. Make sure you are in the project folder (my-site
) then run:
pipenv run celery -A invenio_app.celery worker -l INFO
4. Install UI dependencies¶
Open a separate command line and install the JavaScript dependencies:
cd my-site/ui
npm install
5. Run frontend web server¶
npm start
Now visit https://127.0.0.1:3000 (accept the self-signed certificate warning if proposed). You should now see the InvenioILS website.
6. Stop it¶
When you are done, you can stop your instance and optionally destroy the containers:
To just stop the containers:
docker-compose stop