REFERENCE SYSTEM - GRAFANA DASHBOARDS

The dashboards on https://dashboard.reference.msupply.foundation, to run against your
own copy of the reference system's database.

WHAT YOU NEED
  - The database, restored into PostgreSQL 17 (the download beside this one).
  - Grafana 13.2.2.
  - Its plugins:
      - netsage-sankey-panel, version 1.1.4
      - volkovlabs-echarts-panel, version 7.2.5
    Each is installed by name and version, for example:
      grafana cli plugins install netsage-sankey-panel 1.1.4
    or by Grafana itself at start-up, from the preinstall_sync line in grafana.ini.

THE DASHBOARDS
  - Cold chain equipment - real-time operational
  - Demo dashboards
  - Ordering and delivery
  - Patients and immunisation
  - Batch recall
  - Reference system
  - Supply chain
  - Remote temperature monitoring

TO RUN IT
  1. Unzip this somewhere, and in a terminal go to that folder.
  2. A read-only login for Grafana, as the Reference system's own Grafana uses - in psql, as a
     superuser, on the database you restored into (the mixed environment's set does this for you:
     its setup.ps1 runs setup.sql):
       CREATE ROLE grafana_ro LOGIN PASSWORD '<a password you choose>';
       GRANT USAGE ON SCHEMA public TO grafana_ro;
       GRANT SELECT ON ALL TABLES IN SCHEMA public TO grafana_ro;
  3. Tell Grafana where the database is, and where the dashboards are:
       export REF_DB_URL=localhost:5432
       export REF_DB_NAME=<the database you restored into>
       export REF_DB_USER=grafana_ro
       export REF_DB_PASSWORD=<its password>
       export REF_DASHBOARDS="$PWD/dashboards"
     (in Windows PowerShell: $env:REF_DB_URL = "localhost:5432", and so on)
  4. Start Grafana with this folder's settings:
       grafana server --config "$PWD/grafana.ini" \
         --homepath <Grafana's install folder, e.g. /opt/homebrew/share/grafana> \
         cfg:default.paths.provisioning="$PWD/provisioning"
     Then open http://localhost:3000. The home page lists every dashboard.

The dashboards are read-only in Grafana: they are loaded from these files. To change
one, change its file and restart Grafana. A user with read access to the database is
enough - Grafana never writes to it.
