🎵 Music-themed demo of a fully typed gRPC client and server implementation in TypeScript. It implements each RPC type (unary, client streaming, server streaming and bidirectional), and uses type definitions generated with grpc_tools_node_protoc_ts.
The demo application takes the form of a CLI tool that allows you to manage and discuss your favourite songs. Watch demo.
Read the accompanying blog post here.
yarn
yarn clean
yarn buildyarn start serveUnary: Get a random song
yarn start get-songClient Streaming: Add songs
yarn start add-songsThe songs you add will be persisted to the local JSON store db.json.
Server Streaming: Get chat comments on a song
yarn start get-chat --songId <id>Bidirectional Streaming: Live chat on a song
yarn start chatSay you set your username as mike and you choose to discuss the song with id 10. Then, the application will dump chat messages to a local file called chat-mike-10.txt. You can observe messages as they come in:
watch cat chat-mike-10.txtGo ahead and try running multiple chat clients at once!

