Skip to content

feat(stats): device, browser, and OS attributes - #55

Merged
ralyodio merged 1 commit into
masterfrom
feat/stats-device-attributes
Jun 17, 2026
Merged

ralyodio merged 1 commit into
masterfrom
feat/stats-device-attributes

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Summary

Adds device type / browser / OS attributes to project stats, following the same daily-rollup pattern as the existing source / event / geo dimensions. Coarse buckets are derived server-side from the request User-Agent; no raw User-Agent strings are stored — only aggregate counts — keeping the cookieless, PII-light design intact.

Changes

  • lib/tracker/device.ts — dependency-free UA parser → { deviceType, browser, os }
  • supabase/migrations/20260617120000_tracker_device_rollups.sql — tracker_device_daily_stats table with owner + member select RLS (already applied to the prod DB)
  • app/api/track/route.ts — UPSERT-increments the device rollup alongside geo
  • stats page + TrackerAnalytics — new Devices / Browsers / Operating systems sections
  • docs/statistics — note device tracking
  • tests/contract/tracker-device.test.ts — parser coverage

Verification

  • tsc --noEmit clean
  • new device tests (7) + existing tracker tests (stats-js, track-cors, tracker-geo) pass

🤖 Generated with Claude Code

Derive coarse device type / browser / OS buckets from the request
User-Agent and roll them up daily, mirroring the existing source /
event / geo dimensions. No raw User-Agent strings are stored — only
aggregate counts — keeping the cookieless, PII-light design intact.

- lib/tracker/device.ts: dependency-free UA parser
- migration: tracker_device_daily_stats (+ owner/member RLS)
- /api/track: UPSERT device rollup alongside geo
- stats page + TrackerAnalytics: Devices/Browsers/OS sections
- docs/statistics: note device tracking
- tests for the parser

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit eb5a798 into master Jun 17, 2026
8 checks 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