Skip to content

Development setup

This guide explains how to set up HERITRACE for local development from source code.

  • Docker and Docker Compose
  • Git
  • GNU Make
  • The Flutter SDK, at the version pinned in frontend/pubspec.yaml
  • For the full dataset only: 7-Zip, about 175 GB of free disk space for the first download, and Docker with at least 30 GB of memory
  • Modern web browser
Terminal window
git clone https://github.com/opencitations/heritrace.git && \
cd heritrace

The first make run copies .env.example to .env if .env is missing. Edit .env with your settings.

make dev-small and make dev-big sign users in with ORCID. Set ORCID_CLIENT_ID, ORCID_CLIENT_SECRET, and ADMIN_ORCIDS in .env, and register https://127.0.0.1:5001/auth/callback as a redirect URI of your ORCID application.

Choose one of two datasets:

Terminal window
make dev-small
Terminal window
make dev-big

make dev-small uses the 173 OpenCitations Meta statements of the ISWC 2026 demo, found in demo/iswc2026/data/dataset.nq.

make dev-big uses the full OpenCitations Meta database, so that performance problems show up at production scale. On the first run, it downloads the QLever index from Zenodo. The download is 56.6 GB, and the extracted index takes about 116 GB. Later runs reuse the local copy.

Both commands start:

  • QLever with the chosen Meta data on localhost:7101
  • QLever with the provenance on localhost:7103, starting from an empty index
  • the backend on https://127.0.0.1:5001, with an internal Redis

In a second terminal:

Terminal window
make frontend-dev

This runs the Flutter client with hot reload on https://127.0.0.1:5100, with the same self-signed certificate as the backend, and opens it in Chrome.

make demo-small and make demo-big start the same environments as make dev-small and make dev-big with FLASK_ENV=demo, which bypasses ORCID authentication.

Edits, provenance, and Redis data persist across restarts. make reset-demo-small and make reset-demo-big discard them and start the demo from the original dataset.

Gunicorn runs with --reload, so changes to Python files automatically restart the workers. Watched paths include:

  • Python source files in heritrace/
  • app.py, config.py

The client lives in frontend/. With make frontend-dev running, press r in its terminal to hot reload after editing Dart code. After editing the strings in frontend/lib/i18n/, run dart run slang in frontend/ first. make frontend produces the release build that Flask serves in production.