Skip to content

Asynchronously broadcasting gRPC streams over SignalR.

License

Notifications You must be signed in to change notification settings

peter-mghendi/grapevine

Repository files navigation

Grapevine

Asynchronously broadcast gRPC streams over SignalR.

Grapevine Screenshot.

Introduction

This is a proof-of-concept on broadcasting gRPC streams asynchronously to front-end clients via WebSockets, gRPC-web or SignalR.

Getting started

Prerequisites

  • Git - Version Control System.
  • .NET 5 or later - Free, cross-platform, open source developer platform for building all your apps.

Installation

Please check the official .NET documentation for installation instructions before you start.

All console commands are written for the Windows Command Prompt and may not produce the desired effects when used in other terminals.

0. TL;DR Command List

Here's the summary:

git clone https://github.com/sixpeteunder/grapevine.git
cd grapevine
dotnet restore
dotnet dev-certs https --trust
start dotnet run --project Grapevine.Edge
start dotnet run --project Grapevine.Web
start dotnet run --project Grapevine.Cli

1. Clone the repository

Clone the repsitry using any of these methods.

HTTPS:

git clone https://github.com/sixpeteunder/grapevine.git

SSH:

git clone git@github.com:sixpeteunder/grapevine.git

GitHub CLI:

gh repo clone sixpeteunder/grapevine

2. Switch to the repo folder

cd grapevine

3. Install dependencies

Warning: These steps may be bandwith-intensive.

Restore .NET dependencies using Nuget:

This step is automatically performed whenever the code is built or run.

dotnet restore

4. Set up project

macOS doesn't support ASP.NET Core gRPC with TLS. Additional configuration is required to successfully run gRPC services on macOS. For more information, see this document.

To enable HTTPS during development, you need to trust the HTTPS development certificate:

The following command doesn't work on Linux. See your Linux distribution's documentation for trusting a certificate.

dotnet dev-certs https --trust

Start the gRPC server:

start dotnet run --project Grapevine.Edge

Start the web/SignalR server:

start dotnet run --project Grapevine.Web

(Optional) Start a client application:

start dotnet run --project Grapevine.Cli

5. Develop!

You can now access the gRPC server at http://localhost:5000 or https://localhost:5001.

The web/SignalR server can be accessed at http://localhost:5002 or https://localhost:5003.