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.
brew install protobuf
brew install protoc-gen-grpc-web
brew install grpcurl
- 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.
- Run envoy proxy server ()
$ docker-compose up
- Run frontend app (inside
frontend
folder)
$ npm run server # http://localhost:8000/
- Generate event in backend server using grpcurl
$ grpcurl --plaintext -d '{"Code":"MY_EVENT"}' localhost:9000 Event.BroadcastEvent
- Observer event in the frontend
Blog Post coming soon.