trpc-api-boilerplate
v1.0.53
Published
[![CI][ci-badge]][ci-url]
Downloads
130
Readme
tRPC API Boilerplate
Minimal tRPC API boilerplate for separate backend and frontend 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 📦
- install newly released package
npm install trpc-api-boilerplate
in any frontend app 🚀
Example Repo
Example frontend app repositories:
- tRPC Frontend Boilerplate - Vite
- tRPC Frontend Boilerplate - Nextjs
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
.