All Projects → johanbrandhorst → grpcweb-boilerplate

johanbrandhorst / grpcweb-boilerplate

Licence: MIT license
A minimal repo containing all the boilerplate for getting started with GopherJS using gRPC-Web

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to grpcweb-boilerplate

docker-protobuf
An all-inclusive protoc Docker image
Stars: ✭ 105 (+133.33%)
Mutual labels:  protobuf, grpc-web
Grpcweb Example
An example implementation of a GopherJS client and a Go server using the Improbable gRPC-Web implementation
Stars: ✭ 85 (+88.89%)
Mutual labels:  protobuf, gopherjs
protobuf-ts
Protobuf and RPC for TypeScript
Stars: ✭ 527 (+1071.11%)
Mutual labels:  protobuf, grpc-web
Bynar
Server remediation as a service
Stars: ✭ 53 (+17.78%)
Mutual labels:  protobuf
yages
Yet another gRPC echo server (YAGES)
Stars: ✭ 28 (-37.78%)
Mutual labels:  protobuf
AndroidNetworkProgramming
Android网络编程实战总结,涉及HTTP、TCP、UDP常用协议。
Stars: ✭ 34 (-24.44%)
Mutual labels:  protobuf
karate-grpc
gRPC Testing Made Simple by Karate
Stars: ✭ 43 (-4.44%)
Mutual labels:  protobuf
grpc-web-istio-demo
A demo for showcasing gRPC-Web with Istio.
Stars: ✭ 67 (+48.89%)
Mutual labels:  grpc-web
Anakin
Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app! 🌞
Stars: ✭ 17 (-62.22%)
Mutual labels:  protobuf
django-grpc
Easy gRPC service based on Django application
Stars: ✭ 177 (+293.33%)
Mutual labels:  protobuf
Rabbit-OJ-Backend
Using Go & MySQL & Docker & Web Socket & gRPC & Kafka & Zookeeper & Protobuf. Distributed and Scalable Open Judge System for Algorithms.
Stars: ✭ 20 (-55.56%)
Mutual labels:  protobuf
protobuf-example-java
Companion Repository for my Protocol Buffers course
Stars: ✭ 67 (+48.89%)
Mutual labels:  protobuf
protoconfig
ProtoConfig 1.0: Open Standard for using, defining, and consuming software configuration input in a unified way.
Stars: ✭ 24 (-46.67%)
Mutual labels:  protobuf
api
Speechly public API definitions and generated code
Stars: ✭ 15 (-66.67%)
Mutual labels:  protobuf
kafka-protobuf-serde
Serializer/Deserializer for Kafka to serialize/deserialize Protocol Buffers messages
Stars: ✭ 52 (+15.56%)
Mutual labels:  protobuf
ProtobufDecoder
A Google Protocol Buffers (Protobuf) payload decoder/analyzer
Stars: ✭ 33 (-26.67%)
Mutual labels:  protobuf
protobuf-ue4
Build Protobuf for Unreal Engine 4 with Jenkins Pipeline.
Stars: ✭ 26 (-42.22%)
Mutual labels:  protobuf
protobuf-ipc-example
Protocol buffer IPC example
Stars: ✭ 19 (-57.78%)
Mutual labels:  protobuf
read-protobuf
Small library to read serialized protobuf(s) directly into Pandas Dataframe
Stars: ✭ 28 (-37.78%)
Mutual labels:  protobuf
gome
gome- Golang Match Engine, uses Golang for calculations, gRPC for services, ProtoBuf for data exchange, RabbitMQ for queues, and Redis for cache implementation of high-performance matching engine microservices/ gome-高性能撮合引擎微服务
Stars: ✭ 47 (+4.44%)
Mutual labels:  protobuf

GopherJS gRPC-Web Boilerplate

gRPC-Web Gopher by Egon Elbre (@egonelbre)

A minimal repo containing all the boilerplate for getting started with GopherJS using gRPC-Web. Clone and use as a base for your own experimentation with GopherJS and gRPC-Web!

It comes complete with a Go generate template for statically serving your generated JS code from the backend server.

Video example

A recording of my presentation at the Go Devroom at FOSDEM 2018, in which I clone this repo I perform a small demo of its use.

Video example

Requirements

Generating the files requires the protoc protobuf compiler. Please install it according to the installation instructions for your specific platform.

Getting started

After cloning the repo, there are a couple of initial steps;

  1. Install the generate dependencies with make install. This will install protoc-gen-go and protoc-gen-gopherjs, which are necessary for us to generate the Go and GopherJS files.
  2. Generate a self-signed certificate with make generate_cert. This is necessary for us to serve the GopherJS files over HTTPS. When opening your browser it will not trust the certificate, so if you want to, you can add the generate certificate to your trust store first.
  3. If you forked this repo, or cloned it into a different directory from the github structure, you will need to correct the import paths. Here's a nice find one-liner for accomplishing this (replace yourscmprovider.com/youruser/yourrepo with your cloned repo path):
    $ find . -path ./vendor -prune -o -type f \( -name '*.go' -o -name '*.proto' \) -exec sed -i -e "s;github.com/johanbrandhorst/grpcweb-boilerplate;yourscmprovider.com/youruser/yourrepo;g" {} +
  4. Finally, generate the JS files with make generate. If you encounter an error here, make sure you've installed protoc and it is accessible in your $PATH, and make sure you've performed step 1.

Now you can run the web server with make serve.

Making it your own

The next step is to define the interface you want to expose in proto/web.proto. See https://developers.google.com/protocol-buffers/ tutorials and guides on writing protofiles.

Once that is done, regenerate the backend and frontend files using make generate. This will mean you'll need to implement any functions in backend/backend.go, or else the build will fail since your struct won't be implementing the interface defined by the generated file in proto/server/.

It also means you can start using the functions exposed by the server in your frontend client in frontend/frontend.go.

Every time you make changes to any files under frontend/ you'll need to regenerate the JS files using make generate.

This should hopefully be all you need to get started playing around with the GopherJS gRPC-Web bindings!

What this repo isn't

This repo is not a general example of how to use the GopherJS gRPC-Web bindings. For such an example, please see https://github.com/johanbrandhorst/grpcweb-example and https://grpcweb.jbrandhorst.com.

This repo is also not a particularly good example of how to write an app with GopherJS. Please explore the tutorials and wiki pages on https://github.com/gopherjs/gopherjs and check out frameworks such as https://myitcv.io/react and https://github.com/gopherjs/vecty for a better way to write GopherJS apps.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].