Read Project Technical Document
Screen.Recording.2025-04-27.at.12.58.49.PM.mov
This project has three parts:
- Frontend → Vite + React
- Backend → NestJS (Node.js)
- SignalR Hub → .NET 8
Follow these steps to set up and run everything locally.
git clone https://github.com/CodeAddictx10/nestjs-with-signalR.git
cd nestjs-with-signalR
Location: signalr/
If you don't have .NET installed, install it first:
- Go to https://dotnet.microsoft.com/download
- Download and install the .NET 8 SDK.
cd ../signalr
dotnet restore
dotnet run
Location: backend/
cd ../backend
yarn install
cp .env.example .env
- Update the
SIGNALR_SERVER_URL
value to the url the signalR is running on - Set the
REAL_TIME_MODE
value tosignalr
yarn run start:dev
The backend API will start, usually at http://localhost:4444.
Location: frontend/
cd frontend
yarn install
cp .env.example .env
- Update the
VITE_SIGNALR_SERVER_URL
value to the url of the signalR server - Update the
VITE_BACKEND_SERVER_URL
value to the url of the backend server - Set the
REAL_TIME_MODE
value tosignalr
yarn run dev
The React app will start, usually at http://localhost:5173.
By now, the app should be running successfully, if you navigate to the frontend URL - you should see something like this:

- CORS Error on the frontend app when connecting to signalR server: This is mostly caused when the frontend url is not included in the origins set in the signalr/Program.cs on line 12. Add the frontend url and re run the server again.
- CORS Error on the frontend app when connecting to backend server: This is also caused when the frontend url is not included in the origin set in server/main.ts on line 8. Add the frontend url and re run the server again.
This application also has a socket.io implementation.
To use socket.io for the real time communication, kindly follow this step
- Update the
REAL_TIME_MODE
value tosocketio
and restart the server
- Update the
REAL_TIME_MODE
value tosocketio
and restart the server - Refresh the browser for the update to take effect