Skip to content

Commit a218c83

Browse files
committed
docs: Task 69 README + AIRGAP_INSTALL — v2.0 React UI quickstart
- README.md: quickstart now leads with `uvicorn runtime.api:get_app` (backend that also serves the SPA) + `cd web && npm run dev` for the Vite dev path. Streamlit demoted to "legacy / deprecated". Status block calls out v2.0.0-rc1 and points to RELEASE.md + REACT_UI_PARITY.md. - docs/AIRGAP_INSTALL.md: new "v2.0 — React UI in the air-gap payload" section. Describes the build + package_airgap.py flow, the dist/airgap/ layout, and ASR_WEB_DIST env var resolution.
1 parent 079721e commit a218c83

2 files changed

Lines changed: 56 additions & 5 deletions

File tree

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ uv run pytest tests/ -x
3333
# Run the incident-management app via the CLI entrypoint
3434
uv run python -m runtime --config config/incident_management.yaml
3535

36-
# Streamlit UI
36+
# Backend API (serves the React SPA at / when web/dist exists)
37+
uv run uvicorn runtime.api:get_app --factory --port 8000
38+
39+
# React UI (Vite dev server; proxy /api/v1 -> :8000)
40+
cd web && npm ci && npm run dev # http://localhost:5173
41+
42+
# Production: build once, then the backend serves it at http://localhost:8000
43+
cd web && npm run build && cd ..
44+
uv run uvicorn runtime.api:get_app --factory --port 8000
45+
46+
# Legacy Streamlit UI (deprecated in v2; banner inside)
3747
ASR_LOG_LEVEL=INFO uv run streamlit run src/runtime/ui.py --server.port 37777
3848
```
3949

@@ -50,10 +60,16 @@ Set provider keys in `.env` (`OLLAMA_API_KEY`, `OPENROUTER_API_KEY`,
5060
contributor loop: setup, regenerating `dist/`, adding a runtime
5161
module.
5262
- **[`docs/AIRGAP_INSTALL.md`](docs/AIRGAP_INSTALL.md)**
53-
air-gapped / internal-mirror install procedure.
63+
air-gapped / internal-mirror install procedure (includes the v2
64+
React UI air-gap layout).
65+
- **[`docs/RELEASE.md`](docs/RELEASE.md)** — cutting a release
66+
candidate; `npm run build` + `scripts/package_airgap.py` + git tag.
5467

5568
## Status
5669

57-
`main` carries v1.0 → v1.5. v2.0 (React UI replacing the Streamlit
58-
prototype) is the next big move. See `docs/DESIGN.md` § 13 for the
59-
milestone history and § 14 for the pending list.
70+
`main` carries v1.0 → v1.5. **v2.0.0-rc1** ships the React UI
71+
(Vite + React 19 + TS + Tailwind v4 + Radix primitives) in `web/`
72+
which replaces the Streamlit prototype. The legacy Streamlit UI
73+
remains shippable behind a deprecation banner until parity is
74+
verified (`docs/REACT_UI_PARITY.md`). See `docs/DESIGN.md` § 13
75+
for the milestone history.

docs/AIRGAP_INSTALL.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,38 @@ uv lock --check # exit 0 = in sync; non-zero = regenerate with `uv lock`
5151
installs on any host (HARD-02 / CONCERNS C2).
5252
- Ship vendored wheels as a separate tarball if your host has no mirror at
5353
all; populate `~/.cache/uv` (or `UV_CACHE_DIR`) before running step 3.
54+
55+
## v2.0 — React UI in the air-gap payload
56+
57+
The React SPA in `web/` is built ahead of time and shipped as static
58+
assets alongside the Python bundle. The backend serves it from `/`
59+
via `runtime.api_static.mount_static_assets` so there is no separate
60+
Node process on the deploy host.
61+
62+
```bash
63+
# On a host with internet (one time, or each release):
64+
cd web && npm ci && npm run build
65+
cd ..
66+
uv run python scripts/build_single_file.py # framework + app bundles
67+
uv run python scripts/package_airgap.py # composes dist/airgap/
68+
69+
# Ship dist/airgap/ to the air-gap host. Layout:
70+
# dist/airgap/
71+
# app.py # flattened framework + incident-management
72+
# ui.py # legacy Streamlit (deprecation banner)
73+
# web/ # built React SPA (Vite output)
74+
# README.txt
75+
```
76+
77+
On the air-gap host:
78+
79+
```bash
80+
ASR_WEB_DIST=./web \
81+
python -m uvicorn app:get_app --factory --port 8000
82+
# open http://<host>:8000/
83+
```
84+
85+
`ASR_WEB_DIST` is read by `runtime.api_static.mount_static_assets`.
86+
If unset, the backend falls back to `<bundle>/web/dist` (legacy dev
87+
layout). When neither resolves, the SPA mount is skipped silently and
88+
the API still serves on `/api/v1/*`.

0 commit comments

Comments
 (0)