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
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • 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

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • gots

    Discontinued 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 https://github.com/deepmap/oapi-codegen 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