Type-safe Go backend for web apps

Write Go functions, call them from TypeScript with full autocomplete. No IDL required. Standard HTTP/JSON.

Works with Vite React Solid Vue sqlc Zod SSE Protobuf

Stop keeping types in sync manually

You've kept Go structs and TypeScript types in sync by hand. Or used OpenAPI codegen that's slow and generates ugly types. Or wished tRPC worked with Go backends.

Your Go structs become your TypeScript types. Automatically. No drift.

Go structs are your schema

No protobuf. No OpenAPI yaml. No IDL. Just write Go functions with struct parameters. tygor reads your code and generates TypeScript types with Zod schemas for runtime validation.

Validate tags like validate:"min=3" become z.string().min(3). All the good stuff included.

Hot reload with zero-downtime swaps

The Vite plugin hot-reloads your Go server. Change a Go file, save, see the update instantly.

Go build errors appear in your browser. No terminal watching required.

Errors in your browser, not your terminal

Go build errors and RPC failures show up in the Vite error overlay. Full stack traces with file paths and line numbers. Same UX you get for frontend errors, but for your backend.

During rebuilds, requests automatically route to the last working server. Your frontend doesn't break every time you save.

tygor devtools showing Go build errors in browser

Standard HTTP/JSON. No magic.

No custom wire protocols. No proprietary serialization. Just HTTP with JSON bodies. Debug with curl. Inspect in DevTools. Simple, auditable, boring.

Your API works with any HTTP client. The tygor client is optional convenience.

How tygor compares

tygor tRPC OpenAPI gRPC/Connect
Backend Go TypeScript Any Any
Schema Code-first Code-first Spec-first Spec-first

Already have a Go API? tygor works incrementally. Add it to one endpoint, see if you like it.

Get started

New project (Vite, SolidJS)

$bunx degit broady/tygor/examples/starter-solid my-app
$cd my-app && bun i && bun dev

With sqlc (SQLite)

$bunx degit broady/tygor/examples/with-sqlc my-app
$cd my-app && bun i && bun dev

Type-safe from SQL to browser

Read the docs →