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:
- separation/encapsulation of backend and frontend domain (except what must be exposed to both through API).
- separation of backend and frontend developers (larger teams/companies).
- separation of backend and frontend CI/CD pipelines, PRs, issues, etc.
... in that case checkout this boilerplate.
Easily set up a local development environment
- fork & clone repo
npm install
- make changes to tRPC API & push - new package is released 📦
npm install trpc-api-boilerplate
in any frontend app 🚀
Example frontend app repository - tRPC Frontend Boilerplate
If for whatever reason publishing a package is not an option:
- privacy concerns
- faster development iterations - skip CI
- ...
Use:
- npm link
- run
npm run trpc-api-export
and push code changes. In your frontend app runnpm run trpc-api-import
.