trpc-fe-boilerplate-next
trpc-fe-boilerplate-next copied to clipboard
⚒️ Minimal tRPC frontend Nextjs boilerplate for separate BE-FE repositories. Easily consume fully typesafe APIs.
tRPC Frontend Boilerplate 
Minimal tRPC frontend boilerplate (Nextjs) for separate BE-FE repositories. Easily consume fully typesafe APIs.
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
- clone repo
-
npm install
-
npm run dev
- use latest tRPC API package in your app 🚀
Import tRPC API
There are 2 ways to import tRPC API types from backend repo:
- Install npm package
npm i trpc-api-boilerplate
(currently set as a default option) - Run npm script
npm run trpc-api-import
(uncomment line)
Example Repo
Example backend API repository - tRPC API Boilerplate