Build client-server application using gRPC

Photo by Alexandre Debiève on Unsplash


What are we building?


protoc version
protoc version
$ go install
$ go install
$ $export PATH=”$PATH:$(go env GOPATH)/bin”

Project Structure

project structure

Service Definition

$ protoc — go_out=. — go_opt=paths=source_relative — go-grpc_out=. — go-grpc_opt=paths=source_relative protof/product.proto
protof directory

Server Implementation

Client Implementation

Main Program


terminal-1: start the server
terminal-2: run client with default input
terminal-1: server logs
terminal-3: run client with another input
terminal-1: server logs

Source Code



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store