Skip to content

⚒️ Minimal tRPC API boilerplate for projects with separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

License

Notifications You must be signed in to change notification settings

mkosir/trpc-api-boilerplate

Repository files navigation

tRPC API Boilerplate Heisenberg

CI

Minimal tRPC API boilerplate for projects with separate backend and frontend repositories. Easily publish fully typesafe APIs that any frontend can consume.

Monorepos are great, but sometimes the architecture requires separating the backend and frontend into distinct repositories.

Why use this?

This boilerplate is ideal when you want to separate:

  • Domain/business logic – expose only what needs to be exposed through the API.
  • Developer responsibilities – for larger teams/companies.
  • CI/CD pipelines – manage PRs, issues, and deployments independently.

Running

Easily set up a local development environment

  • Fork & clone the repo
  • Run npm install
  • Make changes to the tRPC API
  • Push - a new package is released 📦 npm version
  • In your frontend app, install it npm install trpc-api-boilerplate

Example Repos

Example frontend app repositories:

Avoid publishing the package?

If for whatever reason publishing a package is not an option:

  • privacy concerns
  • faster development iterations - skip CI
  • ...

Use the repository to share types by running npm run trpc-api-export and push code changes.
In your frontend app, consume types by running npm run trpc-api-import.

About

⚒️ Minimal tRPC API boilerplate for projects with separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

Topics

Resources

License

Stars

Watchers

Forks