Your first full-stack Next.js project (Server Components, Server Actions, Suspense, Kinde)

Поділитися
Вставка
  • Опубліковано 6 лип 2024
  • IMPORTANT: create the Kinde account here: bit.ly/3QOe1Bh (paid sponsorship).
    Disclaimer: this is a sponsored video (paid). It's your responsibility to evaluate safety, accuracy and other relevant parts of the reviewed product.
    👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
    Final code: github.com/ByteGrad/nextjs-fi...
    Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
    👉 Check out Kinde for auth and more bit.ly/3QOe1Bh
    👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
    👉 Professional JavaScript Course: bytegrad.com/courses/professi...
    👉 Professional CSS Course: bytegrad.com/courses/professi...
    👉 Web development roadmap 2024 & 2025: email.bytegrad.com
    👉 Email newsletter (BIG update soon): email.bytegrad.com
    👉 Discord: all my courses have a private Discord
    👉 Kinde: check out Kinde for auth and more bit.ly/3QOe1Bh
    ⏱️ Timestamps:
    00:00 Intro
    02:59 Setup
    04:31 Fresh Next.js app lookaround
    08:57 Routing
    10:25 Global styling with Tailwind CSS
    12:58 Basic page content & styling
    15:26 Header & Footer
    18:37 Image component in Next.js
    22:09 Nav with routes
    23:22 Link component in Next.js
    24:06 Finish header
    25:30 Finish footer
    27:40 Container
    30:21 Metadata
    31:12 Active nav link styling
    32:11 Server components vs Client components
    36:14 Data fetching
    40:39 Next.js architecture overview
    42:08 Dynamic routes (post id)
    46:14 Params (for data fetching)
    47:49 Suspense & Streaming (loading.tsx)
    50:58 Suspense component (more granular)
    54:31 Upvote (Client component example)
    58:49 Next.js client-side features (hooks, events, state)
    01:00:45 Create post page
    01:04:36 Server action
    01:13:37 Authentication to protect route (Kinde)
    01:21:08 Middleware auth (Kinde)
    01:23:14 Logout button
    01:25:59 Finish create post page
    01:30:04 Database & ORM in Next.js architecture
    01:30:50 Prisma & SQLite setup
    01:37:47 Add data to database
    01:38:38 Getting data from database
    01:41:10 Not found page
    01:42:44 Caching & Revalidating (revalidatePath)
    01:48:56 Auth for server actions (Kinde)
    01:51:30 Static & Dynamic rendering
    01:54:36 Deploy to Vercel pt. 1 (Push to GitHub)
    01:56:15 Deploy to Vercel pt. 2
    01:58:32 Vercel Postgres database
    02:03:49 Kinde Auth for production
    #webdevelopment #reactjs #nextjs

