Skip to content

Deployment

HealthGuard supports two deployment methods:

  • Docker Compose (recommended): One command to start PostgreSQL, Collector, and Dashboard.
  • From Source: For local development or debugging.

Prerequisites

bash
git clone https://github.com/Claud-Lu/healthguard.git
cd healthguard
docker compose up -d

Open http://localhost in your browser and register an account.

Default service ports:

ServicePortNotes
Dashboard80Web UI
Collector3100Event ingestion API; health check at /health
PostgreSQL5432Data persistence

Environment Variables

Override defaults via a .env file or Docker Compose environment variables:

VariableDescriptionRecommendation
DATABASE_URLPostgreSQL connection stringUse a strong password in production
CORS_ORIGINAllowed CORS originSet to your real domain; avoid *
HEALTHGUARD_AGENT_TOKENRepair Agent bearer tokenGenerate a strong random secret
JWT_SECRETSession signing secretMust be changed in production

Production Checklist

  1. Change the default database password: The default docker-compose.yml uses healthguard for development convenience.
  2. Enable HTTPS: Use a reverse proxy (Nginx, Traefik, or Caddy) with a valid TLS certificate.
  3. Restrict CORS: Replace CORS_ORIGIN=* with your actual Dashboard domain.
  4. Back up PostgreSQL regularly: Use pg_dump or volume snapshots.

Option 2: Run from Source

bash
git clone https://github.com/Claud-Lu/healthguard.git
cd healthguard
yarn install

# Start PostgreSQL (skip if you already have one locally)
docker run -d \
  -e POSTGRES_USER=healthguard \
  -e POSTGRES_PASSWORD=healthguard \
  -e POSTGRES_DB=healthguard \
  -p 5432:5432 \
  postgres:16

# Start all services (Collector + Dashboard + Demo)
yarn dev:local

Local URLs:

ServiceURL
Dashboardhttp://127.0.0.1:5175
Collectorhttp://127.0.0.1:3100/health
Demohttp://127.0.0.1:5174

Upgrade

bash
cd healthguard
git pull
docker compose down
docker compose up -d --build

Verify the Deployment

  1. Open the Dashboard and register an account.
  2. Create an H5 or mini-program project and copy the appKey.
  3. Integrate the SDK in a demo app and trigger an error.
  4. Return to the Dashboard and confirm the event is aggregated into an Issue.

Released under the MIT License.