Skip to content

Build a scalable, filterable audit log system with a structured event schema #297

Description

@Lakes41

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

  • AuditEvent schema defined and shared via packages/integration-client
  • Combined filters (actor + guild + action + date range) work correctly
  • Cursor-based pagination implemented and documented
  • Migration notes for a real datastore included in docs/

Likely affected files/directories

  • apps/dashboard/app/activity/
  • apps/dashboard/lib/mock-data.ts
  • packages/integration-client/
  • docs/

Metadata

Metadata

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortfeatureNew feature, enhancement, or functional additionperformancePerformance optimization or latency/throughput improvement work

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions