Skip to content

A Server Stream gRPC Service with a demo frontend application

Notifications You must be signed in to change notification settings

RohitRox/grpc-server-events

Repository files navigation

A Server Stream gRPC Service with a demo frontend application.

The application uses gRPC-Web to enable full end-to-end gRPC service architecture all the way from client to server. However, gRPC-Web clients does need a translation layer to transform HTTP/1.1 calls to gRPC friendly calls (HTTP/2). Envoy proxy, which has gRPC-Web support built-in can be used as gateway for gRPC-Web to interact with grpc services.

Environment:

Docker, NodeJS, Golang

System Install (In Mac OS):

  brew install protobuf
  brew install protoc-gen-grpc-web
  brew install grpcurl

Running this project:

  1. Setup and run go grpc service
  $ go mod download
  $ go run . # http://localhost:9000/

protoc is used to compile .proto files, which contain service and message definitions. Compiled files are already commited in the repo. Regeneration commands are provided in Makefile.

  1. Run envoy proxy server ()
  $  docker-compose up
  1. Run frontend app (inside frontend folder)
  $ npm run server # http://localhost:8000/
  1. Generate event in backend server using grpcurl
  $ grpcurl --plaintext -d '{"Code":"MY_EVENT"}' localhost:9000 Event.BroadcastEvent
  1. Observer event in the frontend

Basic project architecture:

Project description:

Blog Post coming soon.

About

A Server Stream gRPC Service with a demo frontend application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published