Sharing types between Go backend and TypeScript frontend: best practices and tools?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Mergify - Updating dependencies is time-consuming.
  • goapi-gen

    This package contains a set of utilities for generating Go boilerplate code for services based on OpenAPI 3.0 API definitions

    I usually have and OpenAPI document, and I generate both the client and server if I can. For the server, I specifically love goapi-gen.

  • typescriptify-golang-structs

    A Golang struct to TypeScript class/interface converter

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • gots

    No matter how you pronounce it, this repository is all about converting Go types to TypeScript types.

    You can try GOTS

  • social

    social network in GRPC, Go, mysql, and vuejs, (by imran31415)

  • protobuf-project

    Protobuf with Go import paths for Go and TypeScript: project boilerplate w/ Makefile. Supports grpc, vtprotobuf, drpc, ts-proto, twirp, starpc.

  • oapi-codegen

    Generate Go client and server boilerplate from OpenAPI 3 specifications

    We're using at work while having an OpenAPI spec. When the spec changes, backend/frontend/mobile regenerate their server/client

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