jetstream v2 in zig stream.waow.tech
stream strata
1 folder · 22 files

README.md

strata #

The public archive map at https://stream.waow.tech/strata/: namespaces as spheres sized by archived event counts, with search, profile avatars, and canvas pan/zoom. It is a static page; counts come from one summary snapshot of Strata taken at deploy time, so visitors make no archive, summary, or profile API requests.

service #

The Cloudflare API, D1 schema, R2 archive writer, and drain scripts live in service/. The service was imported with its Git history from the former local zat.dev/strata repository. This directory owns both the map and its backing service; they deploy independently.

cd strata/service
npm ci
npm run check
npm run deploy

The Worker remains strata at strata.zat.dev, with the existing D1 database, R2 buckets, and secrets. Do not run schema migrations for a source move. The hourly ingestion flow stays in my-prefect-server/flows/strata.py and continues to use the same API. The deployed drain stays at /opt/strata on the Stream host: its binaries, progress file, and work directory are runtime state, not repository files. Deploy script updates there without replacing that state. See service architecture.

deploy the map #

cd strata && bun install     # once: pinned esbuild and @atcute/lexicons
just strata                  # from the repo root

scripts/deploy-strata-preview fetches the snapshot, bundles app.js with d3 into one hashed script, writes gzip sidecars, uploads a release directory, and atomically switches the site/strata symlink on the host. See docs/deploying.md for the route, caching, and rollback. --output-dir <dir> builds without publishing.

local #

uv run strata/server.py serves http://127.0.0.1:4179 with a live /api/ backed by Strata and, for historical sampling, the archive key from the sops store. The key stays in the server process; the loopback server rejects other hosts and origins.

data and generated files #

  • *-parser.js are bundled from *-schema.js; bun run parsers rebuilds all three.
  • identity-catalog.json maps namespaces to Bluesky profiles: python3 strata/refresh-identities.py (bounded batches, stops on HTTP errors).
  • storage-report.json compares archive storage: uv run strata/inspect-storage.py (reads listings and indexes only).

Neither refresh runs on deploy.

memory #

Avatars decode at their natural size. Spheres and list swatches up to 128 px use Bluesky's 128 px avatar_thumbnail; only larger spheres load the 1000 px image. With the full image everywhere the page peaked above 700 MB in Mobile Safari and got pages embedding it (after hours' TV) killed.