Building a modern gRPC-powered microservice using Node.js, Typescript, and Connect

This page summarizes the projects mentioned and recommended in the original post on dev.to

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • typebox

    Json Schema Type Builder with Static Type Resolution for TypeScript

    In setting out to build this service, we wanted to use gRPC for its APIs. We’ve been reaching for REST when building APIs so far, primarily out of necessity, i.e., our public APIs needed auto-generated client SDKs and docs for developers working with them. We built those APIs with Fastify and Typebox but felt burned by a code-first approach to generating an OpenAPI spec. I’ll spare you the details and save that experience/learning for another article. Suffice it to say we love gRPC’s schema-first approach. This blog post summarizes our feelings well

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • fnm

    🚀 Fast and simple Node.js version manager, built in Rust

    You’ll need pnpm and Node.js installed on your machine + some tool for switching node versions (e.g. fnm or nvm will work fine);

  • nvm

    Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

    You’ll need pnpm and Node.js installed on your machine + some tool for switching node versions (e.g. fnm or nvm will work fine);

  • building-a-node-microservice

    A repository backing the the how-to style blog post on developed a gRPC-powered service in Node.js.

    All of the code examples in this article are taken from the following repository ‣. Each part of the post should have a corresponding commit in the repository's main branch.

  • fastify

    Fast and low overhead web framework, for Node.js

    In setting out to build this service, we wanted to use gRPC for its APIs. We’ve been reaching for REST when building APIs so far, primarily out of necessity, i.e., our public APIs needed auto-generated client SDKs and docs for developers working with them. We built those APIs with Fastify and Typebox but felt burned by a code-first approach to generating an OpenAPI spec. I’ll spare you the details and save that experience/learning for another article. Suffice it to say we love gRPC’s schema-first approach. This blog post summarizes our feelings well

  • dopt

    Pnpm has built-in support for monorepos via pnpm workspaces. We’ll configure pnpm-workspace.yaml as follows.

  • connect-es

    The TypeScript implementation of Connect: Protobuf RPC that works.

    protobuf messages we’ll configure (@bufbuild/connect-es)

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • unbuild

    📦 A unified JavaScript build system

    And we will once use unbuild to build.

  • rules_ts

    Bazel rules for the `tsc` compiler from http://typescriptlang.org

    import { StateTransitionService } from "@state-transitions/definition"; import { createConnectTransport } from "@bufbuild/connect-node"; import { createPromiseClient } from "@bufbuild/connect"; // The following line is due to these issues // > https://github.com/aspect-build/rules_ts/issues/159#issuecomment-1437399901 // > https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1270716220 import type {} from "@bufbuild/protobuf"; export const transport = createConnectTransport({ baseUrl: `http://localhost:8080`, httpVersion: "1.1", }); export const client = createPromiseClient(StateTransitionService, transport);

  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    import { StateTransitionService } from "@state-transitions/definition"; import { createConnectTransport } from "@bufbuild/connect-node"; import { createPromiseClient } from "@bufbuild/connect"; // The following line is due to these issues // > https://github.com/aspect-build/rules_ts/issues/159#issuecomment-1437399901 // > https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1270716220 import type {} from "@bufbuild/protobuf"; export const transport = createConnectTransport({ baseUrl: `http://localhost:8080`, httpVersion: "1.1", }); export const client = createPromiseClient(StateTransitionService, transport);

  • tsup

    The simplest and fastest way to bundle your TypeScript libraries.

    As we iterate on the definition, we are going to want a better developer experience for rebuilding the package on changes. Typically, for a “library” or “utility” style package, I’d reach for either unbuild’s stub concept or use esbuild/tsup/rollup to implement a more traditional watch/rebuild, but in this case, I’m watching a proto file that lives outsides of the source, which breaks assumptions of those tools.

  • Rollup

    Next-generation ES module bundler

    As we iterate on the definition, we are going to want a better developer experience for rebuilding the package on changes. Typically, for a “library” or “utility” style package, I’d reach for either unbuild’s stub concept or use esbuild/tsup/rollup to implement a more traditional watch/rebuild, but in this case, I’m watching a proto file that lives outsides of the source, which breaks assumptions of those tools.

  • esbuild

    An extremely fast bundler for the web

    As we iterate on the definition, we are going to want a better developer experience for rebuilding the package on changes. Typically, for a “library” or “utility” style package, I’d reach for either unbuild’s stub concept or use esbuild/tsup/rollup to implement a more traditional watch/rebuild, but in this case, I’m watching a proto file that lives outsides of the source, which breaks assumptions of those tools.

  • connect-go

    Discontinued Moved to https://github.com/connectrpc/connect-go

    As mentioned in the intro, we are going to use Buf and Connect as our tools. We’ll start by installing the dependencies.

  • buf

    The best way of working with Protocol Buffers.

    As mentioned in the intro, we are going to use Buf and Connect as our tools. We’ll start by installing the dependencies.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Vitest vs. Jest: why we are betting on Vitest

    2 projects | news.ycombinator.com | 26 Nov 2024
  • Integrating an external file server https://min.io into a full-stack application on NestJS and Angular

    3 projects | dev.to | 15 Nov 2024
  • NestJS: A Progressive Node.js Framework

    1 project | news.ycombinator.com | 12 Nov 2024
  • Why you should learn TypeScript and ditch JavaScript? TypeScript vs JavaScript

    1 project | dev.to | 11 Nov 2024
  • What's New in F# 9

    19 projects | news.ycombinator.com | 10 Nov 2024

Did you konow that TypeScript is
the 1st most popular programming language
based on number of metions?