pgflow/demo at main · agoodway/pgflow · GitHub
Skip to content

Latest commit

 

History

History

demo

README.md

PgFlow Demo

A Phoenix LiveView application that demonstrates PgFlow with a real-time article processing workflow.

fetch_article → convert_to_markdown → summarize        → publish
                                    ↘ extract_keywords ↗

Setup

# 1. Start database (from root pgflow directory)
cd ..
docker compose up -d
cd demo

# 2. Install dependencies
mix deps.get

# 3. Create database and run committed migrations
mix ecto.create
mix ecto.migrate

# 4. Setup assets
mix assets.setup

# 5. Configure your LLM API key (see "LLM configuration" below)
cp .env.sample .env
$EDITOR .env

# 6. Run the server (or `pgflow start` from the repo root for hivemind + docker)
mix phx.server

The demo keeps its historical committed migrations for Postgres extensions, pgmq, pgflow setup, flow/job compilation, and dashboard upgrades. Do not regenerate duplicate setup or definition migrations on existing databases. The committed upgrade_pgflow_upstream_alignment wrapper advances core V02, helpers V05, and dashboard V04; add_pgflow_helpers_v06 then adds stalled-task escalation and the pgflow.step_progress view.

On fresh databases, mix ecto.migrate replays the full chain. On existing installations, Ecto runs only the pending migrations.

Scenario verification (release gate)

Executable scenarios are documented in docs/SCENARIOS.md. Baseline verification uses the same ScenarioRunner as the LiveView UI and requires no network or LLM credentials:

MIX_ENV=test mix pgflow_demo.verify_scenarios

Article/LLM integration is opt-in (--include-llm) and never required for CI.

Local production verification

The demo temporarily uses {:pgflow, path: ".."} in every Mix environment while the 0.5.0 release is being tuned. Production-mode verification must run from the demo directory with the parent checkout available:

MIX_ENV=prod mix compile --warnings-as-errors

Production refuses to boot unless its PgFlow dependency includes core V02 and helpers V06. The demo-only Docker context contains no parent checkout, so its image build cannot resolve the temporary path dependency. Include the parent checkout in that context or return to a Hex dependency after publication.

Release acceptance commands

From demo/:

mix precommit
mix assets.build
MIX_ENV=test mix pgflow_demo.verify_scenarios
MIX_ENV=prod mix compile --warnings-as-errors

LLM configuration

The summarize and extract_keywords steps call DeepSeek V3.2 on Fireworks AI through ReqLLM by default.

  1. Get a key at https://fireworks.ai/account/api-keys (looks like fw_...).
  2. cp .env.sample .env and set AI_API_KEY=fw_....

.env is gitignored. runtime.exs loads it via dotenvy.