mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
- 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
17 lines
483 B
TypeScript
17 lines
483 B
TypeScript
import { defineApp } from "convex/server";
|
|
import aggregate from "@convex-dev/aggregate/convex.config.js";
|
|
|
|
const app = defineApp();
|
|
|
|
// Aggregate component for efficient page view counts (O(log n) instead of O(n))
|
|
app.use(aggregate, { name: "pageViewsByPath" });
|
|
|
|
// Aggregate component for total page views count
|
|
app.use(aggregate, { name: "totalPageViews" });
|
|
|
|
// Aggregate component for unique visitors count
|
|
app.use(aggregate, { name: "uniqueVisitors" });
|
|
|
|
export default app;
|
|
|