Infrastructure medium complexity backend
1
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Infrastructure component managing server-sent events (SSE) or 30-second polling fallback to push new feed entries to connected admin clients without full page reload. Integrates with the Next.js API route layer to maintain open SSE connections per organization.

Feature: Activity Feed

feed-live-update-handler

Sources & reasoning

Live updates are an explicit implementation requirement. SSE connection management is an infrastructure concern orthogonal to the query logic in Activity Feed Service, justifying its own component to avoid coupling transport-layer state to business logic.

  • docs/source/likeperson.md · line 184
    Activity oversight, approval workflows, and corrections
  • docs/source/likeperson.md · line 317
    Aktivitetsoversikt og grunnleggende statistikk
  • docs/source/likeperson.md · line 476
    admin-dashboard | Admin Dashboard | Dashboard KPIs, Activity Feed

Responsibilities

  • Maintain SSE connections keyed by organization_id for connected admin clients
  • Broadcast new feed entry events when activities, expenses, or system events are created
  • Fall back to 30-second polling interval when SSE is not supported by the client
  • Clean up stale connections on client disconnect

Interfaces

GET /api/v1/admin/feed/stream (SSE endpoint)
broadcastFeedEvent(orgId, entry: FeedEntry): void
registerConnection(orgId, response): void
removeConnection(orgId, connectionId): void

Relationships

Dependencies (1)

Components this component depends on