tRPC: Building type-safe APIs with TypeScript

tRPC: Building Type-Safe APIs with TypeScript

Jake Everhart API Development, Articles, Development Technologies & Tools, GraphQL, JavaScript, TypeScript Leave a Comment

Over the years, weโ€™ve seen many approaches to HTTP API design. While REST APIs are still very popular throughout the industry, they offer no inherent guarantees that the clientโ€™s assumptions about the response structures will be valid.

GraphQL fills this gap to an extent by allowing client-side code greater control over the resulting structures but at the cost of added complexity. RPC (remote procedure call) frameworks attempt a different solution by sharing generated type definitions between the client and server implementations. What if there was a way to achieve the type safety of RPC by simply inferring the type definitions from the serverโ€™s code?

Enter tRPC. Since JavaScript (and specifically TypeScript) can already span across client and server implementations, tRPC allows a client to directly consume structures defined by the serverโ€™s exposed procedures. Essentially, you import your dependencies from the server to access these procedures, their return types are inferred and checked at build time, and your client code can confidently consume the returned data.

In this post, weโ€™ll look at how it achieves these goals and what limitations it places on your project stack.

Transform Pub/Sub to Firestore Database in GCP

Rusty Divine Apache, Articles, Cloud, Data Science, Databases, Google Cloud Platform, Python Leave a Comment

This year, the client I work with has started exploring the offerings in Google Cloud Platform (GCP) after investing years into the Microsoft Azure cloud. The opportunity has allowed me to explore a few new technologies that this post will cover and that you will hopefully find interesting.

In short, I was tasked with transforming Pub/Sub to Firestore Database in GCP. The scenario explored in this post takes an FHIR healthcare data feed, extracts telephone and email information, and then stores that in a Firestore database.

Part 4: Creating an FHIR API – Wrapping Things Up

Zach Gardner API Development, Articles, Cloud, Creating an FHIR API, Healthcare, Tutorial Leave a Comment

Welcome to the fourth and final installment of Creating an FHIR API with GCP. So far, weโ€™ve covered a lot!

We discussed the differences between Google and Azure, landing on GCP as the best option for FHIR in Part 1. We began our implementation in Part 2, creating both the BigQuery resources and your FHIR repository resources. And finally, in Part 3, we tackled authentication methods and populating data in our FHIR repository.

This time, weโ€™ll wrap everything up with a nice little bow. First, weโ€™ll finish our implementation, and then, Iโ€™ll share the limitation I found – for the sake of transparency. Letโ€™s dive in.

Part 3: Creating an FHIR API – Implementation Part B

Zach Gardner API Development, Articles, Cloud, Creating an FHIR API, Healthcare, Tutorial Leave a Comment

This is Part 3 of our series on creating an FHIR API using Google Cloudโ€™s offering. In the last installment, we began implementing an FHIR using GCP. We covered creating both the BigQuery resources and your FHIR repository resources. if you missed Part 1 and Part 2, be sure you go back to read those – theyโ€™re critical to understanding!

This time, weโ€™re continuing the implementation. Iโ€™ll explain the authentication methods, and weโ€™ll also tackle populating data in our FHIR repository.

Creating an FHIR API Part 2

Part 2: Creating an FHIR API – Implementation Part A

Zach Gardner API Development, Articles, Cloud, Creating an FHIR API, Healthcare, Tutorial Leave a Comment

Welcome back to our series, Creating an FHIR API. This is Part 2 in our 4-part series on standing up an FHIR using GCP. In Part 1, we talked through two of the offerings out there, Google and Azure, and based on the pros and cons, I decided to use GCP FHIR Cloud Healthcare API.

In this part, we’ll start in on our implementation. A forewarning: we won’t be able to finish it during this installment, so stay tuned for parts 3 and 4! Let’s dive in.