Skip to content

Quickstart

To get an initial impression of the app, you can quickly deploy it using either Compose or Helm.

Requires the Docker CLI with the Compose plugin version 5.6.0 or later on a machine with around 16 GiB of memory.

Download and extract the Compose files from the latest release:

curl -fsSL https://github.com/open-recruit/recruit/releases/latest/download/recruit-compose.tgz | tar -xz

Start all services, including demo fixtures:

docker compose --project-name=recruit-demo \
    --env-file=compose/.demo.env \
    -f compose/compose.yaml \
    -f compose/compose.demo.yaml up --detach --wait

The first start takes several minutes to download the images, pre-load the FHIR server with synthetic data, and register the same resources as Delta Lake tables for querying by Trino.

Once the command exits, open the screening list at http://127.0.0.1:32080. Authentication is disabled in the demo, so there's no login. The query module checks for studies every minute, so the demo study's screening list shows up about a minute later.

What's included

Besides the two recruIT modules, the screening list (list) and the query module (query-sql-on-fhir), compose.demo.yaml starts everything they depend on:

  • a HAPI FHIR server, pre-loaded with a dozen Synthea patients and a demo study
  • a lakehouse with the same patients as Delta Lake tables, made up of SeaweedFS as object storage, a Hive metastore, and Trino to query them
  • PostgreSQL for the FHIR server, the screening list, and the Hive metastore
  • MailDev, a mock mail server that catches the notification emails, at http://127.0.0.1:32025

For a production installation, all of these are replaced by your own services, see Docker Compose.

Troubleshooting

Follow the query module's logs to see it pick up the studies and run their eligibility criteria:

docker compose --project-name=recruit-demo logs --follow query-sql-on-fhir

Check that every service is healthy:

docker compose --project-name=recruit-demo \
    --env-file=compose/.demo.env \
    -f compose/compose.yaml \
    -f compose/compose.demo.yaml \
    -f compose/compose.probe.yaml run --rm health-probes

To stop and remove everything, including demo data, run:

docker compose --project-name=recruit-demo down --volumes

Requires access to a Kubernetes cluster with around 16 GiB of memory, e.g. a local one created using KinD, as well as kubectl and helm.

Create a basic KinD cluster:

kind create cluster

Install the chart into a new recruit namespace, with demo fixtures enabled:

helm upgrade --install -n recruit \
  --create-namespace \
  --render-subchart-notes \
  --version 11.3.0 \
  --wait \
  --timeout 30m \
  -f https://raw.githubusercontent.com/open-recruit/recruit/refs/tags/v11.3.0/charts/recruit/values-demo.yaml \
  recruit-demo \
  oci://ghcr.io/open-recruit/recruit/charts/recruit
Demo values

The values-demo.yaml used above enables the query module and a sample study, and generates synthetic patients that are loaded into the FHIR server and queried by the query module via an embedded DuckDB, see Querying FHIR resources with DuckDB:

values-demo.yaml
postgres:
  fullnameOverride: recruit-demo-postgres
  initdb:
    scripts:
      init-databases.sql: |
        CREATE DATABASE fhir;

fhirserver:
  # loading the synthetic patients is bound by how fast the FHIR server processes the transaction bundles
  resourcesPreset: xlarge
  # overrides the chart's default `fhirserver.extraEnv`, so its entries are repeated here
  extraEnv:
    - name: HAPI_FHIR_SUBSCRIPTION_RESTHOOK_ENABLED
      value: "true"
    - name: SPRING_FLYWAY_BASELINE_ON_MIGRATE
      value: "true"
    # don't reuse an identical search's results for a minute, so new screening lists and their entries
    # show up straight away, e.g. after re-recommending a patient on the Notification Test page
    - name: HAPI_FHIR_REUSE_CACHED_SEARCH_RESULTS_MILLIS
      value: "0"
    # the JVM defaults to a max heap of only 25% of the container's memory limit
    - name: JAVA_TOOL_OPTIONS
      value: "-XX:MaxRAMPercentage=75"
  postgres:
    enabled: false
  externalDatabase:
    host: recruit-demo-postgres
    user: postgres
    database: fhir
    existingSecret: recruit-demo-postgres
    existingSecretKey: postgres-password

# loaded into the FHIR server, and generated once more as NDJSON files for the query module to query via DuckDB
syntheticPatients:
  enabled: true

querySqlOnFhir:
  enabled: true
  schedule: "0 * * * * *"
  sqlDialect: duckdb
  duckdb:
    # views over the synthetic patients' NDJSON files, named like the Delta Lake tables queried via Trino
    initSql: |
      ATTACH ':memory:' AS fhir;
      CREATE SCHEMA fhir."default";
      CREATE VIEW fhir."default".patient AS SELECT * FROM read_json('/data/fhir/Patient.ndjson');
      CREATE VIEW fhir."default".condition AS SELECT * FROM read_json('/data/fhir/Condition.ndjson');
      CREATE VIEW fhir."default".observation AS SELECT * FROM read_json('/data/fhir/Observation.ndjson');
      USE fhir."default";
  extraEnv:
    - name: QUERY_SQL_ON_FHIR_FUNNEL_ENABLED
      value: "true"

sampleStudy:
  enabled: true

list:
  notifications:
    testing:
      # lets the Notification Test page re-recommend a patient, see docs/configuration/notifications.md
      enabled: true

The install takes several minutes to download the images, generate synthetic patients, and load them into the FHIR server.

Once the command exits, forward the screening list port:

kubectl -n recruit port-forward svc/recruit-demo-list 32080:8080

and open the screening list at http://127.0.0.1:32080 to see the demo study. It might take a couple of minutes to appear.

To remove everything again, run:

helm uninstall -n recruit recruit-demo
kubectl delete namespace recruit

Tip

You can now either create your own study or head straight to the production deployment guide using Compose or Kubernetes.