feat(stats): switch to aggregate component for O(log n) counts

- Add @convex-dev/aggregate package for efficient aggregation
- Update convex.config.ts with pageViewsByPath, totalPageViews, uniqueVisitors aggregates
- Update recordPageView to insert into aggregate components
- Update getStats to use aggregate counts instead of O(n) table scans
- Add backfillAggregates internal mutation for existing data
- Update prds/howstatsworks.md with old vs new comparison
- Update changelog.md with v1.11.0 entry
- Update files.md with aggregate component info
This commit is contained in:
Wayne Sutton
2025-12-20 14:39:53 -08:00
parent ae3d69c7b0
commit 8d28e36458
8 changed files with 915 additions and 58 deletions

View File

@@ -17,6 +17,7 @@
"deploy:prod": "npx convex deploy && npm run sync:prod"
},
"dependencies": {
"@convex-dev/aggregate": "^0.2.0",
"@mendable/firecrawl-js": "^1.21.1",
"@phosphor-icons/react": "^2.1.10",
"@radix-ui/react-icons": "^1.3.2",