🎉 Free NestJS Course: https://www.tomray.dev/nestjs-fundamentals-course
📖 The written tutorial that accompanies this video: https://www.tomray.dev/nestjs-nextjs-trpc
💻 Github repo for this tutorial: https://github.com/tomwray13/nestjs-nextjs-trpc
In this tutorial, we're going to start from scratch and build a full-stack, end-to-end type-safe pnpm monorepo with NestJS, NextJS 13 (using the new /app directory) & tRPC. We'll also cover deployment with Railway 🚝.
I have fallen in love with this tech stack as the developer experience is SO good!
In particular, I love that:
• It's fully end-to-end type safe
• The tRPC server is fully integrated into NestJS, so you have access to all of NestJS's wonderful functionality like dependency injection
• Fits really well with the NextJS 13 transition to server-side rendering
• It keeps the frontend(s) and backend project separate, but seamlessly working together in the monorepo
• I also wrote this tutorial as many people in the NestJS community are curious about how to use tRPC with NestJS!
The only pre-requisites for this tutorial are that you'll need pnpm and the NestJS CLI installed on your machine.
Enjoy! 🍿
00:00 - Intro
00:52 - pnpm monorepo setup
02:18 - NestJS setup
06:02 - NextJS 13 setup
07:15 - Monorepo config
14:33 - tRPC server
31:49 - tRPC client
44:47 - Deploying to Railway