|
Download console/README.md from bryceweiner/fly-trader: direct link, hf CLI and curl.
- Browser
- Download file 2.39 kB
-
https://huggingface.co/bryceweiner/fly-trader/resolve/main/console/README.md
- Command line
-
hf download hf://bryceweiner/fly-trader/console/README.md
-
curl -L -o README.md https://huggingface.co/bryceweiner/fly-trader/resolve/main/console/README.md
2.39 kB
fly-trader console (dashboard source)
The React dashboard that fly-trader ui serves. The built copy is committed in fly_trader/ui/static/console, so an
install runs the console without Node; rebuild it after changing anything here.
cd console
npm ci # once (.npmrc sets legacy-peer-deps for @vitejs/plugin-react's optional peers)
npm run build # typecheck, then write ../fly_trader/ui/static/console
npm test # the formatters and helpers
Develop against a running system
uv run fly-trader ui --observe --port 8599 # a console that hosts no workers (controls are refused)
cd console && npm run dev # http://localhost:5173, proxying /api, /ws and /static/brain to :8599
CONSOLE_URL=http://127.0.0.1:8501 npm run dev proxies to the real console instead (its controls work).
How it fits together
- Topics (reads) are registered in
fly_trader/ui/api/*.pywith@topic("page.panel", every=s). A page subscribes withuseTopic('page.panel', params); the server computes each (topic, params) once for every open tab and pushes it over the WebSocket only when it changed (fly_trader/ui/hub.py). - Actions (writes) are
@action("page.verb")behindPOST /api/action/<name>. In the browser every action goes throughActionButton(or a formModal), which asks for confirmation first; the server enforces the same guards (for example, no reset while the engine runs). - Security: there is no login. The server binds 127.0.0.1, refuses a foreign
Host, and requires theX-Fly-Consoleheader and a same-originOriginon every write and WebSocket (fly_trader/ui/security.py). - Layout and look: Dashtreme's horizontal layout (
src/vendor/dashtreme, a subset of the purchased template, see its README) with the fly-trader brand on top (src/theme). - The brain view (
src/brain) draws the connectome geometry from/static/brain(generated intofly_trader/ui/static/brainon first use) with three.js, bundled.
Pages live in src/pages, shared components in src/components, the fly's inspector and ticker in src/fly.
Charts are ApexCharts, except the trades-by-hour wheel, which is Highcharts' variable-radius pie (highcharts). Highcharts
is free for non-commercial use; commercial use needs a licence from Highsoft (highcharts.com/license).