Skip to content

Architect a real-time activity feed using SSE/WebSockets to replace static activity log polling #301

Description

@Lakes41

Difficulty: Expert
Type: feature

Background
The /activity route currently displays a static, mock-backed activity/audit log with (presumably) no live-update mechanism, which will not reflect real guild events as they happen once a real backend exists.

Problem
Admins monitoring guild activity have no way to see new events (member joins, pass changes) without manually refreshing, and there is no architecture in place for pushing live updates to connected dashboard clients.

Expected outcome
The Activity page (and a small live-activity widget on the main Dashboard) updates in real time as new events occur, using Server-Sent Events or WebSockets, with graceful reconnection and backpressure handling so a burst of events doesn't overwhelm the client.

Suggested implementation

  • Choose a transport (SSE is simpler and fits one-directional server-to-client event streams well for this use case; document the tradeoff vs. WebSockets in the design doc).
  • Implement a Next.js route handler that streams events (initially backed by an in-memory event emitter simulating real guild events, structured to be replaced by a real message bus/queue later).
  • On the client, use EventSource (or a small WS client) with automatic reconnect-with-backoff, and a client-side bounded queue/buffer so a burst of incoming events doesn't cause unbounded re-renders (batch UI updates, e.g., via requestAnimationFrame or a small windowed buffer).
  • Add a visible connection-status indicator (live/reconnecting/offline) on the Activity page.
  • Write a short design doc in docs/ covering transport choice, backpressure strategy, and how this integrates with the future webhook dispatch system.

Acceptance criteria

  • New events appear on the Activity page without a manual refresh
  • Client reconnects automatically after a simulated dropped connection
  • A burst of many events in a short window does not freeze or lag the UI
  • Connection status is visibly surfaced to the user
  • Design doc added to docs/

Likely affected files/directories

  • apps/dashboard/app/activity/
  • apps/dashboard/app/api/ (new streaming route handler)
  • apps/dashboard/lib/mock-data.ts
  • docs/

Metadata

Metadata

Assignees

No one assigned

    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 rewardsexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingfeatureNew 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