Skip to content

feat(dashboard): public shareable stats page - #19

Merged
lamminpaa merged 1 commit into
mainfrom
feat/public-stats-page
May 17, 2026
Merged

feat(dashboard): public shareable stats page#19
lamminpaa merged 1 commit into
mainfrom
feat/public-stats-page

Conversation

@lamminpaa

Copy link
Copy Markdown
Contributor

Summary

  • Adds /public — a read-only, no-auth Astro page that renders a site's analytics publicly
  • Powered by the existing /public-stats worker endpoint (opt-in via PUBLIC_STATS_SITES)
  • Renders: KPI row (pageviews / visitors / bots blocked), SVG bar chart (daily views), top pages, referrers, countries, devices
  • Shows setup instructions when no query params are present
  • "Powered by Flarelytics" footer for organic reach
  • Closes the public shareable dashboard gap vs Plausible/Fathom/Umami

Share URL format

/public?worker=https://your-worker.workers.dev&site=yoursite.com

Users opt in by setting PUBLIC_STATS_SITES=yoursite.com in wrangler.toml.

Test plan

  • 7 new /public-stats worker tests: missing site, invalid chars, forbidden site, empty allowlist, happy-path stats shape, CF failure → 502, CORS reflection
  • All 191 worker tests pass
  • Dashboard builds cleanly (3 page(s) built)

Adds /public — a read-only, no-auth stats page that anyone can view.
Renders the /public-stats API endpoint (pageviews, visitors, bots blocked,
daily chart, top pages, referrers, countries, devices) in a clean layout
matching the design system.

Share URL format: /public?worker=https://your-worker.workers.dev&site=yoursite.com
Workers must opt in by setting PUBLIC_STATS_SITES=yoursite.com in wrangler.toml.

When no params are present, the page shows setup instructions instead of
an error. Includes "Powered by Flarelytics" footer for organic reach.

Also adds 7 worker tests covering the /public-stats endpoint: missing site
param, invalid characters, forbidden site, empty allowlist, happy-path
stats shape, CF failure → 502, and CORS reflection.
@lamminpaa
lamminpaa merged commit 9aeaac7 into main May 17, 2026
1 check passed
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