Topologies
AXIS deploy and dev topologies: Vite+Flask, static PWA, Cloudflare Pages+Worker, offline Pyodide lab, and local Bun sidecar.
This page
Topologies
Concrete process and network shapes for AXIS. Choose a topology; then compose plugins inside it (recipes).
Abstract
| Topology | AXIS | Calc | Live | Library |
|---|---|---|---|---|
| Dev desk | Vite :3000 | Flask :5002 | Binance WS direct | local |
| Static demo | axis_pwa_server :8081 | Flask or remote | venue / mock | local |
| Edge | CF Pages | Worker → Flask | DO fan-out optional | cloud |
| Offline lab | any AXIS | Pyodide | mock-poll | local |
| Dev desk + sidecar | Vite :3000 | Flask :5002 | Bun sidecar :5003 | local |
Topology A — Dev desk
Rendering…
Bring-up
make run
cd frontend && bun install && bun run dev
Notes: Vite may proxy /run; Settings endpoint can still point absolute at :5002. CORS must allow Vite origin.
Topology B — Static PWA + Pro API
Rendering…
cd frontend && bun run build
python3 axis_pwa_server.py
make run # separate process
VPS demo pattern: systemd units for axis-pwa and pynescript-api; ALLOWED_ORIGINS includes AXIS origin.
Topology C — Cloudflare AXIS at the edge
Rendering…
Deploy sketch
axis deploy
# or: cd worker && bun run deploy
cd frontend && bun run build
wrangler pages deploy dist --project-name=axis
Ids: Pages project axis at https://axis.hoox.sh; Worker script worker-axis at https://worker.axis.hoox.sh (ADR-008).
AXIS config:
- Engine
server, endpoint = Worker origin - Storage
cloud, same origin + API key - Stream: direct venue or DO-backed plugin
Topology D — Offline lab
Rendering…
No Flask, no venue. Requires vendored pyodide + wheels on origin once.
Topology E — Git-centric research
Any of A–C for calc/data; storage axis = git. Forges are orthogonal network peers:
AXIS --storage:git--> api.github.com | gitlab
AXIS --engine:server--> Flask/Worker
AXIS --source--> venue or CSV
Topology F — Dev desk + Bun sidecar (CCXT Pro)
For users who want authenticated WS feeds from any CCXT-supported exchange without running Flask. The sidecar (packages/datafeed/) mirrors the PYNE datafeed gateway contract.
Rendering…
bun run dev # Vite :3000
bun run dev:datafeed # Bun sidecar :5003
# in separate terminals, or combine in a Procfile
Gateway contract (same as PYNE datafeed):
| Endpoint | Method | Description |
|---|---|---|
/datafeed/ohlcv?exchange=&symbol=&timeframe= | GET | Historical OHLCV |
/datafeed/markets?exchange= | GET | Available markets |
/datafeed/watch?exchange=&symbol=&timeframe= | WS | Live bar stream |
/datafeed/session | POST | Store credentials (RAM only) |
/health | GET | Sidecar health |
Notes: Credentials stay in RAM only (never persisted). The sidecar is optional — public venues work without it via direct browser WS.
Port map (defaults)
| Service | Port |
|---|---|
| Vite dev | 3000 |
| Flask Pro API | 5002 |
| Bun datafeed sidecar | 5003 |
| Static PWA server | 8081 |
| Wrangler Worker | 8787 |
Comparison
| Concern | A Dev | B Static | C Edge | D Offline | F Sidecar |
|---|---|---|---|---|---|
| HMR | yes | no | no | n/a | yes |
| PWA SW realism | partial | full | full | full | partial |
| Multi-tenant keys | no | no | yes | no | local only |
| Ops complexity | low | medium | high | low | low |
| Fidelity | high (Flask) | high | high via proxy | engine-dependent | high (CCXT Pro) |
Failure modes by topology
| Topology | Typical break |
|---|---|
| A | Flask not running; CORS localhost vs 127.0.0.1 mismatch |
| B | Stale SW; missing dist pyodide assets |
| C | Unbound KV/D1; wrong project name; EXTERNAL_BACKEND down |
| D | First visit offline; SPA fallback for wheels |
Internals
| Path | Role |
|---|---|
vite.config.ts | Dev/build |
axis_pwa_server.py | Static host |
worker/wrangler.toml | CF name + bindings |
packages/cli/ | AXIS CLI (setup / deploy / health) |
worker/README.md | Edge ops |