Fullstack TypeScript Monorepo: NestJS, NextJS 13 & tRPC

preview_player
Показать описание

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
Рекомендации по теме
Комментарии
Автор

I'm from Brazil and I'm loving your tutorials, through your website I'm getting to understand nest. There are no up to date nest courses on udemy and it's very hard to find people who teach as well as you do. Congratulations on the work, looking forward to your course in November!

imthedaniels
Автор

been following your blogs on nestjs.Thanks for the video I hope for more and wishing all the best

lameckotieno
Автор

This is a super solid tutorial that lays a very powerful foundation for a full stack app. I'm excited to leverage TRPC in my existing NestJS work. After completing this tutorial, I will work to add Prisma to this for a database.

wndGGaRkGBKpXvMNWHGOeMJv
Автор

Awesome stuff! This is exactly what I've been trying to figure out how to do for multiple weeks now

no_
Автор

Absolutely fantastic mate you are the only beacon of hope for me at this point. If you can make auth with crud that will be perfect. (Using next js and nest js) ❤

badru
Автор

this is absolutely fantastic mate. subscribed. good luck with the channel!

trentcox
Автор

Finally, I found some good stuff here. Thanks for making this tutorial

adics
Автор

I'm your 107th subscriber 😀 Very useful tutorial. Lots of love from India ❤️

avishekdas
Автор

thank you very much. super cool tutorial. I finally understood how trpc works. Would love to see trpc + prisma setup

EduardPrystupa-xjlt
Автор

Bruuuu. Great example. Make more of those setups mate.

krumbo
Автор

Just discovered your blog, great content, must have a good read of the unit testing blog, something thats not covered a lot.

lardosian
Автор

Hello Sir Currently i've learned and can build project with MERN stack i'm currently learning Nextjs and typescript.Woulf you mind if i suggest you to pls make a Nestjs Beginner series?That would help so much for a lot of people .Thanks bro for this tutorial❤🎉

kk
Автор

That's a great video, thanks you helped me alot.

One question though, can tRPC work well with some nextjs features like guards and pipes? I dont see how we can implement those and would appreciate a video on it

mzvlxze
Автор

By any chance do you have a docker-compose file with each Docker file for the projects?

matiasmartello
Автор

Hey Tom, thanks for this awesome tutorial. Do you have any ressources on how you would implement authentication with both NestJS and NextAuth ? I find it a little confusing. Thanks for your help man!

Revioorytb
Автор

Hey Tom, quick question. Why does a node_modules folder appear at the root level when you set up the NestJS project? You root level package.json doesn't have any dependencies, so I would have thought all of NestJS dependencies would be included in the apps/server folder. At first I thought maybe it's because it's automatically hoisting up shared dependencies, but you hadn't created the NestJS project yet, so technically nothing needs to be shared/hoisted.

dimitriborgers
Автор

awesome stack, also a new sub! Let's goo!

sdev
Автор

Bro how to connect express trpc backend with nextjs frontend?? Plz guide me

Infinite_Mainak
Автор

29:30 It would be nice to show how to inject the HelloService into the router

rrAzz
Автор

What changes will I need to make if I decide to use graphql instead of trpc ? Thanks for the tutorial!

ayushshende