You don’t need React, Vue, or Svelte to build a snappy, modern-feeling web app. By combining Server-Sent Events (SSE) for efficient one-way real-time updates with targeted partial DOM replacement , you can deliver that smooth single-page experience — without the framework bundle, the hydration penalty, or the complex client-side state management.
This architecture follows a clean, traceable flow:
Browser → API → Action → Internal Event Hub → SSE Server → Browser → Patch DOM
Let’s walk through it end-to-end.
🏗️ The Architecture, Layer by Layer
1️⃣ Browser — Connect Once, Stay Connected
The browser establishes a single long-lived SSE connection on page load. User interactions send lightweight JSON over standard HTTP — no WebSocket handshake complexity. When events arrive, only the relevant parts of the page update.
// Establish SSE connection once — persists across updates const eventSource = new EventSource ( '/api/events/stream' ) ;
// Handle incoming updates eventSource .…