/build-basic-grpc-server-with-ts

Basic gRPC server implementation

Primary LanguageTypeScript

Build a Basic gRPC Server with Typescript

Basic gRPC implementation including unary, server-streaming, and bi-directional. The types are generated by gRPC Protobuf Loader.

Get started

yarn dev

Types generation

the *.proto files are kind of the contacts that defining what the server is going to serve. And with Typescript, we need types to reflect how *.proto files are gonna look like.

If *.proto files have to be changed. You need to manually build the types with the following command.

sh build-protos.sh

At the moment, there is no tool like Prisma that has ORM's feature for types generation with quite nice developer experience. Because, the files generated would be hidden and the less code we have to maintain.

To be honest, I did NOT know the Prisma types generation work 😅 under the hood. There might be some significant consideration along with how the tool work, and that might affect to other scenario.

References