Skip to content

⚒️ Minimal tRPC API boilerplate for 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 separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

Monorepos are great, but sometimes we are targeting backend and frontend as separate (mono)repositories.

We might aim for backend and frontend repositories separation of:

  • domain/business logic - expose only what need to be exposed through API.
  • developers - larger teams/companies.
  • CI/CD pipelines, PRs, issues, etc.

... in that case checkout this boilerplate.

Running

Easily set up a local development environment

  • fork & clone repo
  • npm install
  • make changes to tRPC API & push - new package is released 📦 npm version
  • install newly released package npm install trpc-api-boilerplate in any frontend app 🚀

Example Repo

Example frontend app repositories:

Avoid publishing package?

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

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

Use 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 separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

Topics

Resources

License

Stars

Watchers

Forks