Development setup
This guide explains how to set up HERITRACE for local development from source code.
Prerequisites
Section titled “Prerequisites”- 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
Development environment setup
Section titled “Development environment setup”1. Clone the repository
Section titled “1. Clone the repository”git clone https://github.com/opencitations/heritrace.git && \cd heritrace2. Configure environment
Section titled “2. Configure environment”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.
3. Start development environment
Section titled “3. Start development environment”Choose one of two datasets:
make dev-smallmake dev-bigmake 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
4. Start the client
Section titled “4. Start the client”In a second terminal:
make frontend-devThis 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.
Development features
Section titled “Development features”Demo mode
Section titled “Demo mode”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.
Hot reload
Section titled “Hot reload”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
Client changes
Section titled “Client changes”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.
