infynyxx / grpc_todo_app

My attempt to learn gRPC with same old todo app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grpc_todo_app

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.

CI

Requirements:

  • JDK >=11
  • Maven >=3.6.x
  • Docker and docker-compose
  • Node and yarn

Running:

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.

Current issues:

  • 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.

About

My attempt to learn gRPC with same old todo app


Languages

Language:TypeScript 67.0%Language:Java 27.5%Language:HTML 3.2%Language:Shell 1.8%Language:JavaScript 0.5%