About | What works | In development | Requirements |
🚀 Project developed to demonstrate two type of gRPC (Unary and Server Streaming)
The following libraries and languages were used in the project's construction:
- Go
- gRPC
- Makefile
- Gin
- Send Posts using unary call;
- Receiving new posts in real time using Server Streaming;
- Client streaming;
- Bidirectional streaming;
- JS client;
- Clean Architecture;
Before you start, you will need to have the following tools installed on your machine: Git, Go, gRPC and Protobuffer package dependencies and if you want the development mode, install gin to live reload. Additionally, it's good to have a code editor to work with, such as VSCode
sudo apt install -y protobuf-compiler
brew install protobuff
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
NOTE: You should add the protoc-gen-go-grpc to your PATH
export PATH="$PATH:$(go env GOPATH)/bin"
go get github.com/codegangsta/gin
go install github.com/codegangsta/gin
# Clone this repository
# To start the server as dev
$ make run dev
# To build and start server
$ make run build
$ make run run
# The server will start on port 50051 - access it on <grpc://localhost:50051>
# To run client, in the source of this directory, open a new terminal, and execute
$ go run client/golang/main.go
# you can also use clients like Postman and Insomnia by importing the proto file at /proto/post.proto