A webapp that tracks whose turn it is to give a talk on Friday using:
- react + redux + redux-saga + typescript
- golang
- google datastore
- grpc + grpc-gateway + swagger codegen
- protobufs
There are two repositories for this project, one for the client and one for the server. All generated code is checked in, so to get a dev environment:
- Install protoc
- Install the gcloud tool and the datastore emulator (see [1])
- $(gcloud beta emulators datastore env-init)
- gcloud beta emulators datastore start
- Chec 538C k out the server repo and the client repo.
- cd $server; go build && ./talk-tracker
- cd $client; yarn start
[1] https://cloud.google.com/datastore/docs/tools/datastore-emulator
We use protobufs to describe our data model. In golang the types generated by protos are valid datastore entities, which makes this convenient.
We use gPRC to define our APIs and gRPC-gateway to expose them over HTTP to the client. The client is therefore completely agnostic to protobufs, it just uses swagger code generation to create a typesafe interface to the OpenAPI spec generated by gRPC-gateway.
To generate the server code, it is sufficient to run go generate
. On the client you can run the script ./gen-backend.sh
.