A minimal demonstration of Server-Sent Events (SSE) using TypeScript, Express.js, and D3.js. This project showcases real-time data streaming from a server to a web client, visualized through a beautiful, animated line graph.
- Server-Sent Events (SSE) implementation in TypeScript
- Real-time data visualization using D3.js
- Express.js backend with CORS support
- Random data generation at 1-second intervals
- Smooth animations and transitions
-
Install dependencies:
pnpm install
-
Start the SSE server:
pnpm start
-
Start the file server:
pnpm file-server
-
Open
http://localhost:8000
in your browser to see the visualization.
The server generates random data points every second and broadcasts them to all connected clients using SSE. The client-side JavaScript uses D3.js to create a dynamic line graph that updates in real-time as new data arrives.
This project is licensed under the MIT License - see the LICENSE file for details.