Skip to content

feat: polished first-party analytics SDKs + Harbor demo - #2

Closed
altitudems wants to merge 10 commits into
mainfrom
feat/first-party-analytics
Closed

feat: polished first-party analytics SDKs + Harbor demo#2
altitudems wants to merge 10 commits into
mainfrom
feat/first-party-analytics

Conversation

@altitudems

Copy link
Copy Markdown
Owner

Summary

First-party analytics monorepo: browser SDK, pluggable ingest server, and a same-origin Harbor demo.

Packages

  • @altitudems/analytics — SPA-aware client (pageviews, UTMs, batch + beacon, identify/reset)
  • @altitudems/analytics-servercreateIngestHandler / Hono helpers + MemoryStore for demos
    • seedHarborDemo + startHarborTraffic for out-of-the-box busy data
    • Demo /stream SSE (snapshot + live batches)

Demo (pnpm dev)

Surface URL
Marketing http://localhost:5173
App http://localhost:5173/app.html
Dashboard (Lit) http://localhost:5173/dashboard.html
API http://localhost:8787

Open the dashboard first — it boots with seeded history and an SSE live feed (synthetic traffic keeps ticking; real marketing/app events stream in too). Falls back to polling if SSE drops. Set HARBOR_LIVE_TRAFFIC=0 to disable the generator.

Tooling is Vite+ (vp check / vp test / vp pack).

Open in Web Open in Cursor 

David Hayes added 10 commits July 15, 2026 23:22
Move the analytics library into packages/analytics with Vite library
builds, Vitest, ESLint 9 flat config, and TypeScript 5.9. Refresh CI
and release workflows for the workspace layout and rename the package
scope to @altitudems/analytics.
Drop legacy lint/format/build tooling in favor of Biome for
lint+format and tsdown (Rolldown) for the library build. Vitest 4
covers tests; CI scripts updated accordingly.
Replace uuid, bowser, and @medv/finder with crypto.randomUUID,
Client Hints + UA parsing, and a small CSS selector helper. Swap
jsdom for happy-dom so the published package has zero dependencies.
Replace Biome with Vite+ so validation uses `vp check` and
`vp fmt` (Oxlint/Oxfmt). Library builds go through `vp pack`,
tests through `vp test`, and CI runs the vp workflow.
Replace the old in-memory event client with a thin product/marketing
SDK: capture/page/identify, first-touch UTMs, batched ingest payload,
beacon flush on unload, and opt-out. Zero runtime dependencies.
Add a pluggable server package (store interface, MemoryStore, fetch
ingest handler, Hono helpers) plus example API, marketing site, and
fake app that demonstrate first-party capture end to end.
Harden the browser SDK (SPA pageviews, sessions, transport backoff,
destroy, deep ingest validation) and server ingest (limits, write-key
headers, richer stats). Replace split examples with one Vite demo so
marketing → app shares identity, plus a calmer Harbor marketing page.
Out-of-the-box dashboard at /dashboard.html with Lit web components
polling /stats and /events for live tiles, rankings, and an event feed.
Boot the API with Harbor seed history, push inserts over /stream,
and keep synthetic traffic flowing so the Lit dashboard looks alive.
@altitudems altitudems closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant