Skip to main content

WUP Browser Dashboard โ€” FastAPI backend for WUP regression watcher

Project description

wupbro

AI Cost Tracking

PyPI Version Python License AI Cost Human Time Model

  • ๐Ÿค– LLM usage: $0.1500 (1 commits)
  • ๐Ÿ‘ค Human dev: ~$200 (2.0h @ $100/h, 30min dedup)

Generated on 2026-04-29 using openrouter/qwen/qwen3-coder-next


FastAPI backend + minimal HTML dashboard for the WUP regression watcher.

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   POST /events    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  WUP agent (shell)   โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ  โ”‚  wupbro (FastAPI)    โ”‚
โ”‚  - file watcher      โ”‚                   โ”‚  - /events (sink)    โ”‚
โ”‚  - testql runner     โ”‚                   โ”‚  - /drivers/*        โ”‚
โ”‚  - visual diff       โ”‚                   โ”‚  - /dashboard (UI)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                      โ”‚
                                                      โ–ผ
                                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                            โ”‚ Browser UI      โ”‚
                                            โ”‚ (auto-refresh)  โ”‚
                                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Endpoints

Path Method Purpose
/events POST Receive event from a WUP agent
/events GET List recent events (filter by type/service)
/events/stats GET Aggregate counts by type
/events DELETE Clear store (admin/debug)
/drivers/dom-diff/capture POST One-shot Playwright DOM snapshot + diff
/drivers/browserless/screenshot POST Proxy to a browserless/chrome container
/drivers/anomaly/report POST Record numeric anomaly as ANOMALY event
/drivers/health GET Driver capability discovery
/, /dashboard GET HTML dashboard
/healthz GET Liveness probe
/openapi.json, /docs GET OpenAPI spec + Swagger UI

Event types

REGRESSION, PASS, ANOMALY, VISUAL_DIFF, HEALTH_TRANSITION.

Schema (Pydantic):

{
  "type": "REGRESSION",
  "service": "users-web",
  "file": "app/users/routes.py",
  "endpoint": "/api/users",
  "status": "fail",
  "stage": "quick",
  "reason": "TestQL exit code 1",
  "timestamp": 1730000000
}

Extra fields are preserved via model_config = {"extra": "allow"}.

Run

# Install
pip install -e wupbro/

# Dev server (auto-reload)
wupbro --reload --port 8000

# Or directly
uvicorn wupbro.main:app --host 0.0.0.0 --port 8000 --reload

Dashboard: http://localhost:8000/

OpenAPI docs: http://localhost:8000/docs

Configure WUP agent to send events

In your wup.yaml:

web:
  enabled: true
  endpoint: "http://localhost:8000"
  endpoint_env: "WUPBRO_ENDPOINT"   # fallback if endpoint is empty
  timeout_s: 2.0                     # short โ€” must not block watcher
  api_key: ""                        # optional bearer token

Or via environment variable:

export WUPBRO_ENDPOINT=http://localhost:8000
wup watch . --mode testql

The agent will POST events fire-and-forget on:

  • service health transitions (up โ†” down)
  • regressions (when TestQL fails)
  • visual DOM diffs (when significant changes detected)

Browserless integration

docker run -d --name browserless -p 3000:3000 browserless/chrome
export BROWSERLESS_URL=http://localhost:3000
wupbro

Then:

curl -X POST http://localhost:8000/drivers/browserless/screenshot \
  -H "Content-Type: application/json" \
  -d '{"url": "http://example.com", "full_page": true}'

Storage

Events are kept in an in-memory ring buffer (capacity 1000) and persisted to .wupbro/events.jsonl for restart durability.

Tests

PYTHONPATH=wupbro python3 -m pytest wupbro/tests/ -v

17 tests covering events router, drivers (anomaly, browserless, dom-diff, health), dashboard HTML, OpenAPI schema.

License

Licensed under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wupbro-0.1.11.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wupbro-0.1.11-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file wupbro-0.1.11.tar.gz.

File metadata

  • Download URL: wupbro-0.1.11.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wupbro-0.1.11.tar.gz
Algorithm Hash digest
SHA256 906729f44b24d9b265077b2403c62bd58956550d9ea008a575ca30d8bf1f6b59
MD5 9b6a3d84aa4a72b0473e38ca0ebf5ba8
BLAKE2b-256 7df951ae2b7a6db993d343b48b24d434713f8a8ae965659722806feb9cb84394

See more details on using hashes here.

File details

Details for the file wupbro-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: wupbro-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for wupbro-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 35c553d134fe7dfa5aa48fc77eba71c87eae4e1bf93d28ebb451568c1e83debf
MD5 08a6d1aac16b06308aa9374d0abeb050
BLAKE2b-256 68ce26271953f2797d18496e56eaa75cd9da245dfbcc4418f99d43051172a91f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page