Better Programming

Advice for programmers.

Follow publication

Member-only story

Building Full-Stack TypeScript Applications Using tRPC

Ashley Peacock
Better Programming
Published in
5 min readNov 30, 2022
Photo by Dane Deaner on Unsplash

When building a full-stack application, the chances are you either reach for REST or GraphQL to provide API capabilities to your frontend. tRPC is seeking to change that, or at least provide an alternative, by adding the benefit of type sharing between the client and server.

Intrigued? I was too when I saw tRPC appear in my Twitter feed, so I decided to take a closer look. In this article, we’ll take a look at what tRPC offers, and how it can ease API development for your frontend applications.

What Is tRPC?

In a nutshell, tRPC is a framework for building typesafe APIs using TypeScript. As opposed to traditional APIs, such as REST and GraphQL, there are no API schemas in tRPC. Instead, the types you define in your backend API are accessible on the client-side.

That might sound a little strange at first, but if you consider that tRPC’s main use case is providing APIs in a full-stack application, it actually makes a lot of sense.

Schemas are essential when it comes to HTTP calls between services, in order to understand the contract between the client and server…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Ashley Peacock
Ashley Peacock

Written by Ashley Peacock

Staff Software Engineer, Architect & Author

Write a response