siglabweb

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

README

GopherTrunk Signal Lab (web)

Standalone, offline signal-analysis web console. It talks to the /api/v1/siglab/* REST API (see internal/api/handlers_siglab.go) and runs entirely in the browser — no Node.js at runtime. The built bundle is embedded into the gophertrunk binary (web/siglab/embed.go) and served by:

  • gophertrunk siglab serve — a self-contained offline server (default 127.0.0.1:8099), and
  • the daemon, which also mounts the same API routes.

What it does

Parity with the siglab CLI/TUI plus visualization and comparison:

  • Upload a raw IQ capture (u8/f32), synthesize an idealized/impaired one (the gen surface: SNR, carrier offset/drift, multipath, DC, I/Q imbalance), or capture from a live tuner when the console is served by a running daemon with an SDR — record a fixed-length raw-IQ capture, stage it for immediate analysis, and download the raw .cfile (the capture surface).
  • Configure and run the engine (protocol, sample rate, tune, auto-tune, conjugate, IQ-correct, P25 deep knobs) with a live SSE event stream.
  • Identify the protocol of an unknown capture (ranked candidates).
  • A rich results dashboard: symbol histogram, constellation, PSD, spectrogram/waterfall, eye diagram, sync-landscape heatmap, receiver-state series, grants, and event timeline.
  • Compare multiple analyzed captures — overlay their power spectra and diff their metrics — against each other or a synthesized idealized reference.
  • Export results (JSON/JSONL/YAML/CSV) via the engine's own serializers.

Libraries

  • Chart.js + D3 — histograms, line/series, constellation, eye diagram (always in the initial chunk).
  • Plotly.js — spectrogram/waterfall and sync-landscape heatmaps (lazy-loaded chunk).
  • TensorFlow.js — numpy-like array/FFT math for the PSD and spectrogram (lazy-loaded chunk).
  • stdlib (@stdlib/stats-base-*) — SciPy-like summary statistics; with the Hann window in src/dsp/stats.ts.
  • Observable Plot — available for alternate statistical plots.

Heavy libraries are code-split via manualChunks and dynamic import(), so the initial download stays small while the offline embed still ships everything.

Develop

# terminal 1 — backend
gophertrunk siglab serve            # API + (stale) SPA on :8099

# terminal 2 — Vite dev server with HMR, proxying /api to :8099
make siglab-web-dev                 # http://127.0.0.1:5273

# build + embed into the binary
make siglab-web-build               # → web/siglab/dist
make build                          # binary embeds the bundle

# tests / typecheck
make siglab-web-test
cd web/siglab && npm run typecheck

Requires Node.js (npm 9+). The bundle fetches no CDN assets and runs fully offline.

Documentation

Overview

Package siglabweb embeds the built standalone Signal Lab SPA so the gophertrunk binary can serve the offline signal-analysis console (via `gophertrunk siglab serve`, and from the daemon) without a sibling source tree. Build the SPA with `make siglab-web-build` (or `cd web/siglab && npm run build`) before `go build`; the embed picks up everything under `dist/` automatically.

When `dist/` is empty (fresh checkout, dev build with no build yet) the embed contains only the `.gitkeep` sentinel and HasAssets reports false; the serve command then prints an explanatory message instead of a blank page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assets

func Assets() fs.FS

Assets returns the embed.FS sub-tree rooted at `dist`, suitable for http.FileServerFS / the api package's WebAssets option.

func HasAssets

func HasAssets() bool

HasAssets returns true when the embed contains a real build (index.html).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL