T3: TRPC, Prisma and NextAuth Done Right

Поділитися
Вставка
  • Опубліковано 15 лип 2024
  • Let's try out TRPC using Theo's T3 application template that also integrates Prisma, NextAuth and Tailwind. And we'll use supabase and daisyui on top of that.
    Code: github.com/jherr/notetaker
    Try Scribe for free by downloading it here: scribe.how/jackherrington
    👉 I'm a host on the React Round-Up podcast: devchat.tv/podcasts/react-rou...
    👉 Don't forget to subscribe to this channel for more updates: bit.ly/2E7drfJ
    👉 Discord server signup: / discord
    👉 VS Code theme and font? Night Wolf [black] and Operator Mono
    👉 Terminal Theme and font? oh-my-posh with powerlevel10k_rainbow and SpaceMono NF
    0:00 Introduction
    1:00 Notetaker Introduction
    1:53 T3 Application Setup
    3:28 Supabase Setup
    7:00 Github OAuth Setup
    9:41 Scribe
    15:44 Deploying To Vercel
    17:58 Adding DaisyUI
    20:13 Adding Tables To The Schema
    21:55 Adding TRPC Procedures
    25:47 Querying TRPC
    27:01 Adding A Header
    28:47 Adding Topics To The UI
    33:55 Adding Notes TRPC Support
    34:49 Adding Notes UI
    41:18 Re-Deploying The App To Vercel
  • Наука та технологія

КОМЕНТАРІ • 260

  • @fev4
    @fev4 Рік тому +148

    This is the best implementation of an ad I've seen. Deeply integrated into the content.

    • @arjundureja
      @arjundureja Рік тому +15

      Probably the first time I watched an ad instead of skipping it

    • @gerelltroche
      @gerelltroche Рік тому +9

      Completely watched this ad. It was a great, non annoying ad. Great work!!

    • @KronosaurusRex
      @KronosaurusRex Рік тому +4

      And best of all, seems like something that adds real value to the video itself

  • @alalalal291
    @alalalal291 Рік тому +68

    Great introduction and love how well the ad was presented. One small thing to mention though is that even though T3 stack is popularized by Theo, he has actually not created Create T3 App, it's created by the community.

    • @jherr
      @jherr  Рік тому +23

      Fair enough, my bad. Thank you community!

    • @ToddDunning
      @ToddDunning Рік тому +8

      You know that has confused me too. I mean it says all over the place it's created by him, and then it says the community elsewhere. I think Theo is not exactly what we'd call shy and self-effacing.

    • @huge_letters
      @huge_letters Рік тому +2

      @@ToddDunning I believe the idea is Theo is creator of T3 stack(the idea of using typescript, tailwind, trpcs etc), but not the creator of create-t3-app which is a utility to bootstrap a t3 stack project.

    • @jherr
      @jherr  Рік тому +2

      @@Winslow_Tech Sounds like in the future I will need more accurate attribution.

  • @ergusto
    @ergusto Рік тому +1

    This channel is incredible, you have a great teaching style. Very pleased to have found this channel, it has already been incredibly helpful.

  • @nazar1744
    @nazar1744 Рік тому +27

    Finally this Stack gets more popular. It is so nice to work with it!

  • @exokristian
    @exokristian Рік тому +3

    Condensed and so clearly articulated! Wonderful presenting and teaching skills. Thank you for your great work.

  • @nishatsayyed8326
    @nishatsayyed8326 Рік тому +3

    This is just incredible. Thanks for sharing Jack
    Waiting for more and more amazing professional quality content.

  • @dhavall08
    @dhavall08 Рік тому +1

    That's really helpful to hear about keyboard shortcuts, tools and plugins along with tutorial.

  • @ismi-abbas
    @ismi-abbas Рік тому

    I've been searching all day long how to quickly get into this t3app, and for me this is the most quick and precise tutorial. Thanks Jack!

  • @hunterbertoson156
    @hunterbertoson156 Рік тому +10

    I appreciate you showing us how to deploy it as well. I feel like so many tutorials dont show how to deploy.

  • @thecodecatalyst
    @thecodecatalyst Рік тому +1

    Great vid and stack I've been working in a personal project for 4 months and this is gold for it. Thanks!!!

  • @laous
    @laous Рік тому +1

    Thank you very much! This is the best video to get you started with the t3-stack.

  • @infisspablo8602
    @infisspablo8602 Рік тому +4

    Banger video! Definitely helpful stuff for people who are just starting with T3 stack but also for folks who played with it for a bit

  • @pedromenezes4013
    @pedromenezes4013 Рік тому +5

    Just starting as a developer and even though I don't get exactly how every tiny bit works under the hood I can appreciate and understand a lot of what was explained. Amazing and super rich content. Thanks again Jack!

  • @riccardopellegrino5447
    @riccardopellegrino5447 11 місяців тому +1

    Having this type of content for free is really a blessing. Thank you so much! 🚀

  • @deathmachine808
    @deathmachine808 Рік тому +4

    Another excellent tutorial, cheers Jack

  • @pointman3352
    @pointman3352 Рік тому +1

    Great content as always, learnt a lot. Thanks Jack

  • @albert3120
    @albert3120 Рік тому

    Hey thanks a lot for this content. I remember doing a project alongside your video and kind of forgot about it. Now I was stuck again with the .query .mutation procedures and I just remembered somewhere in my head about your videos and ta-da... you put me back in track in no time. Thanks, really :)

  • @TheFourthPrince
    @TheFourthPrince Рік тому +1

    Thanks Jack...I just learnt about tRPC and was thinking about integrating in next.js...And at that moment your video dropped...Thanks again...

  • @hunterbertoson156
    @hunterbertoson156 Рік тому +1

    Been looking forwarding to this. Thanks Jack!

  • @SuperShivammm
    @SuperShivammm Рік тому +1

    Very well explain everything start to end of deployment. Thanks

  • @SanjuKumar-hk8yy
    @SanjuKumar-hk8yy Рік тому +2

    Thank you Jack, for make a video on tRPC ☺️☺️

  • @VincentFulco
    @VincentFulco 10 місяців тому

    this was an extraordinary primer on the combo. thanks!

  • @aghileslounis
    @aghileslounis Рік тому +1

    Scribe ! OMG what a great product and great AD Jack, such a master !

  • @reveillegaming
    @reveillegaming Рік тому +1

    Will be watching this later. I've actually started a generic blog project using the stack. Enjoying it so far. Will see how much I enjoy on something more complex though.

  • @Ellenox147
    @Ellenox147 Рік тому +1

    Love your work ! Thanks for the video

  • @codewithguillaume
    @codewithguillaume Рік тому +1

    Amazing setup Jack.

  • @samyogdhital
    @samyogdhital Рік тому +1

    Jack are you reading my mind?? I was searching tutorial on exact tech stack and this came up!😀😀

  • @senkasim
    @senkasim Рік тому +2

    Thanks for the tutorial content Jack 😎🖖

  • @metacarpo10
    @metacarpo10 Рік тому +1

    Omg this couldnt be more perfect in time! I was actually just posting a stack overflow question because I was not able to refresh the page after mutation, I tried a lot of things yesterday, read a ton of documentation but somehow I couldnt and went to sleep angry lol, I guess I missed the onSucess inside the useMutation hook Idk I thought Id alteady tried it. Thanks!

  • @vishwasrv
    @vishwasrv Рік тому +3

    Just love the tutorials and the effort that you put in to deliver such valuable content Jack . Thanks a lot sir.

  • @stefankudla809
    @stefankudla809 Рік тому +4

    Not only did this example make it easy to understand the T3 stack, but it looks stunning with Daisy UI! Enjoyed being able to focus on the functionality more than the styling.

    • @JEsterCW
      @JEsterCW Рік тому

      Higly recommending to avoid daisy tho 💀

    • @compton8301
      @compton8301 Рік тому +1

      @@JEsterCW why??

  • @yanrussell2015
    @yanrussell2015 Рік тому +1

    the background scene of your video is beautiful !

  • @laroikin
    @laroikin Рік тому +1

    Yay!!! So glad to see you cover it!

    • @laroikin
      @laroikin Рік тому

      Just finished watching the video.
      Fullstack will never get easier than that!

  • @manoj-k
    @manoj-k Рік тому

    Very well explained, Thank you very much for this video,❤

  • @elenakiseljova2493
    @elenakiseljova2493 Рік тому +1

    This is a very cool lesson! Thanks

  • @vrmatt
    @vrmatt 5 місяців тому

    really valuable information, thank you jack

  • @jaany
    @jaany Рік тому +3

    T3 video from the legend himself, and he got a sponsor too? Hell yeah

  • @kszyh_
    @kszyh_ Рік тому +13

    I wish that NestJS supports tRPC officially

  • @small_norweg_
    @small_norweg_ Рік тому +1

    The only ad I don't want to skip❤

  • @repe0
    @repe0 Рік тому +1

    thank you for showing some love for pnpm

  • @bassam.2023
    @bassam.2023 Рік тому

    What can I say? 🤔
    The most comprehensive tRPC tutorial out there! 🙌🏻 🙏🏻
    Thank you so much! 😁
    PS Thanks for bringing attention to daisyUI, a life saver for those of us who are a bit behind on the CSS side of things!

    • @bassam.2023
      @bassam.2023 Рік тому

      An interesting follow-up video might be to convert this app to allow for multiple users, each having access to only their own notes.

  • @sphesihlemanuel2933
    @sphesihlemanuel2933 Рік тому +1

    Finally a video using a T3 Stack thanks

  • @abhishekvishwakarma9045
    @abhishekvishwakarma9045 Рік тому +1

    Overall really great project to start with T3 stack (tRPC under the hood😌) already loving this stack 🤩, thanks for bringing in

  • @user-fv7tr9vz6g
    @user-fv7tr9vz6g Рік тому +1

    Super content. Thank u!

  • @appuser
    @appuser Рік тому +1

    This was 😘👌 Just needed a quick intro to T3 to see if it'll work for my next project, but got a lot of bonus exposure to the likes of DaisyUI, CodeMirror, react-markdown etc.

  • @hbela1000
    @hbela1000 Рік тому +1

    Thx, the best tutos I must say.

  • @Michael-Martell
    @Michael-Martell Рік тому +1

    yes! Thank you! This video should be a hit!

  • @blue_berry_pie64
    @blue_berry_pie64 Рік тому

    best tutorial for old idea but new tech stack. 🤟🤛🤜

  • @Ikakoo2410
    @Ikakoo2410 Рік тому +1

    Thank you sir!

  • @levantos
    @levantos Рік тому +3

    So many gems in this, thanks Jack!

  • @nated0g745
    @nated0g745 Рік тому +1

    Love it. The generated typing is really nice. Wild that useState is already “Good ol’ useState 😂”. JS moves so quickly.

  • @sujithgnth
    @sujithgnth Рік тому

    Mmm. I never had any idea on TRPC until I saw this quality video. Thanks Jack, thanks a ton

  • @realbigsquid
    @realbigsquid Рік тому +1

    This was great!

  • @beefykenny
    @beefykenny Рік тому +1

    I learned a bunch!

  • @CaleMcCollough
    @CaleMcCollough Рік тому

    Thank you so much for this tutorial. It's not super long. You have no idea how much you helped me, except that the tutorial you don't pause after you input code and that makes it crazy hard to follow it. I had to drop the speed down to 0.25x to catch the code you entered before it went off screen and that still too multiple tries. The instructions aren't 100% complete for Windows, you must put the API keys in the .env folder, and you need to add the correct API keys for the production GitHub OAuth app. Other than that it's nice to have a short tutorial that doesn't combine a bunch of the same stuff that takes so much time and has nothing to do with my app. Everyone's app is different and none of these tutorials have been good for me due to the bloat.

  • @arhamsc9097
    @arhamsc9097 Рік тому +4

    Awesome tutorial 👍🏻👍🏻, also would be great if you could share the terminal theme and autocomplete package you are using 😊.

  • @volkan8583
    @volkan8583 Рік тому +1

    Ty for making clear some things that not clear in my mind about how data flows UI to DB .

  • @albertosilvaus6417
    @albertosilvaus6417 Рік тому +1

    Thank you!

  • @hwj8640
    @hwj8640 Рік тому +1

    A good channel for non-beginners.

  • @crowdozer3592
    @crowdozer3592 Рік тому +1

    tRPC is amazing. When I saw Theo's video I got motivated to port the entire stack over to svelte lol
    The tRPC part was pretty easy to set up, it feels like magic to use lol

  • @BensTechLab
    @BensTechLab Рік тому +2

    You win best sponsor integration! I was all ready to fast forward an off-topic irrelevant product shout out… but this was spot on. Hope you can keep up the sponsor alignment as you continue to grow.

  • @jakubkurdziel2407
    @jakubkurdziel2407 Рік тому +2

    Amazing video, Thank You Jack.👏🏼
    in 32:57 instead of creating the Topic type You can inport this like that:
    import type { Topic } from "@prisma/client";

    • @jherr
      @jherr  Рік тому +2

      True in this case. But if the TRPC layer weren't a straight pass-thru, and instead were doing some type of permutation, then you would not have proper sync between the client and the server. Because the client is talking to the server, and not to prisma directly.

  • @faizanahmed9304
    @faizanahmed9304 Рік тому +2

    **THE BEST** Tutorial on T3 stack! But sir I struggle with prisma, I think I must see a tutorial on it. Coming from mongoose I think it is overwhelming.

  • @muaddib3515
    @muaddib3515 Рік тому +1

    Knew this video was coming!

  • @devagr
    @devagr Рік тому +3

    17:22 missed opportunity to show the new copy-paste env file into Vercel dashbaord

  • @alii4334
    @alii4334 Рік тому +1

    I can't thank you enough!

  • @seanlawton7681
    @seanlawton7681 Рік тому +1

    t3 stack is my new go to

  • @souravukil4120
    @souravukil4120 7 місяців тому +1

    ty

  • @danielbark
    @danielbark Рік тому +3

    Great video Jack!
    I published almost the exact same video last week :P
    I also tried out some optimistic UI updates on the tRPC mutation hook if that would be interesting to anyone here.
    But definitely finish this video first! 💯

    • @arctiinae
      @arctiinae Рік тому +2

      I watched yours first, and it was A+! It was my first intro to optimistic updates and it was great. Thanks!

    • @danielbark
      @danielbark Рік тому +2

      @@arctiinae Thanks a lot! Glad you enjoyed :)

  • @realitydesigners
    @realitydesigners 6 місяців тому +1

    wow this is cool

  • @blue_berry_pie64
    @blue_berry_pie64 Рік тому

    its really fun when sometimes I heard your high voice, ex: @40:11 , awesomeeeeeeeee 😝

  • @kroucher3286
    @kroucher3286 Рік тому +1

    Welcome to the pnpm gang!

  • @mariocarlosrocapenafiel8749
    @mariocarlosrocapenafiel8749 Рік тому +1

    I'm use Arc browser too, it's really cool

  • @cb73
    @cb73 Рік тому +1

    I’d love to see a version of create-t3-app using the new server component app folder structure

  • @mrSargi7
    @mrSargi7 Рік тому +3

    33:37 VS Code auto imported Topic type for me from prisma client hah

  • @zombiefacesupreme
    @zombiefacesupreme Рік тому +2

    You can copy/paste your environment variables on Vercel now!

  • @lsxu149
    @lsxu149 Рік тому +1

    damn, arc browser looks so cool🥵🥵

  • @darelbvcr687
    @darelbvcr687 Рік тому +7

    can you make more of these? just started learning t3 stack and its amazing so far, just need to grasp few more concepts regarding trpc

    • @bigboylkjh
      @bigboylkjh Рік тому +1

      I would like also see more works like that 😊

  • @brianfarley2723
    @brianfarley2723 Рік тому +1

    @+- 25minutes. If your on page top.ts if the .topic is underlined with red showing error, restart your ide.
    Or CTRL + SHIFT + P then type: restart TS Server
    Not sure why you need to do this, but it works.

  • @laliluleloMG
    @laliluleloMG Рік тому +1

    Great Tutorial Jack!!! you and Theo B. are just awesome
    Can anybody tell me how to make my terminal exactly as the one Jack uses
    with the git branches and colors i love it

  • @bendevweb89
    @bendevweb89 Рік тому +1

    Great project, very interesting! 🤯
    Even if I'm a little disappointed because I can't export my environment variables. 14:43

    • @octaviusbytes
      @octaviusbytes Рік тому

      export GITHUB_CLIENT_ID="YOUR_ID_HERE"
      export GITHUB_CLIENT_SECRET="YOUR_SECRET_HERE"

  • @GustavoLemes121213
    @GustavoLemes121213 Рік тому

    Hello and thank you for this amazing tutorial!
    I have a small question the app doing SSR on the pages for the fetched data?
    I tried to check the source code on the browser and it does not seem to be rendering the fetched content on the server side.
    Is there a simple way of doing this while preserving the react-query cache?
    Thanks!!

  • @clarkhinchcliff7824
    @clarkhinchcliff7824 Рік тому +1

    Great video, Jack. Really helped me get ramped up quickly with a CRUD application in a single day.
    One minor question,
    Why use RouterOutputs["modelName"]["getAll"][0] against pulling the type directly from '@prisma/client'?

    • @jherr
      @jherr  Рік тому +3

      Because what I'm actually doing is calling TRPC, and not Prisma directly, so IMHO I should rely on the TRPC types because the TRPC layer could (but isn't in this case) be doing a little something extra with the Prisma output.

  • @pananasik4317
    @pananasik4317 7 місяців тому

    If you have a problem with Unsafe return at 24:39, just restart ESLint server (Ctrl + shift + P => ESLint restart server)

  • @mohammed.haydar
    @mohammed.haydar Рік тому +2

    Can you please do a tutorial how to professionally customize terminal to be exactly like that you have?

  • @jjrise
    @jjrise Рік тому +3

    this type of content is the best, I really enjoy the code walkthroughs. T3 can be a bit confusing when new, especially relating to trpc and nextauth. One thing I did notice different is using refetch instead of .invalidation. Is there a difference between those two approaches for the onSuccess part of your mutations?

    • @jherr
      @jherr  Рік тому +1

      Yeah, I probably should have used the invalidation stuff, whoops.

    • @szluganaware
      @szluganaware Рік тому

      How does the invalidation work? Where can I read about it or see some examples?

    • @jherr
      @jherr  Рік тому +1

      @@szluganaware tanstack.com/query/v4/docs/react/guides/query-invalidation It's super nice, basically you can say; when this query succeeds then refetch this other query automagically.

    • @szluganaware
      @szluganaware Рік тому

      @@jherr Thank you!

  • @tiagoclarenc9911
    @tiagoclarenc9911 7 місяців тому

    Hi Jack and thanks a lot for the great content !
    I followed along until adding new topics and refetching them on the page. Although it works great in localhost I get a 401 unauthorized in vercel prod environment when trying to create a topic. Any idea what could be causing the discrepancy in prod ?

  • @malachiconstant2756
    @malachiconstant2756 Рік тому

    Been wanting to try T3 for a while now. How does it compare with Blitz (their Next implementation, since now Blitz is “agnostic”)? On the surface they seem quite similar except for Next Auth. They both use Prisma, and Blitz’s RPC is similar to TRPC with less boilerplate

  • @karenamicone6591
    @karenamicone6591 Рік тому

    Hi, Jack! Great video, as always! Thanks. I have a question about Next Js. It is possible to do microfrontends with 13 version?

    • @karenamicone6591
      @karenamicone6591 Рік тому

      I mean, something similar to module federation? :)

  • @tomaszbazelczuk4987
    @tomaszbazelczuk4987 Рік тому +1

    How easy is that 😊 Really great staff!!!

  • @megamind452
    @megamind452 Рік тому

    Hey jack, can you please make a video on how to do role based authentication using next-auth and authorization in nextjs .

  • @shozdott
    @shozdott Рік тому +1

    I'm pretty new, can you elaborate on which env variables were set when deploying to vercel? you sorta just skipped right through them ty :) I know the database , did you change the next-auth url from localhost etc?

  • @piyushaggarwal5207
    @piyushaggarwal5207 Рік тому +1

    I can feel the difference that is there in the three months since the video released.

  • @Svish_
    @Svish_ Рік тому +1

    19:56 Instead of excluding the whole `tailwind.config.cjs` file, I think you could also just add `// @ts-ignore` on the line above the error?

  • @stevegoodwin2036
    @stevegoodwin2036 Рік тому

    What setup you using in your vscode terminal? Looking to replicate TIA

  • @07Weka
    @07Weka Рік тому +2

    This is a super cool and clear tutorial. One thing I noticed when experimenting with this is that there is a significant lag following saving of a topic or note before they display in the list, as it needs to first save and refetch from the database.
    There are probably many solutions, but what would be the best approach to displaying a newly added tag in the list before syncing it to the database? Does trpc support optimistic updates?

    • @user-im3nr6he9m
      @user-im3nr6he9m Рік тому

      I guess useQuery has optimistic result. Try to config the request somehow.

  • @AstralHorse_UA
    @AstralHorse_UA Рік тому +1

    Could you please share you configuration for chrome, I like your right tab bar, that’s looking awesome. Also good to see more great extensions. What do you use for creating user friendly diagrams?

    • @yoz0__
      @yoz0__ Рік тому +1

      It’s Arc browser

  • @jonathangoodman9751
    @jonathangoodman9751 Рік тому +4

    Thanks for putting together this video. Wondering if anyone else has hit an eslint error at 24:55?
    Unsafe member access .findMany on an `any` value.
    Unsafe member access .create on an `any` value.

    • @fzrte
      @fzrte Рік тому +4

      Just reload VS Code. Should do the trick

  • @mackmaier5419
    @mackmaier5419 Рік тому

    Would love to see your approach to testing this - integration testing NextAuth and TRPC, what functionality you think is worth unit testing etc.

  • @goshmain982
    @goshmain982 Рік тому

    26:35 -why do we need to check for enabled: user, if we are querying protectedRoute?