Building an email client with the Next.js App Router & Postgres

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 109

  • @vimtor
    @vimtor 11 місяців тому +134

    Great video! As feedback, I think the screen studio effects are excessive for this type of video. I feel a bit dizzy after watching it.

    • @leerob
      @leerob  11 місяців тому +24

      Yeah I think I agree, first time I've tried using this out but don't know if I love it for longer videos

    • @crampssss
      @crampssss 11 місяців тому +26

      ​@@leerob Also the delay between the animated cursor vs the highlights when hovering is jarring 😵‍💫

    • @aryan.prince
      @aryan.prince 11 місяців тому +9

      @@leerobit’s the delayed cursor that’s most jarring. and it would’ve been nice if the screen zooms were a little more slower and steady for longer videos like this

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

      What software is that?

    • @aryan.prince
      @aryan.prince 11 місяців тому +3

      @@danielbark It’s called Screen Studio. I don’t think I can post links here but it’s made by this guy called Adam Pietrasiak

  • @gokulkrishh
    @gokulkrishh 11 місяців тому +16

    Good to see server actions in action. I am planning to use server actions in my new nextJS project. This was a good walk through.

  • @roberth8737
    @roberth8737 11 місяців тому +15

    Great video - interesting idea placing some components into layout to prevent the refresh/revalidation. This makes me think server side is more viable for dashboard like interfaces than I previously thought - more examples in this line would be great.

    • @leerob
      @leerob  11 місяців тому

      Yeah, normally it has been hard to get that "SPA like" behavior, but with the App Router this becomes really easy. Plus, you can stream in your UI + send less JS to the client, so it's faster too :)

  • @LocalCanApp
    @LocalCanApp 11 місяців тому +2

    Love this high level overview video format, with the most interesting bits explained! As opposed to full tutorial which could have been long and not too exciting.

  • @MrHellmager
    @MrHellmager 11 місяців тому +3

    As good as the animations looked they were a little distracting for me personally. For the demo it was fine but for the code review maybe just a regular viewing with slightly zoomed in would be nice. Just my opinion, thank you for introducing to me v0 it looks very interesting.

  • @sumansahoo8975
    @sumansahoo8975 11 місяців тому

    It was an informative video. Would love to see more like this, explaining concepts and features by projects.

  • @Shawn-Mosher
    @Shawn-Mosher 11 місяців тому

    Great video Lee! Awesome to see it all come together! Gotta love Nextjs

  • @oussamasadiki7377
    @oussamasadiki7377 11 місяців тому

    i haven't played with Next13 in a while, since Next14 was released lately i was like why not building this small app with you. Had lot of fun and learned lot thanks Lee for those fun and useful tutos as usual keep it up

  • @TheIpicon
    @TheIpicon 11 місяців тому

    more content like this!
    it was a great video and very educational even for those who write Next every single day!🥳 (blazing fast too)

  • @richchar6478
    @richchar6478 11 місяців тому

    Dope video, loved the effects and presentation style

  • @MrGarfi
    @MrGarfi 8 місяців тому +1

    Thanks for sharing this, helps tremendously! Might add though, that the code linked isn't the same structure though so its a little difficult to follow, e.g. the layout files aren't doing what you say in the video.

  • @real-oppenheimer
    @real-oppenheimer 11 місяців тому +3

    I am really curious how we're going to use *real* (and not the native) client-side validation with useFormState. Without it, you'll always have to wait for the server action response to know your field is valid. What if it is invalid (e.g. "min. 2 characters"), you add some characters to make it valid? Without client-side validation, you only see your validation status after a submit request - and I bet you don't want to send a request for every keystroke. Sure, you have to validate in the server action anyways, but I have yet to see a solution for how to ALSO do the validation on the client (especially for re-validation on input) with React's new form hooks.

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

    Hi Lee, can make a video specifically about the four caching strategies that NextJS 14 offers, with examples? It’d be great if you can also explain the different invalidation techniques and their pros and cons.

  • @nick-ui
    @nick-ui 11 місяців тому

    Lee, Make more videos like this, thats amazing

    • @leerob
      @leerob  11 місяців тому

      Thanks!

  • @iaremarkus
    @iaremarkus 3 місяці тому

    aaaaaaaaaand I have motion sickness 🫠 Great run down, thank you. Perhaps a little less cursor chasing/panning though?

  • @isaackoz
    @isaackoz 11 місяців тому

    I like the Mickey Mouse glove cursor you got there

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

      Thank you I made it myself (jk it's Screen Studio)

  • @mikerudge
    @mikerudge 11 місяців тому

    Love your videos. Just wanted to echo some of the other comments on the animation flying around. I found it really quite difficult to watch.

  • @rodgetech
    @rodgetech 11 місяців тому

    Hey Lee, great vid as usual. May I ask, what mic and camera setup you're using or recommend for someone interested in doing some amazing videos like yours, thank you!

  • @M7ilan
    @M7ilan 9 місяців тому +2

    Hello, I have a similar app to this but with animation and when I click for example an email in your app the FirstColumn Component re-renders which is annoying to have the animation happen on FirstColumn on every email click. I use parallel route instead of component and Optional Catch-All Segments.

  • @HaNdTriXo
    @HaNdTriXo 11 місяців тому

    Regarding the scroll position niceity: Rerending would not be a problem regarding the scroll position. Remounting would be a problem 🤓.

  • @yunglee.
    @yunglee. 11 місяців тому

    Nice video! Could you go through Server Actions in more detail? Especially how to implement error handling

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

    I have been having big problems finding a postgres to nextjs project that dosen't use a ORM. Thanks!

  • @osmanakar2507
    @osmanakar2507 11 місяців тому

    Thank you for the content 🙌 quick question, why did not you prefer parallel routes?

  • @bagfleet
    @bagfleet 11 місяців тому

    Great vid, Lee!
    Can’t wait to use v0 😅

  • @dan-powell
    @dan-powell 11 місяців тому

    Is pretty fantastic stuff!
    Was toying around with some concepts today. Would be slick if server-fetched data like vercel/postgres queries could be linked to a tag in cache instead of "just" the route
    Hoping that I'll be writing fetch("/api/xxxx") less and less often

    • @leerob
      @leerob  11 місяців тому

      Yeah we're working on making this easier than today where you need to use unstable_cache to add tags nextjs.org/docs/app/api-reference/functions/unstable_cache

    • @dan-powell
      @dan-powell 11 місяців тому

      Not tryna be an ungrateful gimme-more guy! The feature sets y'all are pumping out are fantastic! Will check out unstable_cache as it seems like what I was after.
      For my current use case (a baby admin zone website builder w/ only a few tables) it isn't too tricky to know where data is out-of-date. I would expect that with bigger projects this would be a great add as it becomes near-impossible to remember where all data is being used.

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

    Hi there nice vid, although I must say the effect makes me feel nauseous. I like the zoom on the code, but it’s too many transitions

  • @gmoniava
    @gmoniava 10 місяців тому +1

    on github repo there is no layout component inside f/[name]

  • @Redyf
    @Redyf 11 місяців тому

    What software do you use for video editing? Great video btw

  • @aaronmcadam
    @aaronmcadam 11 місяців тому

    Fantastic video! And yeah please make some more videos ❤❤❤❤

  • @kevinbatdorf
    @kevinbatdorf 11 місяців тому

    Really cool. Can you do file attachments with Vercel Blob next?

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

    Great video! Is it true that as soon as you add any authentication, the automatic cache doesn't work anymore? Eagerly awaiting more docs on unstable_cache (and for it to get stable :D), or does sql`` from vercel postgres use fetch under the hood?

    • @leerob
      @leerob  11 місяців тому +2

      Vercel Postgres uses fetch, but for non-fetch based things, we're working on other caching improvements next to simplify that story. unstable_cache is okay but we can do better :) And it's fine to have authentication and dynamic rendering, while still having cached data. If you wanna see a tutorial for that, we have a new course on nextjs.org/learn

  • @antontraceur
    @antontraceur 11 місяців тому

    Great job! Love your videos.
    Btw how would you reset the scroll if the layout is not re-rendered?
    Like on a regular website, I have a header & footer in the layout so when navigating between pages the scroll stays the same. Ideally it should reset to the top after new page is rendered isn't it?

  • @srymisclick
    @srymisclick 11 місяців тому

    Why would you be joining users to obtain recipient data in Sent folder? That should just be a part of the email itself, otherwise it means you're adding everyone I ever send emails to as users. Same goes for Inbox, fetching sender details from users? Everyone that ever sends me an email is saved as a user? Unless I'm missing something, this makes little sense...

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

    Hi Lee. Can we use server action (not form action) to mutate data on the server? something like setting a loading state to true inside a form submit handler and then calling the server action mutation and await it, then setting the loading state again to false. I thought it's cool because I have a full type safety of whatever the server action mutation is returning. That way I can return some error object and show it in the client

  • @XahidEx
    @XahidEx 11 місяців тому

    That was something so incredible, man

  • @xJaKoBz
    @xJaKoBz 11 місяців тому

    Nice video. Thanks for sharing.
    Quick question. Ive seen alot of those intros with the same style of editing to showcase the application/webpage. How did you create that, if you dont mind me asking? :)

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

      Curious about the same question, since I do a lot of tutorials :)

    • @leerob
      @leerob  11 місяців тому

      Screen Studio

  • @0xtz_
    @0xtz_ 11 місяців тому

    😮 we want more of those videos please
    Just one thing the I can't focus on the video bc it keeps following the mouse hhhh 😅

  • @ZlatkoIliev-s4j
    @ZlatkoIliev-s4j 11 місяців тому

    Can you please make a tutorial for that? Including the backend, I would love to see this with Nest.js for a backend.

  • @TomasJansson
    @TomasJansson 11 місяців тому

    Great video. Quick question, what did you use to disable JavaScript? It always take me some time finding it in the devtools.

    • @leerob
      @leerob  11 місяців тому

      Command + Shift + P

    • @TomasJansson
      @TomasJansson 11 місяців тому

      @@leerob waaat. So much time would have been saved if I knew about this before 😆. Thanks!

  • @quickindiarecipe
    @quickindiarecipe 11 місяців тому

    would be great if you would have connected gmail or outlook and get those emails.

  • @thefamousdjx
    @thefamousdjx 11 місяців тому

    Hi just curious, is this also possible with Remix or just React? Or its a unique feature of nextjs or is it just way easier in nextjs? Really looking for motivation to learn nextjs/remix

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

    hello, a question what does revalidatePath('/', 'layout') mean ? is the 'layout' a path ?

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

      It's refreshing all the data, I could also do cache tags if I wanted

  • @jexxiewoo8390
    @jexxiewoo8390 11 місяців тому

    The caching benefits you mentioned, are they Vercel specific things Or any VPS NodeJS env can have as well?

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

      Works when self-hosting, too!

  • @ShahJahan_NNN
    @ShahJahan_NNN 11 місяців тому

    who edits your video, too smooth is this ai, or high paying editor

  •  11 місяців тому

    Thanks for the share. But could you please keep your screen stable while moving the cursor, my eyes are really hurt after finish watching your video!

  • @slikBASSslik
    @slikBASSslik 11 місяців тому

    I am interest to see how you would handle file and screenshot attachment

  • @kristianrykkje4255
    @kristianrykkje4255 11 місяців тому

    Great video!

  • @WebWithWes
    @WebWithWes 11 місяців тому

    Great video, what about windows users for the command + enter ? would it just be ctrl + enter ?

    • @leerob
      @leerob  11 місяців тому

      Yeah that sounds correct

  • @Joystickmx
    @Joystickmx 11 місяців тому

    What do you use yo récord and make the camera zoom follow the cursor? I would love to know, thank you!

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

      Screen Studio

    • @Joystickmx
      @Joystickmx 11 місяців тому

      thanks @@leerob

  • @existentialquest1509
    @existentialquest1509 11 місяців тому

    hi Lee don’t mean to be critical and hope you this feedback ina positive sense -if you could build simple app which shows how to login using email and password ., with email verification and two factor auth - it would be much more useful - and no i don’t want to use an external auth service - nor use next auth - which frankly looks like a hobby project - next js badly needs the kind of dev ex that laravel provides

    • @leerob
      @leerob  11 місяців тому

      next-auth isn't a hobby project :) Our official tutorial teaches user/pass login this way! nextjs.org/learn

  • @ray-lee
    @ray-lee 11 місяців тому

    why use onSubmit with the deleteEmail action?

  • @jeanpierrejeri6425
    @jeanpierrejeri6425 11 місяців тому

    What's the difference between using router.refresh and revalidatePath? could you explain the use cases please :)

    • @leerob
      @leerob  11 місяців тому

      You shouldn't need to use router.refresh, in general revalidateTag is going to be the best option for the most granular caching, and then revalidatePath would be the next choice.

  • @JohnMcclaned
    @JohnMcclaned 11 місяців тому

    When is v0 out of private access?

  • @seafrostgt9277
    @seafrostgt9277 11 місяців тому

    but the caching works because there is no authentication right? reading headers would remove the default cache

    • @leerob
      @leerob  11 місяців тому

      If you wanted to read headers, the page would render dynamically, but you can still have the *data* be cached. So page transitions can still feel fast. We're also working on optimizing to make as much of the page static as possible in Next.js 14 nextjs.org/14.

    • @leerob
      @leerob  11 місяців тому

      If you wanted to read headers, the page would render dynamically, but you can still have the *data* be cached. So page transitions can still feel fast. We're also working on optimizing to make as much of the page static as possible in Next.js 14 nextjs.org/14.

  • @stevenkao4800
    @stevenkao4800 11 місяців тому

    What is the cache mechanism used here (for data fetching)? I see in NextJS there are different cache mechanisms (Request Memoization, Data Cache, Full Route Cache, Router Cache) but since 'fetch' wasn't used in the code, I wasn't sure how the code cache the data.

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

      Vercel Postgres is using `fetch`. So it would work the same if you were using `fetch` directly. If you're not using `fetch`, you could use this nextjs.org/docs/app/api-reference/functions/unstable_cache

    • @stevenkao4800
      @stevenkao4800 11 місяців тому

      @@leerob got it. thanks for the info

  • @monireol
    @monireol 11 місяців тому

    Thnx

  • @babakmahmoodi8741
    @babakmahmoodi8741 11 місяців тому

    Please add socket support to next js

  • @bobobo1673
    @bobobo1673 11 місяців тому

    What? How are you using await in a component?!

    • @leerob
      @leerob  11 місяців тому

      nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating

  • @RandomMcLain
    @RandomMcLain 11 місяців тому

    [00:00] 📧 Building an email client with Next.js and Postgres
    - Building an email client with Next.js and Postgres.
    - Taking advantage of caching for improved performance.
    [00:57] 🏗 Starting with Create Next App and layout setup
    - Initiating the project with Create Next App and configuring Tailwind and pnpm.
    - Designing the initial layout with three columns: folders, email list, and email view.
    [02:42] 🔄 Implementing shared layout and server component
    - Using shared layout to maintain scroll position between route changes.
    - Utilizing server component for the email column to improve performance.
    [04:29] 📬 Fetching and displaying emails in folders
    - Retrieving emails from the database based on folder name.
    - Displaying emails with conditional rendering for special folders.
    [05:41] 📝 Creating a new email with server-side validation
    - Designing a form for composing emails with type-ahead functionality for recipients.
    - Implementing client and server-side validation for form inputs.
    [08:19] 🗃 Handling database transactions for email composition
    - Managing database transactions for sending and receiving emails.
    - Updating data and redirecting after successful email creation.
    [10:35] 🚀 Progressive enhancement with Server Actions
    - Demonstrating Server Actions without JavaScript dependency for sending emails.
    - Showcasing the application's functionality without JavaScript enabled.
    Made with HARPA AI

  • @jpainam
    @jpainam 11 місяців тому

    Pl. update the github code

  • @elvispalace
    @elvispalace 11 місяців тому

    hi leo 🖐️

  • @hotwings9382
    @hotwings9382 11 місяців тому +2

    couldve just used php

    • @leerob
      @leerob  11 місяців тому

      this tbh

  • @xantee
    @xantee 9 місяців тому

    Can you please when you demo things stop zooming in and out all the time. My head hurts watching this zoom action :S.
    Thanks :D

  • @rohithn-76
    @rohithn-76 10 місяців тому

    Next js router is too fast ..

  • @mikhacavin
    @mikhacavin 11 місяців тому

    i thought it was email system 💀

  • @StephenRayner
    @StephenRayner 8 місяців тому

    Can’t people reply? 😂

  • @mr.anonymous7184
    @mr.anonymous7184 11 місяців тому

    Test 123 abc

  • @birarakisarap
    @birarakisarap 11 місяців тому

    Instead of running postgres on frontend, why are not there simple things since the dawn of internet like sitemaps indexes and i18n path routing? Sloppy versions, half baked features and useless things.

    • @leerob
      @leerob  11 місяців тому

      Sitemap: nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap
      i18n: nextjs.org/docs/app/building-your-application/routing/internationalization

  • @user-ieffc
    @user-ieffc 11 місяців тому

    video is hard to watch

  • @tiagoagm
    @tiagoagm 11 місяців тому

    Can wait for v0