chmonitorchmonitor

Guide

Local development

Run the chmonitor dashboard from source with pnpm and TanStack Start to develop and test changes before deploying.

1 min read

Run the dashboard from source to develop or test before deploy. The app is apps/dashboard (TanStack Start). Set CHM_* once; client VITE_* is derived.

Loading diagram…

Steps

Clone the repo

git clone https://github.com/chmonitor/chmonitor
cd chmonitor

Install dependencies

The project uses pnpm (pnpm@10.18.0).

pnpm install

Create .env.local

In apps/dashboard/:

.env.example
.env.local
CLICKHOUSE_HOST=http://localhost:8123
CLICKHOUSE_USER=monitoring
CLICKHOUSE_PASSWORD=your-password

Never put secrets in VITE_* variables

Set CHM_*. Client vars are inlined at build time.

Configure ClickHouse hosts

Comma-separated lists configure multiple hosts; each hostId maps positionally.

CLICKHOUSE_HOST=http://localhost:8123
CLICKHOUSE_USER=monitoring
CLICKHOUSE_PASSWORD=your-password
CLICKHOUSE_HOST=http://ch-1:8123,http://ch-2:8123,http://ch-3:8123
CLICKHOUSE_USER=monitoring,monitoring,monitoring
CLICKHOUSE_PASSWORD=pass-1,pass-2,pass-3
CLICKHOUSE_NAME=ch-1,ch-2,ch-3
VariablePurpose
CLICKHOUSE_HOSTOne or more URLs (http:///https://), optionally host:port.
CLICKHOUSE_USERComma-separated user(s); a single value applies to every host.
CLICKHOUSE_PASSWORDComma-separated password(s); a single value applies to every host.
CLICKHOUSE_NAMEDisplay names for the host switcher.
CLICKHOUSE_DATABASEDefault database (default system).
CLICKHOUSE_MAX_EXECUTION_TIMEQuery timeout in seconds (default 60).
CLICKHOUSE_EXCLUDE_USER_DEFAULTHide the default user from the UI when set.

Host 0 is the first CLICKHOUSE_HOST entry (?host=0). The user needs the grants in the next step.

Configure Postgres hosts (optional)

Postgres is a beta source engine — off by default.

Start the dev server

cd apps/dashboard
pnpm run dev

Open http://localhost:3000.

Verify

The dashboard hot-reloads as you edit. Overview should show live metrics from ClickHouse.

Troubleshooting

On this page