Difficulty: Advanced
Type: feature
Background
The /activity route currently renders an activity/audit log from mock data, but the README gives no indication of a formal event schema, pagination strategy, or filtering model suited to a growing, multi-guild audit trail.
Problem
As guilds, members, and passes scale, an unstructured or flat activity log won't support efficient filtering by actor, guild, action type, or date range, and lacks a stable schema that other parts of the system (e.g., webhooks) could reuse.
Expected outcome
A structured AuditEvent schema (actor, guildId, targetType, targetId, action, metadata, timestamp) backs the activity log, with server-side-style pagination and combinable filters (actor, guild, action type, date range), designed to later back onto a real datastore.
Suggested implementation
- Define the
AuditEvent type in packages/integration-client, reusable by both the dashboard and the future webhook dispatch system.
- Refactor
apps/dashboard/lib/mock-data.ts activity entries to conform to the new schema.
- Implement a query function supporting combined filters + cursor-based pagination (even against the in-memory array, structured as if it were a DB query).
- Update the Activity page UI to expose filter controls (actor, guild, action type, date range) wired to the query function.
- Document the schema and intended indexing strategy (e.g., composite index on guildId+timestamp) for a future real database.
Acceptance criteria
Likely affected files/directories
apps/dashboard/app/activity/
apps/dashboard/lib/mock-data.ts
packages/integration-client/
docs/
Difficulty: Advanced
Type: feature
Background
The
/activityroute currently renders an activity/audit log from mock data, but the README gives no indication of a formal event schema, pagination strategy, or filtering model suited to a growing, multi-guild audit trail.Problem
As guilds, members, and passes scale, an unstructured or flat activity log won't support efficient filtering by actor, guild, action type, or date range, and lacks a stable schema that other parts of the system (e.g., webhooks) could reuse.
Expected outcome
A structured
AuditEventschema (actor, guildId, targetType, targetId, action, metadata, timestamp) backs the activity log, with server-side-style pagination and combinable filters (actor, guild, action type, date range), designed to later back onto a real datastore.Suggested implementation
AuditEventtype inpackages/integration-client, reusable by both the dashboard and the future webhook dispatch system.apps/dashboard/lib/mock-data.tsactivity entries to conform to the new schema.Acceptance criteria
AuditEventschema defined and shared viapackages/integration-clientdocs/Likely affected files/directories
apps/dashboard/app/activity/apps/dashboard/lib/mock-data.tspackages/integration-client/docs/