This project shows how to build a real-time chat app without WebSockets using Server-Sent Events (SSE) β a native, simpler alternative for pushing server updates to the client.
β No socket errors
β No reconnection logic
β Native HTTP-based stream
Most real-time apps default to WebSockets, but that often introduces:
- Extra libraries on both frontend and backend
- Persistent connections and resource management
- Reconnection edge cases and complexity
- Infrastructure scaling challenges
This project solves that by using Server-Sent Events (SSE) to stream updates from server to client with less overhead and no third-party dependencies β ideal when only the server needs to push updates (e.g., chat, notifications, live logs).
- Real-time message updates using SSE
- Lightweight and works over HTTP/1.1
- Pure JavaScript (no socket libraries)
- Express backend + React frontend
- Client sends a message to the server
- Server processes and resolves it to all connected clients via SSE
- Clients receive updates in real-time through an EventSource stream
- Start the backend (Express + SSE stream endpoint)
- Start the frontend (React + EventSource)
- Type a message β it instantly appears for all connected users
WebSockets are great, but not always necessary. For one-way, real-time updates from server to client, SSE is simpler and more efficient. No need for complex connection handling β just plug and stream.
Built by Joseph Uzuegbu
MIT β free to use, modify, and share.