Phase 3: Svelte 5 UI skeleton
Svelte 5 + Vite + TypeScript dashboard that consumes kamado-api over REST for the first paint and then subscribes to /api/ws for live updates. Zero runtime deps beyond svelte itself; plain CSS, no component library. Layout: - Header with brand, WebSocket status badge, chain + height - PoolOverview: hashrate (1m/5m/1h/24h), miner count, network hashrate + diff, pool share (ppb), expected time to block, uptime - BlocksTable: recent solves from the in-memory ring (will be SQLite-backed in Phase 2b.5) - BestShares: top-10 workers by bestever, falling back to bestdiff when the ckpool patch isn't present - MinersTable: joined view of stratum clients and workers with user-agent-based hardware detection (Bitaxe, NerdQAxe, Antminer, ...), hashrate, best-round, best-ever, last share State is a single $state() snapshot store in svelte-runes form; components read from it via $derived. The store does one initial REST snapshot fetch, then owns the WebSocket with exponential backoff reconnects. Vite dev server on :5173 proxies /api and /api/ws to localhost:8080 so you can run `make ui-dev` alongside `make up` in development. Production serving (bundled into the Go binary via embed, behind / on :8080) lands in Phase 4.
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# Kamado Pool — top-level Makefile
|
||||
# ----------------------------------------------------------------------------
|
||||
.PHONY: help ckpool api api-test ckpool-shell up down logs clean
|
||||
.PHONY: help ckpool api api-test ckpool-shell ui ui-dev ui-check up down logs clean
|
||||
|
||||
help:
|
||||
@echo "Kamado Pool targets:"
|
||||
@echo " make ckpool Build the ckpool-solo docker image"
|
||||
@echo " make api Build the kamado-api docker image"
|
||||
@echo " make api-test Run Go tests for kamado-api (requires Go installed)"
|
||||
@echo " make ui Build the Svelte UI to ui/dist (requires node)"
|
||||
@echo " make ui-dev Run the Vite dev server on :5173 with /api proxy"
|
||||
@echo " make ui-check Run svelte-check type diagnostics"
|
||||
@echo " make ckpool-shell Open a shell in the built ckpool image"
|
||||
@echo " make up docker compose up -d --build"
|
||||
@echo " make down docker compose down"
|
||||
@@ -23,6 +26,15 @@ api:
|
||||
api-test:
|
||||
cd api && go test ./... -race
|
||||
|
||||
ui:
|
||||
cd ui && npm install && npm run build
|
||||
|
||||
ui-dev:
|
||||
cd ui && npm install && npm run dev
|
||||
|
||||
ui-check:
|
||||
cd ui && npm install && npm run check
|
||||
|
||||
ckpool-shell: ckpool
|
||||
docker run --rm -it --entrypoint /bin/sh kamado/ckpool:dev
|
||||
|
||||
|
||||
Reference in New Issue
Block a user