Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SignalR for Blazor Demo

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

Requirements

  • .NET SDK 10 (project targets net10.0)
  • Node.js (LTS) — required only for the Playwright tests

Running the app

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.

Running the Playwright tests

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.

About

Code for our SignalR Internal Lunch-n-Learn

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages