warmherz / trpc-api-boilerplate

⚒️ Minimal tRPC API boilerplate for separate BE-FE repositories. Easily publish fully typesafe APIs that any frontend can consume.

Home Page:https://trpc-api-boilerplate.onrender.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tRPC API Boilerplate Heisenberg

CI npm version

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.

Running

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 Repo

Example frontend app repository - tRPC Frontend Boilerplate

Avoid publishing package?

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 run 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.

https://trpc-api-boilerplate.onrender.com/

License:MIT License


Languages

Language:TypeScript 86.1%Language:JavaScript 12.3%Language:Shell 1.7%