From 8683ee71f38ef5964daf7422f4f4b33f410b108f Mon Sep 17 00:00:00 2001 From: stroblme Date: Thu, 20 Aug 2026 12:15:18 +0200 Subject: [PATCH] Add the hosted-demo seed: a house panel over three flows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `scripts/seed_demo.py` wipes and recreates one persistent demo — `home`, `home_history` and `pv_model`, plus a `demo` dashboard carrying all fifteen widget types across three sections. Operational script for the hosted instance only: `make seed-hosted-demo`, with `API_URL` selecting which one. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01HTsT1isxUjw5gtkJk8WhuA --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 30ab93f..3b4b937 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # The workspace root delegates to these (see ../Makefile). .PHONY: dev-utils dev dev-local up down update install dev-backend dev-frontend \ - generate-client seed-example seed-demo test test-backend test-frontend soak bench-startup lint lint-backend \ + generate-client seed-example seed-demo seed-hosted-demo test test-backend test-frontend soak bench-startup lint lint-backend \ lint-frontend umami clean help COMPOSE_ROOT := $(CURDIR) @@ -97,6 +97,20 @@ seed-example: ## Seed the querying-chart example (needs a running stack + Influ seed-demo: ## Seed the training-run example: a batch flow and its dashboard cd backend && uv run python ../scripts/seed_demo_training.py +# Operators of the hosted demo only — NOT part of any deployment, and nothing a +# self-hosted instance needs. It wipes and recreates its three flows and its +# dashboard, so re-running it is how the public demo is reset. +# `uv run` does not read .env, so the credentials are lifted out of it here; +# anything already exported wins, which is how a remote instance is targeted: +# API_URL=https://api.example.com make seed-hosted-demo +seed-hosted-demo: ## Seed the hosted demo panel (operators only; API_URL selects the instance) + @user=$$(grep -E '^FIRST_SUPERUSER=' $(COMPOSE_ROOT)/.env 2>/dev/null | head -1 | cut -d= -f2-); \ + pass=$$(grep -E '^FIRST_SUPERUSER_PASSWORD=' $(COMPOSE_ROOT)/.env 2>/dev/null | head -1 | cut -d= -f2-); \ + cd backend && \ + FIRST_SUPERUSER="$${FIRST_SUPERUSER:-$$user}" \ + FIRST_SUPERUSER_PASSWORD="$${FIRST_SUPERUSER_PASSWORD:-$$pass}" \ + uv run python ../scripts/seed_demo.py + # ── Testing ─────────────────────────────────────────────────────── test: test-backend test-frontend ## Run all tests (backend + frontend)