This repository contains three projects that demonstrate the usage of SignalR in a .NET Core application, along with client examples in JavaScript and Flutter.
The OrderService
project is a .NET Core application that showcases the implementation of a SignalR hub and a REST API. It provides real-time functionality to clients and exposes RESTful endpoints for managing orders.
- .NET Core SDK link
- Visual Studio or Visual Studio Code (optional)
-
Clone the repository:
git clone https://github.com/your-username/dotnetcore-signalr-example.git
-
Navigate to the
OrderService
directory:cd OrderService
-
Restore dependencies and build the project:
dotnet restore dotnet build
-
Run the application:
dotnet run
-
The OrderService will be accessible at
http://localhost:5000
. The SignalR hub will be available at/hubs/orders
.
The JavascriptClient
project is an example client application written in JavaScript. It demonstrates how to connect to the OrderService
SignalR hub and receive real-time updates.
- Any modern web browser
-
Clone the repository:
git clone https://github.com/your-username/dotnetcore-signalr-example.git
-
Navigate to the
JavascriptClient
directory:cd JavascriptClient
-
Install required dependencies:
npm install
-
Run the application:
npm start
-
The client application will connect to the
OrderService
SignalR hub and display real-time updates.
The FlutterClient
project is an example client application written in Flutter. It demonstrates how to connect to the OrderService
SignalR hub and receive real-time updates.
- Flutter SDK link
-
Clone the repository:
git clone https://github.com/your-username/dotnetcore-signalr-example.git
-
Navigate to the
FlutterClient
directory:cd FlutterClient
-
Retrieve the project dependencies:
flutter pub get
-
Run the application:
flutter run
-
The client application will connect to the
OrderService
SignalR hub and display real-time updates.
If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository on GitHub.
- Create a new branch with a descriptive name for your feature/bug fix.
- Make your changes and ensure that the code is properly formatted.
- Write tests if applicable.
- Commit your changes and push the branch to your forked repository.
- Submit a pull request to the main repository.
This project is licensed under the MIT License.