All Projects → trpc → Trpc

trpc / Trpc

Licence: mit
🧙‍♂️ TypeScript toolkit for building end-to-end typesafe APIs

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Trpc

Nextjs Jwt Example
next.js authorization example including private route protection
Stars: ✭ 72 (-72.2%)
Mutual labels:  api, nextjs
Nextjs Graphql Sample
A simple app to demonstrate basic API functions built with REST and GraphQL
Stars: ✭ 29 (-88.8%)
Mutual labels:  api, nextjs
Api Platform
Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Stars: ✭ 7,144 (+2658.3%)
Mutual labels:  api, nextjs
Covid19 Brazil Api
API com dados atualizados sobre o status do COVID-19 🦠
Stars: ✭ 300 (+15.83%)
Mutual labels:  api, nextjs
Pogo
Server framework for Deno
Stars: ✭ 341 (+31.66%)
Mutual labels:  api
Powershellforgithub
Microsoft PowerShell wrapper for GitHub API
Stars: ✭ 337 (+30.12%)
Mutual labels:  api
Swaggymnia
Generate Swagger 🌀 documentation for your existing API in Insomnia
Stars: ✭ 336 (+29.73%)
Mutual labels:  api
Mtapi
MetaTrader API
Stars: ✭ 334 (+28.96%)
Mutual labels:  api
Allorigins
👽 Pull contents from any page as JSON via API
Stars: ✭ 343 (+32.43%)
Mutual labels:  api
Next.js Typescript Starter Kit
🌳 [email protected], Styled-jsx, TypeScript, Jest, SEO
Stars: ✭ 342 (+32.05%)
Mutual labels:  nextjs
Money Printer Go Brrr
Print it, baby!
Stars: ✭ 339 (+30.89%)
Mutual labels:  nextjs
Socialreaper
Social media scraping / data collection library for Facebook, Twitter, Reddit, YouTube, Pinterest, and Tumblr APIs
Stars: ✭ 338 (+30.5%)
Mutual labels:  api
Elasticsearch Java
Elasticsearch Java API 手册
Stars: ✭ 341 (+31.66%)
Mutual labels:  api
React Refetch
A simple, declarative, and composable way to fetch data for React components
Stars: ✭ 3,418 (+1219.69%)
Mutual labels:  api
Crypto Exchanges Gateway
Your gateway to the world of crypto !
Stars: ✭ 343 (+32.43%)
Mutual labels:  api
Yandex Music Api
Неофициальная Python библиотека для работы с API сервиса Яндекс.Музыка
Stars: ✭ 335 (+29.34%)
Mutual labels:  api
Cypress Documentation
Cypress Documentation including Guides, API, Plugins, Examples, & FAQ.
Stars: ✭ 339 (+30.89%)
Mutual labels:  api
Koa Vue Notes Api
🤓 This is a simple SPA built using Koa as the backend, Vue as the first frontend, and React as the second frontend. Features MySQL integration, user authentication, CRUD note actions, and async/await.
Stars: ✭ 342 (+32.05%)
Mutual labels:  api
Il Ilce Mahalle Geolocation Rest Api
Türkiye için il ilçe semt veritabanı. Bölgesel bilgiler
Stars: ✭ 338 (+30.5%)
Mutual labels:  api
Degiro
DEGIRO (unoficial) API
Stars: ✭ 336 (+29.73%)
Mutual labels:  api

tRPC

a toolkit for building end-to-end typesafe data layers

codecov

Server/client example
The client above is not importing any code from the server, only it's type declarations.
Import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there’s no remnant of it at runtime.

Intro

tRPC is a framework for building strongly typed RPC APIs with TypeScript. Alternatively, you can think of it as a way to avoid APIs altogether.

  • 🧙‍♂️  Automatic type-safety & autocompletion inferred from your API-paths, their input data, outputs, & errors.
  • 🐎  Snappy DX. No code generation, run-time bloat, or build pipeline.
  • 🍃  Light. tRPC has zero deps and a tiny client-side footprint.
  • 🐻  Easy to add to your existing brownfield project.
  • 🔋  Batteries included. React-library + Next.js/Express adapters. (But tRPC is not tied to React - reach out if you want to make a Svelte/Vue/... lib)
  • 🥃  Simple to use APIs for queries & mutations + experimental subscriptions support.
  • 👀  Quite a few examples in the ./examples-folder
  • ✅  Well-tested & running in production.

tRPC requires TypeScript > 4.1 because of Template Literal Types, but you can get some benefits with autocompletion etc even if you use raw JS.


Usage

👉 See documentation on trpc.io. 👈

Quick start:

npx create-next-app --example https://github.com/trpc/trpc --example-path examples/next-hello-world my-app

Example apps

URL Command Path Description
todomvc.trpc.io yarn example:todomvc ./examples/next-prisma-todomvc TodoMVC-example with SSG & Prisma. Playwright for E2E-testing
chat.trpc.io yarn example:chat ./examples/next-ssg-chat Next.js real-time chat example with SSG & Prisma. Playwright for E2E-testing
hello-world.trpc.io yarn example:hello ./examples/next-hello-world Minimal Next.js example. Playwright for E2E-testing
n/a yarn example:standalone ./examples/standalone-server Standalone tRPC server + node client
n/a yarn example:playground ./examples/playground Express server + node client

Development workflow

git clone [email protected]:trpc/trpc.git
cd trpc
yarn

Hacking around with it

In one terminal, will run preconstruct watch in parallel which builds all packages/* on change:

yarn dev

In another terminal, you can for instance navigate to examples/next-hello-world and run yarn dev & it will update whenever code is changed in the packages.

Testing

cd packages/server
yarn test --watch

codecov

Some things regarding subscriptions is excluded in the coverage as it's an experimental feature

Testing is currently coalesced in ./packages/server/test - we import the different libs from here, this makes it easier for us to do integration testing + getting test coverage on the whole codebase.

Contributors ✨

Original 0.x-version was created by colinhacks and >1.x was created by KATT.


Alex Johansson

🤔 💻 ⚠️ 📖 💡 🚧

Colin McDonnell

🤔 💻 ⚠️ 📖

Pieter Venter

🤔 👀

Powered by Vercel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].