ruslanmv's picture
Deploy Matrix Context Console
ce45eb0 verified
|
Raw
History Blame Contribute Delete
1.71 kB
# Matrix Context β€” frontend (control plane / admin UI)
The **single source of truth** for the web UI. A self-contained, zero-dependency
operator console (Overview Β· Inspector Β· Ingest Β· Memory Β· Experts Β· Routing Β·
Benchmarks Β· MoC Contract Β· Settings) wired to the live **MoC Contract v1** API.
Used both for native/local runs and as the app inside the Hugging Face Space
(`../hf/`, which builds from this folder β€” the UI is not duplicated).
```
frontend/
β”œβ”€β”€ server.py # launcher: serves app/ + the live /v1 API (reuses the backend), seeds demo data
└── app/ # the SPA (no React/Babel/CDN for logic; fonts from Google Fonts)
β”œβ”€β”€ index.html # shell + matrix-rain canvas
β”œβ”€β”€ styles.css # emerald-glass theme
β”œβ”€β”€ api.js # live /v1 adapter (maps backend shapes for the UI)
β”œβ”€β”€ app.js # the views
└── assets/ # logo
```
## Run (native / local)
```bash
pip install -e ".[dev]" # from the repo root
python frontend/server.py # -> http://127.0.0.1:7860
```
Environment: `HOST` (default `127.0.0.1`), `PORT` (default `7860`),
`MATRIX_CONTEXT_PATH` (default `:memory:`).
## Hugging Face
The Space packaging (Dockerfile + card + deploy) lives in [`../hf/`](../hf) and
builds from this folder. Deploy with `python hf/deploy.py --repo <user>/<space>`.
## How it talks to the backend
The UI calls the same-origin `/v1` surface; the Ingest wizard runs in Compatible
Mode (client-side chunking β†’ `POST /v1/remember`, metadata stored as tags). It is
additive β€” `server.py` imports the published backend and serves the existing
`dispatch`; nothing in the engine is modified.