КОМЕНТАРІ • 73

  • @ByteGrad
    @ByteGrad  Місяць тому +7

    Hi, my latest course is out now (Professional React & Next.js): bytegrad.com/courses/professional-react-nextjs -- I'm very proud of this course, my best work!
    I'm also a brand ambassador for Kinde (paid sponsorship).
    👉 Check out Kinde for authentication and more bit.ly/3QOe1Bh

    • @bennetukoh3506
      @bennetukoh3506 Місяць тому +1

      My salary for last month will definitely go for this course once I get paid. I am convinced beyond doubt that this is all I needed to break into tech.

  • @TenzDelek
    @TenzDelek 6 годин тому +1

    half way through and have to admit, it is one of the best nextjs course. maybe it due to the fact I have previous small knowledge of it but this guy right here clear up all the doubts in just 2 hrs.. never forgetting server action and server components from now on haha

  • @enn_nj
    @enn_nj Місяць тому +14

    I am from Indonesia, and i love all off your video, thank you so much 👍🏻 my dream is to be the best developer like you😅

    • @simonpetrus3089
      @simonpetrus3089 Місяць тому +1

      Saya juga dari Indonesia.. video2 Bytegrad emang the best lah

    • @theeshi1
      @theeshi1 Місяць тому +1

      You will bro keep learning.
      ❤ from Sri Lanka

  • @paulnjogu3122
    @paulnjogu3122 Місяць тому +5

    If you want to master nextjs fundamentals, Bytegrad is the best tutor. You will learn it within a month. Big up Byte💪

  • @dysper971
    @dysper971 7 днів тому +1

    Thank you for this course. Everything is very clear. I had a hard time understanding server actions but now with simple examples everything is better.

  • @bennetukoh3506
    @bennetukoh3506 Місяць тому +3

    For the first time i really have a sense of how things fit in from start to finish. Still saving to enroll to your course. Thanks for all you do, ByteGrad. Much Love!

  • @kashmirtechtv2948
    @kashmirtechtv2948 Місяць тому +1

    have completely watched this tut.100% recommended..........kindly post more videos like this.....we want you as our sole teacher to become an expert in NEXT JS. thanks

  • @mememihnea
    @mememihnea Місяць тому +2

    This is just a great tutorial for a next.js beginner or intermediate developer.
    You are explaining in simple terms the most important concepts while also giving examples on how to achieve certain things in a more efficient or cleaner way.
    Thanks for this!

  • @ygvanz
    @ygvanz Місяць тому +1

    Just started to learn Next and this came up. Appreciate it!

  • @mayenstudios3955
    @mayenstudios3955 11 днів тому +1

    Thanks for all your quallity content :)

  • @desmondcoffie65
    @desmondcoffie65 24 дні тому +1

    awesome, just awesome. I went through the documentation and a few articles but it did not really click for me and I found this video which has just detailed everything. Greate job done

  • @De_Mysteriis
    @De_Mysteriis 18 днів тому +1

    This video was so clear and focused it really gave me a lot of confidence to dive into Next JS. Much thanks 👊🏻

  • @anshubhaskar9870
    @anshubhaskar9870 Місяць тому

    Finally my doubts regarding server components and server actions are cleared.
    Thank you ❤️

  • @404-not-found-service
    @404-not-found-service Місяць тому +3

    I like how interesting your material is, a hug and keep it up!

  • @edgar.espinoza
    @edgar.espinoza 26 днів тому +1

    Great tutorial! Thank you... You have a talent for teaching. Keep up the great work!

  • @MrValVet
    @MrValVet 12 днів тому +1

    Great tutorial, thank you!

  • @adiancuevasmartinez717
    @adiancuevasmartinez717 Місяць тому +1

    you help me a lot with this video man. thank you. the best 2h learning next.js. it's just excellent💯

  • @alexandersmotrikov9007
    @alexandersmotrikov9007 Місяць тому +1

    Thanks, Wesley! another great video.

  • @alejandroforteshidalgo9771
    @alejandroforteshidalgo9771 Місяць тому +1

    This is amazing !!!! When will you make a react 19 tutorial ??

  • @DctimeR
    @DctimeR Місяць тому +1

    Awesome work :)

  • @olegsirbu2
    @olegsirbu2 24 дні тому

    awesome video!

  • @theintjengineer
    @theintjengineer Місяць тому

    THANK YOU!

  • @mememihnea
    @mememihnea Місяць тому +5

    I followed this tutorial step by step but I have a problem with Kinde.
    I'm not sure why I get a Invalid URL 500 error when trying to access a route that is hosted by Kinde.
    This also happens if I follow the docs from Kinde.
    I already tried twice to set it up and also watched your other Auth tutorial but nothing is working.
    Is there a hidden setting in Kinde dashboard? Did I miss anything?

    • @mememihnea
      @mememihnea Місяць тому +2

      Apparently the problem was with the organisation that I created (I don't know what was the actual problem).
      Creating a new organisation in the Kinde dashboard and re-connecting Kinde to my existing next project made everything work

    • @mememihnea
      @mememihnea Місяць тому

      UPDATE 2:
      I've tried the middleware thing and was surprised that it didn't work, failing with the exact same error as before.
      Once I was tired of trying everything possible to make it work I wanted to see if the old solution with const { isAuthenticated } = getKindeServerSession(); works.
      Was very surprised to see that even this one was not working, again.
      I guess I'm done with Kinde

    • @MimeticGoat
      @MimeticGoat Місяць тому +2

      I received the same error(500, malformed URLs) - my organization was default, never added one. Played around with Kinde docs and their dashboard, then got 404s. Ended up just using NextAuth.

    • @safwanmohamed9135
      @safwanmohamed9135 Місяць тому

      It works when I changed the "create-post" to "localhost:3000/create-post"

    • @keithjohnson5709
      @keithjohnson5709 25 днів тому

      For me, I just had to clear my old Kinde cookies and then it finally worked

  • @dananjayachathuranga7113
    @dananjayachathuranga7113 15 днів тому +1

    thank you

  • @viniciusm.m.7822
    @viniciusm.m.7822 Місяць тому

    Thanks!!!

  • @jfhandfield
    @jfhandfield Місяць тому +1

    Another great video from you Byte. Thank you. I have a quick question. Let's say you have 2 different DB to hit up in prisma, with 2 different schema how would you do it in your db.ts ?

  • @sushantthapa7007
    @sushantthapa7007 20 днів тому

    You are the best 💖💖. Who agrees he's the best tutor? -> 👍

  • @MdShafkatHussinTanvir
    @MdShafkatHussinTanvir Місяць тому

    Thaks for this tutorial. It is really helpful. What is the procedure if we want to show the user information beside every post? Should we save the user information in our local db? What is the procedure for that?

  • @starlord7526
    @starlord7526 Місяць тому

    can anyone please post the code for formData validation in actions function using zod? I tried create a schema, parsing the formdata but I get error:
    Error: Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported.

  • @johnjohn7023
    @johnjohn7023 Місяць тому

    can you do a video on using server action with next-safe-action? Also was wondering how to fetch data using react-query with RSC.

  • @luciendelgrange1277
    @luciendelgrange1277 11 днів тому

    Can we fetch with intervel inside server component ?

  • @Nafisatou99
    @Nafisatou99 Місяць тому

    Why do we need to write "use server", for server actions specifically, although I understood it was the default behavior ?

  • @taunado
    @taunado Місяць тому

    Thanks. Drizzle > Prisma?

  • @rahulchourasiya4148
    @rahulchourasiya4148 Місяць тому

    Can you please make a video for single sign on, like centralised authentication website using next-auth, without any workos or any paid library for multiple saas website

  • @_AshishMohanty
    @_AshishMohanty Місяць тому +1

    I am getting this error while setting up the middleware
    TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function

    • @DepTenzey
      @DepTenzey Місяць тому +1

      Its because of LogoutLink try importing from other component it will work or remove and try once

    • @_AshishMohanty
      @_AshishMohanty Місяць тому +1

      @@DepTenzey thanks

    • @DepTenzey
      @DepTenzey Місяць тому

      @@_AshishMohanty hope it works!.. you can create new file in component and move those form along LogoutLink and make use client...

    • @_AshishMohanty
      @_AshishMohanty Місяць тому

      @@DepTenzey yeah I have figured it out

  • @khalidnadish
    @khalidnadish Місяць тому

    i like it

  • @sivadhanushuppalapati4041
    @sivadhanushuppalapati4041 Місяць тому

    Dear Wesley could you please tell me how to get in touch with you for collaboration.

  • @cant_sleeeep
    @cant_sleeeep Місяць тому

    wow.

  • @danielmelo9744
    @danielmelo9744 19 днів тому

    I'm receiving a 500 error when making a request to Kinde. How can I resolve this?

    • @danielmelo9744
      @danielmelo9744 18 днів тому

      It worked for me when I changed the logic to the middleware.

  • @usehook
    @usehook 22 дні тому

    where is a part of App router

  • @khalidnadish
    @khalidnadish Місяць тому

    wow

  • @khalidnadish
    @khalidnadish Місяць тому

    i want fundamentals of next js

  • @GreaterNepal-cf6ll
    @GreaterNepal-cf6ll 15 днів тому

    i love your videos Bytegrad but , you always use prisma orm , Why not drizzle orm ? And please make one Complete Nextjs ( new features + secuirty + seo + don't do this mistake in nextjs while doing this )video with Drizzleorm and postgres and also with Admin Dashboard.. please

  • @palaceofgains7782
    @palaceofgains7782 Місяць тому

    kinde vs lucia ....your views

  • @whysumancode
    @whysumancode Місяць тому

    01:23:23

  • @shoaibshaikh3651
    @shoaibshaikh3651 Місяць тому +2

    thanks, can you please make the next project on "video streaming with S3, cloudfront and nextjs" also with uploading/retrieving videos from API and show them on front end with optimisation, etc like simple youtube app

  • @miksterdam
    @miksterdam Місяць тому

    Wesley your English sounds so Dutch… but I see on your website that you are from Poland? 🇳🇱💔

  • @edward-vonschondorf-dev
    @edward-vonschondorf-dev 25 днів тому

    as much as i was enjoying this video, i had to stop watching it because kinde wouldn't work for me. At first it sort of did in that it would redirect me to a login page but i couldn't login using github. So i tried email and password and it errors out every time i try to click create post. I didn't change anything in my code at all so i changed it back to github and it is still doing the same thing. Not a good first impression of kinde.

    • @ByteGrad
      @ByteGrad  25 днів тому

      Hi, please double-check the import statements are correct for Kinde, I find auto-complete can give very subtle wrong suggestions

    • @edward-vonschondorf-dev
      @edward-vonschondorf-dev 24 дні тому

      @@ByteGrad so i tried it again and it worked in that i could get to the login page but can't log in or register. just get an authorization error or something saying that i could only do this once. Tried re-doing everything over again and it just gives me a 500 error when i click create-post. Don't really get what i'm doing wrong on my end...

  • @Alex-bc3xe
    @Alex-bc3xe Місяць тому

    First

  • @Real_Life126
    @Real_Life126 Місяць тому +1

    Sir aap Hindi me pathao

    • @punnettsquares
      @punnettsquares Місяць тому

      ua-cam.com/video/R-Epbgmy5ac/v-deo.html&ab_channel=CodeStepByStep

  • @ab_semi
    @ab_semi Місяць тому +1

    Good videos! How can I connect with you, ByteGrad?

    • @ByteGrad
      @ByteGrad  Місяць тому

      Hi, thanks! Email me at support@bytegrad.com

  • @krishnaSahu-dy6ho
    @krishnaSahu-dy6ho Місяць тому

    hi @byteGrad stuck at kinde auth at - 1:20:44 followed all the steps but gets HTTP ERROR 500 can please help

    • @keithlamontdavis8047
      @keithlamontdavis8047 20 днів тому

      I had the same problem. It looks like there has been a change in NextJS and that part of the video and the Kinde docs are out of date. The redirect url must be an absolute path. So "/create-post" won't work. It must now be "localhost:3000/create-post".