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.
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.
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 📦
- In your frontend app, install it
npm install trpc-api-boilerplate
Example frontend app repositories:
- tRPC Frontend Boilerplate - Vite
- tRPC Frontend Boilerplate - Next.js
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
.