This repository contains a simple frontend app and a mock WebSocket server to demonstrate a high-performance Angular real-time dashboard.
- WebSocket-based simulated live feed (mock server included)
- RxJS-based streaming with buffering (scan), deduping, and shareReplay
OnPushchange detection andtrackByusage- Chart integration example component
- Table component with
trackByfor efficient rendering - Pause/resume stream toggle and basic controls
- Install dependencies used by the demo:
npm install
- Run the mock WebSocket server (from the scaffold directory or separately):
By default it listens on
node server.js
ws://localhost:8085and emits sample data every 400ms. - Start the Angular app:
4Open the app (usually at http://localhost:4200) and you should see a simple dashboard streaming simulated market data.
npm start # or ng serve --open
src/app/services/websocket.service.ts- RxJS WebSocket wrapper with retry + shareReplaysrc/app/features/dashboard/dashboard.component.ts|html|css- main dashboard using OnPush and async pipesrc/app/features/dashboard/components/chart/chart.component.ts|html|css- chart displaysrc/app/features/dashboard/components/table/table.component.ts|html|css- lightweight table with trackByserver.js- mock WebSocket server
- This scaffold is meant as a demonstration of architecture and patterns rather than a production-ready app.
- Add unit & E2E tests (Jest/Cypress) and CI pipeline for productionization.
Author: Fabrizzio Lopez