Same old todo app but with shiny new GRPC
My attempt to learn gRPC. This project uses gRPC-Java as backend and React + TypeScript as frontend while using Envoy proxy for interacting with backend. I tried using grpc-web but I could not make it work with TypeScript ¯\_(ツ)_/¯
hence using one from https://github.com/improbable-eng/grpc-web.
- JDK >=11
- Maven >=3.6.x
- Docker and docker-compose
- Node and yarn
First build java package from grpc-todo
directory:
$ mvn package
This will create a local docker image of the backend app tagged as localhost/grpc-todo-app
.
Then, from root directory, run docker-compose:
$ docker-compose up
This will start gRPC web proxy
and java backend server.
Now, from client
directory, start webpack server:
$ yarn install && yarn start
If everything is working as expected, yarn should start a browser window @ http://localhost:3000/ and you should see the app.
There's a weird bug while deleting a todo item. I think it's related to how protobuf message is serialized and React's diff algorithm deals with it. Probably, better to create non protobuf object for states and props.- Need to write tests both on server and client sides
- Figure out how gRPC-java handles backpressure
- Instrumentation and observability are missing :|
- Retryable errors in client side. As of right now, only gRPC-java has experimental support for retries via service config. Check this thread for more information.