A set of small Blazor Server demos showing the core SignalR patterns:
| Demo | Route | Hub | Pattern |
|---|---|---|---|
| Server Time | /server-time |
TimeHub |
Request/response return value + broadcast to other clients |
| Real-Time Chat | /chat |
ChatHub |
Broadcast to all clients |
| Notification Center | /notifications |
NotificationHub |
Groups (per-user delivery) + background-service push + auto-assigned user IDs |
| Live Price Stream | /prices |
MarketDataHub |
Streaming from the server (ChannelReader) |
| Collaborative Editor | /editor |
DocumentHub |
Groups with per-document isolation |
- .NET SDK 10 (project targets
net10.0) - Node.js (LTS) — required only for the Playwright tests
From the src folder:
cd src
dotnet run
Then open https://localhost:7222 (the HTTPS profile also exposes http://localhost:5228). Most demos are best seen with two browser windows open to the same page. On the Notification Center, each window is automatically assigned the next sequential user id (user1, user2, ...) as soon as it connects.
The tests live in tests/ and cover all five demos end to end (including the collaborative editor's group isolation). The Playwright webServer config starts the app automatically before the suite runs and shuts it down afterward.
First-time setup:
cd tests
npm install
npx playwright install chromium
Then run the suite:
npm test
Requirements for the tests are the .NET SDK (above), Node.js/npm, and the Playwright Chromium browser (installed by npx playwright install chromium). The tests assume the app can bind to http://localhost:5228, which it does by default; see tests/playwright.config.js if you need to change that.