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
Likely affected files/directories
apps/dashboard/app/activity/
apps/dashboard/app/api/ (new streaming route handler)
apps/dashboard/lib/mock-data.ts
docs/
Difficulty: Expert
Type: feature
Background
The
/activityroute 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
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., viarequestAnimationFrameor a small windowed buffer).docs/covering transport choice, backpressure strategy, and how this integrates with the future webhook dispatch system.Acceptance criteria
docs/Likely affected files/directories
apps/dashboard/app/activity/apps/dashboard/app/api/(new streaming route handler)apps/dashboard/lib/mock-data.tsdocs/