git clone https://github.com/manolo/pyxflow.git
cd pyxflow
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
playwright install chromiumThis installs everything needed for development: the project in editable mode, unit tests (pytest), UI tests (Playwright), and slide PDF export (Pillow, pyyaml).
python -m demo # http://localhost:8088
python -m demo --dev # hot-reload on file changes
python -m demo --debug # verbose protocol logging# Unit tests (default)
pytest
# All tests -- unit + UI (auto-starts server if needed)
pytest --all
# Specific test file
pytest tests/unit/test_rpc_events.py -vUI integration tests (Playwright is installed with .[dev]):
# Run UI tests only (auto-starts the server if needed)
pytest tests/ui/
# With visible browser
pytest tests/ui/ --headedUI tests are in tests/ui/ and excluded from the default pytest run. Use pytest --all to run everything in one go. They use a shared browser session with SPA navigation across 29 test views in tests/views/, each backed by a TestMainLayout with a menu sidebar. The test server auto-starts via python -m tests.
PyXFlow ships with a pre-built Vaadin frontend bundle at src/pyxflow/bundle/. This is the optimized version (code-split into lazy-loaded chunks) so the browser only downloads what it needs.
In normal development you do not need to run pyxflow bundle -- the committed bundle is ready to use.
You must regenerate and commit the bundle when:
- Upgrading the Vaadin version in
pyproject.toml(vaadin-version/flow-version) - Adding a new component with
_v_fqcn(only needed with--build, the pre-built JAR already includes all components)
# Regenerate from Maven Central JARs (fast, seconds)
pyxflow bundle --optimized
# Verify it works
python -m demo # check http://localhost:8088
# Commit the updated bundle
git add src/pyxflow/bundle/
git commit -m "Update frontend bundle to Vaadin X.Y.Z"See BUNDLE.md for details on optimized vs unoptimized variants and --build mode.
src/pyxflow/
βββ core/ # StateTree, StateNode, Element, Component
βββ components/ # 50+ Vaadin components
βββ data/ # Binder, DataProvider, validators, converters
βββ server/ # HTTP server (aiohttp), UIDL protocol handler
demo/
βββ views/ # Demo views (9 routes)
βββ __main__.py # python -m demo
tests/
βββ views/ # 29 test views with TestMainLayout (independent app)
βββ unit/ # Unit tests (default pytest target)
βββ ui/ # Playwright integration tests (run explicitly)
βββ __main__.py # python -m tests (test server on :8088)
Browser Server (Python)
ββββββββββββββββββββ ββββββββββββββββββββββββ
β Vaadin Web β HTTP/WS β StateTree β
β Components β<----------->β Components (Python) β
β FlowClient.js β (UIDL) β UIDL Handler β
ββββββββββββββββββββ ββββββββββββββββββββββββ
The browser runs the standard Vaadin frontend (web components + FlowClient.js). The Python server maintains a state tree and communicates changes via the UIDL protocol over HTTP, with optional WebSocket for push.
