Background
There is no way to push real-time events from server to browser. Modules cannot do live notifications, live dashboards, presence, or collaborative UI. Laravel Broadcasting + Echo solves this with private/presence channels and event-driven push (Pusher / Reverb / Soketi).
Motivation
Design sketch
Server: SignalR hub BroadcastHub mounted at /hub/broadcast.
public interface IBroadcaster
{
Task ToChannelAsync(string channel, string @event, object payload, CancellationToken ct);
Task ToUserAsync(string userId, string @event, object payload, CancellationToken ct);
Task ToTenantAsync(string tenantId, string @event, object payload, CancellationToken ct);
}
[BroadcastEvent("orders.created")]
public sealed record OrderCreatedEvent(Guid OrderId, Guid TenantId) : IBroadcastEvent
{
public string Channel(IBroadcastContext ctx) => $"tenants.{TenantId}.orders";
}
- Bridge from
IEventBus: any event marked [BroadcastEvent] is automatically forwarded to subscribers
- Channel authorization:
IBroadcastChannelAuthorizer per channel (hub callback validates ClaimsPrincipal before allowing subscription)
- Presence channels: server tracks members, broadcasts join/leave
- Private channels: same as public, but require explicit auth
Client (packages/echo):
import { useChannel } from '@simplemodule/echo';
useChannel('tenants.123.orders').on('orders.created', (e) => { ... });
- Built on
@microsoft/signalr; auto-reconnect; backoff; auth via current Inertia session cookie
Acceptance criteria
References
Background
There is no way to push real-time events from server to browser. Modules cannot do live notifications, live dashboards, presence, or collaborative UI. Laravel Broadcasting + Echo solves this with private/presence channels and event-driven push (Pusher / Reverb / Soketi).
Motivation
Design sketch
Server: SignalR hub
BroadcastHubmounted at/hub/broadcast.IEventBus: any event marked[BroadcastEvent]is automatically forwarded to subscribersIBroadcastChannelAuthorizerper channel (hub callback validatesClaimsPrincipalbefore allowing subscription)Client (
packages/echo):@microsoft/signalr; auto-reconnect; backoff; auth via current Inertia session cookieAcceptance criteria
IBroadcaster+BroadcastHubin framework[BroadcastEvent]discovered by source generator; bridge fromIEventBus@simplemodule/echopackage withuseChannel/useEventhooksReferences