trpc nextjs
Details:
Description:
I used this trpc with NextJS as a proof of concept on how Carewell can improve their API endpoints with type-checking. Currently, they are manually deriving their types and sharing those types across the code-base. Instead, the goal was to have trpc generate types from several of their third party vendors and ensure the response was not only type-safe, but could share these types across all of their code-bases using the OpenAPI spec. I created two examples, one using React-Query and another using SWR . I put together a demo, went over the pros and cons of each example, and recommended which approach is worth adopting.
Tech Specs:
- trpc
- nextjs
- react-query
- swr