Next.js with a separate server - good idea?

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

КОМЕНТАРІ • 175

  • @ByteGrad
    @ByteGrad  5 місяців тому +3

    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

  • @kocourekkocourek-pq2tm
    @kocourekkocourek-pq2tm 7 місяців тому +54

    I would like to see big next.js course/project with a separate backend. Thank you for providing us so valuable content.

  • @alexenax1109
    @alexenax1109 7 місяців тому +50

    It would be super interesting to see the same implementation with an open source framework like next-auth. However, great video!

    • @naylord5
      @naylord5 7 місяців тому +3

      this

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

      this 2

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

      that

    • @ozdadev
      @ozdadev 5 місяців тому +3

      This is needed, and most of the tutorials available doesn't use easily maintainable fetching mechanisms

  • @imkir4n
    @imkir4n 7 місяців тому +19

    Wesley, this is the type of unique content I'm expecting from your channel. It's awesome! I hope you will also cover custom authentication without any third-party libraries for Next.js with a separate server.

  • @CodeZakk
    @CodeZakk 7 місяців тому +18

    Yes this type of video is what i was looking for months on youtube and i can't find any proper video talking this much detail. Thanks for bringing in. Also you need custom server if you use Graphql api. If you use inside nextjs you must use external services. Thanks in advance❤❤❤🎉

  • @maacpiash
    @maacpiash 7 місяців тому +22

    I only host a Next.js app on Vercel (or Netlify) if it's a small or personal project. For serious projects, I always host it on a VPS instance with Node.js, PM2, Nginx for reverse proxy, and Certbot for SSL certificates.

    • @Vantivify
      @Vantivify 5 місяців тому +2

      do you have any guide for such tech stack setup? I would appreciate !

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

      why you think Vercel is not good for production? pricing? Please share more ideas. Thanks.

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

      I can relate

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

    Great video! This is something that is usually glossed over in Next tutorials and frequently a "find out the hard way" kind of thing

  • @dopetag
    @dopetag 7 місяців тому +2

    Useful! Keep this videos coming. People still think that using Next.js makes you locked into Vercel hosting.

  • @1992sivakumar
    @1992sivakumar 27 днів тому +1

    A long confusion got clarified from this video. Thanks you for the video. Appreciate for the videos like this which nobody talking about. You does it.

  • @technologymad9253
    @technologymad9253 7 місяців тому +9

    do more these kind of videos! thanks for such great content❤

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

      Thank you! Will do

  • @Tszyu01
    @Tszyu01 7 місяців тому +4

    Yes for large companies you will 100% have APIs that need to handle production traffic be developed and deployed separately. Those carefully control the amount of connections and types of access patterns to business critical databases. It will have rate limiting, waf, observability, disaster recovery, etc. If you see an api for production load be hosted as part of a nextjs deployment, just run.

  • @tom.watkins
    @tom.watkins 7 місяців тому +2

    Great video! The thing I would also mention is that if you are accessing IP restricted resources its not possible to do that from vercel without paying for their enterprise amd using their secure compute feature. This is one of rhe main reasons we use a seperate backend. The combo of turborepo trpc still mean we get great DX for this

  • @tomdonadel8531
    @tomdonadel8531 3 місяці тому +1

    Great video. One way I’ve found to get around task timeouts is to set a second cron job that picks up from where the last update timed out

  • @jordymaryns4945
    @jordymaryns4945 7 місяців тому +8

    I really like this video. Can you maybe think of making a video about deploying nextjs outside of vercel, for example Azure or AWS. And what things we lose if we do that.

  • @kisstamas6675
    @kisstamas6675 7 місяців тому +8

    i made a very similar project, i used nestjs for backend and nextjs for frontend. The differences: i only communicate with the database from the backend, and i created a custom authentication flow with access token.

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

      I've been trying to fix the authorisation and authentication, using nest and gql with next but couldn't make something reliable when making a custom auth, can you help me out

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

      @@rajnishps unfortunatly i never used graphql in this tech stack, so don't really know how to solve this, i'm really sorry

    • @DomskiPlays
      @DomskiPlays 6 місяців тому

      Maybe this is a dimb question but the app is not end to end typesafe, right? So whenever your nextjs calls the backend it needs to use fetch or axios and zod to parse all the types?

    • @kisstamas6675
      @kisstamas6675 6 місяців тому

      ​​@@DomskiPlays yes if i communicate with rest api, but if i use graphql, or trpc it typesafe, but as i mentioned i not tested yet 😅

  • @snivels
    @snivels 7 місяців тому +3

    One thing I'd love to see is how to authenticate your next js app against a third party api and how to manage that authentication. At work we have C# backends and usually have C# bffs as well. Would be cool to see the same kind of thing with a Next js acting as the client and BFF against another separate server

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

    I love your work man. I have been having these same questions and wanted to know if having a separate server is practical for the next all. great video.

    • @ByteGrad
      @ByteGrad  6 місяців тому

      Thanks! Enjoy

  • @rajfekar1514
    @rajfekar1514 7 місяців тому +4

    Feel happy for new knowledge. when get notification❤

  • @gyros9162
    @gyros9162 7 місяців тому +3

    This is exactly what I need now!

  • @shakapaker
    @shakapaker 7 місяців тому +2

    Nice topic, I wouldn't say I like using Next.js for the backend, I use NestJS I think it will be more scalable and overall like it more like the traditional approach frontend is frontend backend is the backend but Next.js server features can be useful sometimes as well

  • @mikelautensack7351
    @mikelautensack7351 7 місяців тому +2

    I NEEDED this video! I love next but I’ve been trying to figure out websockets for a multiplayer chess app for a while and there is not a lot of good quality documentation about exactly how to integrate external servers well.

    • @shibet196
      @shibet196 4 місяці тому

      literally the same exact scenario. I am also developing a chess app. Mind if I take a look at yours?

  • @Aditya-lc5uk
    @Aditya-lc5uk 7 місяців тому +14

    Till now we used nextjs so we dont have to make another server...and now we are using nextjs with another sever ?? 😭😭

    • @ByteGrad
      @ByteGrad  7 місяців тому +6

      Welcome to web dev! Haha

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

      Use turbo repos for multiple applications

  • @debarshidas8678
    @debarshidas8678 6 місяців тому +4

    Please make a video on how can we handle jwt access token & refresh token based authentication with a separate backend on next js 14 without using any 3rd party service. ❤

    • @induniljay2072
      @induniljay2072 2 місяці тому

      did you find a way , i 'm stuck with exactly this point

    • @debarshidas8678
      @debarshidas8678 2 місяці тому

      @@induniljay2072 No!

    • @zainn7336
      @zainn7336 2 місяці тому

      exactly i am also looking for this did you find ??

    • @debarshidas8678
      @debarshidas8678 2 місяці тому

      @@zainn7336 Not yet.

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

    Excelente, gracias crack! Saludos desde 🇵🇪

  • @Code-sz9db
    @Code-sz9db 4 місяці тому +2

    This is what I need. But how do you access/import files i.e the db connection that is in the common folder? For instance if you have prisma in the common folder how do you import it in the next.js directory and in the express directory?

  • @тимур_атмосферный
    @тимур_атмосферный 7 місяців тому +2

    Just was thinking about this idea. Thanks a lot for the video

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

    I've quit a project for about 6 months now because i wanted to use nextjs app with an existing node js server (authentication), but could find any help on youtube because many dev creators where only doing tutorials on next auth (like they were paid by nextjs to only do next auth tutorials). It has been so frustrating. Thanks man.

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

    @ByteGrad great videos...
    Let's say I have a Custom Server, and want to take advantages of things like "server actions". The big question is if make sense the "Client" request to "Next.js Server" that request to "Custom Server" (two requests delay make no sense to me), how can I take the advantage of new React thinks at the same time I have my entire app in a separate Custom Server? Maybe having both my Custom server and Next.js server under same server?
    This is valid to server components to only fetch things from my Custom server, it will pass through 2 servers request?

  • @jovanjevtic1620
    @jovanjevtic1620 7 місяців тому +2

    I have a question. So if you have a project that is structured as you showed in minute 8 (api, nextjs and shared ) and I'm using prisma for instance, should I genereate my Prisma types in that shared folder and import the generated types to both the api and nextjs? And also, that would mean that I should firstly nmp init that folder, but I'm wondering how should I host it because it's separate.

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

    Hey, could you show us how this would be with NextJs + Django Rest Framework? Thanks!

  • @azazahamed
    @azazahamed 2 місяці тому

    I would love to see a robust next JS project with Auth and separate backend using open source softwares and packages.

  • @praveenkumart4106
    @praveenkumart4106 6 місяців тому +2

    NextAuth is the issue I am also experiencing. I resolved it using the authO service.

  • @Camilvslalisa
    @Camilvslalisa 8 днів тому +1

    Thanks!

  • @markmaksi
    @markmaksi 7 місяців тому +2

    Can we make server components with a separate node.js server? Will the “use server” work if the Next/Node app was deployed on AWS for example instead of vercel?

  • @AlekseyKovshov-n5h
    @AlekseyKovshov-n5h 7 місяців тому +2

    As far as I know it is not necessary to use next.js functions as serverless. You can use them as a normal backend, and they become serverless only when they are used on certain services, like vercel. Maybe I'm confusing something? (Server-side actions and components are not next.js functionality, but react 19)

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

      That's how I understand it as well, the serverless implementation is only sold at vercel.

  • @404-not-found-service
    @404-not-found-service 7 місяців тому +1

    Thank you for the video, it's really interesting. Greetings!

  • @John-vm7fq
    @John-vm7fq 7 місяців тому +2

    This is basically Laravel (backend) + Inertia (Glue/ Connector) + React/Vue/Svelte

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

    That sounds logical for a every experienced dev but what about SSR when using a custom server?

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd 4 місяці тому +1

    Thank you so much

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

    Hi Wesley, quick question. In your next js/react course, does one of the projects that you teach to build have a separate server like this? Thanks!

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

      Hi, we do talk about a lot of advanced Next.js concepts, but not this

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

    Excellent video, so useful, so it means Express.js for backend + Next.js for frontend is best scenario?

  • @kostia-stoliarskyi
    @kostia-stoliarskyi 7 місяців тому +1

    Thanx for the video! But is next+drizzle (for example) is not solution for question in next with db?)

  • @sidds09
    @sidds09 7 місяців тому +2

    will you not have your react/next course on udemy? js course was very good.

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

      Great to hear you enjoyed the JS course. The React/Next.js course will only be available on the website :)

  • @TusharSinghParmar-l3m
    @TusharSinghParmar-l3m 19 днів тому

    Hi @ByteGrad, I am trying to implement Server side tagging in Nextjs. Can we implement it using serverless function ? If yes, then how ?

  • @TianYuanEX
    @TianYuanEX 7 місяців тому +5

    If Next.js is used purely for frontend (so all backend logic is on a separate server and most of frontend is locked behind auth), would it be a better idea to just use pure react with vite (and tanstack etc..) for frontend instead of Next.js?

    • @ByteGrad
      @ByteGrad  7 місяців тому +2

      Just using a pure React Vite SPA in that case makes sense I think yes

    • @dhrambiragarwal3520
      @dhrambiragarwal3520 7 місяців тому +2

      You can use any service the difference is how easier and different functions they all provide. If you are using next js for pure frontend it is easier for making routes,you will get optimised image and links error handling and many more which all you need to do manually in react 👍

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

      @@dhrambiragarwal3520 How is routing easier in Next.js when you have tanstack router for react which has everything Next.js has and more. For images, fair enough, but I don't understand what you meant by error handling and links?

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

      If it is an app go with React SPA, if it is a website where you need SEO go with Next.js, also sometimes next.js could be needed for ex. streaming content to client etc.

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

    Good video, thank you

  • @sad_man_no_talent
    @sad_man_no_talent 2 місяці тому +1

    this channel is what I need

  • @QiMU01
    @QiMU01 5 місяців тому +1

    Thanks!

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

      Thanks, appreciate it!

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

      ​@@ByteGrad No problem!

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

    In my case the API is written in Symphoni(PHP). How do i make some routes protected. Also, how do i handle session after the user is successful signed in

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

    I just have one question. Recently, I went through the cohort student profiles, especially those who got a job and won a hackathon. I saw their projects, and they are building everything in Next.js. They use Next.js for both the frontend and backend, and they got jobs as full-stack developers.
    So my question is, why are they not using Node.js for the backend? Is Node.js not commonly used in real-time applications? I am a Node.js backend developer, and I don't understand how they are building these complex projects using only Next.js.
    I am a fresher Node.js backend developer and did not get a job. They say they don't hire freshers for backend roles. Should I learn Next.js and go for a full-stack position or stick to the backend? I have an intermediate level of knowledge in React.

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

    Can you do a production grade project with NextJs and custom server, including SSR, CSR access refresh token, protected routes, redis caching for data fetching, using opensource libraries

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

    In my case, I'm running most of my final projects on my own VPS server where I have full control of everything instead of relying on Vercel

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

    This topic has very little info and I find it's extremely difficult to research. So let's say I host my next app on a vps and I have a websocket server for messenger functionality. How do I integrate one into the other? How do I write the frontend code in my next app for the chat while connecting it to the websocket server? It's so difficult to grasp because the concept that nextjs itself is not exclusively "serverless" and the type of server depends on the type of deployment is complex enough as is. Does running the development environment with "npm run dev" have the same behavior as hosting the app on a long-running node server? I'm just so confused man...

  • @AlanDanielx
    @AlanDanielx 4 місяці тому

    @bytegrad i have a very important question. Working with nextjs as a static site, how can i make the dynamic Routes work since nexts asks us for getStaticPaths and prerenders those routes only at built time? Ive been stuck with this for months

  • @renanboni7636
    @renanboni7636 3 місяці тому +2

    why there isn't a single video or tutorial showing how to setup a separate backend for nextjs14 projects? youtube is full of the same todo apps everywhere using the same stack that doesn't really work in a prod environment

    • @user-qq7yc1qp8z
      @user-qq7yc1qp8z 2 місяці тому

      The fuck? Its a separate backend, it does not matter what is on the front end

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

    That's always the point I switch back to Laravel. 😅 Especially I can use shadcn/ui and co with Laravel.

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

    love this content

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

    I have the same setup, wherein I have php backend, the difference is that it already has a managed authentication, token and all are generated from there.
    I am currently using next-auth credential provider, it was tedious setup but was able to make it work but still feels like can be improved. Does Kinde, also offer the same thing? or do the users needs to be stored in Kinde?
    Also one drawback I was able to figure out with passing accessToken in nextjs server side is it will automatically disable caching, because it accesses the cookies and headers. I was able to fix it by added cache:force-cache on all my request, but now everything is cached unless I explicitly remove it.
    Anyway thank you for this! I'm still trying to finish the NextJS course and its been nothing but helpful and my journey learning react/nextjs!

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

      Thanks for sharing, enjoy the course!

  • @mohiwalla
    @mohiwalla 7 місяців тому +5

    #question Can I deploy an express app on Vecel or any free platform for deploying fun projects?

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

      No

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

      There’s a step by step article in the Vercel docs explaining how to set up an Express JS application. Search the Vercel docs for “express”.

    • @Innesb
      @Innesb 7 місяців тому +2

      @@APPoholicReview Why are you saying no? There’s an article in the Vercel docs explaining how to configure an Express app.

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

      yes

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

      @@jotaroisdarius1918 What's that bruh..?

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

    Hmm… I think most of the things you have pointed out are referring to a serverless approach. I was looking for a really good reason to migrate my nextjs backend to express/nest, and I was hoping this video will make it clearer why I should/shoudn’t do it. Unfortunately, it did not. Thank you anyway!

    • @buzz1ebee
      @buzz1ebee 7 місяців тому +2

      If it helps we use a separate nestjs server which the nextjs backend calls.
      We also use code generation via openapi specs so we can generate all the typescript types, the nestjs controllers and dtos, and the nextjs fetch calls / swr hooks.
      We already have lots of code,, tooling, tests etc for a nestjs backend so it's great for us to stick with a separate backend.
      The video seemed pretty good to me describing the benefits. There wasn't a drastic focus on serverless, it's just that nextjs is very heavily focussed on serverless so he had to mention it.

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

      All he said is separation between both ends and ease of development if you have different teams. And then 75% of the video he talked about auth which is not what the title says the video is about. The things he mentioned are common knowledge. A Clickbait imo.

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

    11:14 this gives me anxiety. But awesome video

  • @dananjayachathuranga7113
    @dananjayachathuranga7113 4 місяці тому +1

    thank you

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

    Why not use both at the same tome

  • @berkaycirak
    @berkaycirak 7 місяців тому +2

    Thanks for that content, I have question about server functions (server actions). When we use their on the client, we make a network request to server for using that server function. What is the magic behind that? Instead of directly using those on the client, I have to make a network request to client to be able to use their actions. For example, a server action is mutating some data on the db and when I use that function on the client, first I have to do http request to access the function first am I right? I am confused about using server functions on the client, what is the magic :)

    • @PanosPitsi
      @PanosPitsi 7 місяців тому +2

      Next creates an api route automatically that’s hidden from you basically

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

      Traditionally you would have to create an API endpoint on the server and then manually use fetch() with the correct URL to send data to that endpoint from the browser. With a server action that's all done for you behind the scenes by Next.js -- so it's basically just a function you can call like any other function.

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

      @@ByteGrad thanks for answers, I am happy to think same idea about that structure :)

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

    Bro Which stack is best...Php- Laravel, or MERN!! Which is stable and futuristic... Or there is another stack!😅

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

    Vercel/Serverless is missing in the title.

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

    How to deploy the project on the same VPS in this case?

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

    i am kinda new to nextjs does any tell me how can i accesss that shared folder inside next app src folder?

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

    Is that also the case with nuxtjs ?

  • @UwU-dx5hu
    @UwU-dx5hu 7 місяців тому +1

    But how will leverage next-auth on a separate custom server😢😢

    • @praveenkumart4106
      @praveenkumart4106 6 місяців тому

      This is the one I am also suffering with. I have overcome with authO service.

  • @1992sivakumar
    @1992sivakumar 27 днів тому

    Can you make a video with the project Next js + Python backend(Fast api)

  • @twanaahmed7819
    @twanaahmed7819 6 місяців тому

    Hi i just want to see the contents of your new course but i can not see it on your website, and i had some more questions but i can not contact you

  • @mma-dost
    @mma-dost 7 місяців тому +2

    Hey, micro frontend and module federation crash course please.

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

    Hey can I host my next js frontend and node js backend on a single server? And can I still use the next js server side rendering like Vercel?

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

    cool!

  • @leeyihshen-w4o
    @leeyihshen-w4o 2 місяці тому +1

    damn, these video is gold.

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

    Why do you use env.local and not .env regular?

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

    what I do is have my Fastify server dockerized and living on a Cloud Run instance, boom serverless backend that scales to 0 when I'm not using it.

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

    When will we get back to PHP + jQuery

  • @tarek-mo02
    @tarek-mo02 7 місяців тому

    How does getKindeServerSession get you the localstorage token from the server? how can it access it?

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

    I thought everyone was using nextjs in this way... why is it considered a weird approach? from the start its obvious you can't do everything in nextjs/javascript given its obvious limitations... I just do server side rendering with nextjs and all my endpoints are written in dotnet...

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

    Hello, in this project we're using Kind for authentication and route security to save time.
    Is it really used in real projects? Why don't we do the authentication and route protection ourselves as usual?
    Because if I deploy my application with Kinde and Kinde decides to shut down 3months later, what will happen to my application?

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

      Hi, Kinde allows you to export user data and their SDK API is pretty standard I'd say so there isn't really much lock in imo

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

      @@ByteGrad thanks for the reply

  • @chaitanyasharma6270
    @chaitanyasharma6270 4 місяці тому

    why can i not deploy it to someplace other than vercel?

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

    use nextjs for frontend and nodejs, apollo use for backend

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

    I use auth js version 5 in when user loginned and visit a page that not access into it how we can logout the user by using the function signOut for clearing session in middleware in auth js

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

    How is the token validated. Is it when the client or server make a request from a protected route then the middleware for the express api server recognizes that protected route and sends the encrypted token which is used when making request to server and is validated when decoded on the server? And does it all happen in one go? Say a button on the client that calls the express server does the things previously mentioned all in one go after the button click?

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

      For what I know the express middleware talks with kinde server to authenticate the token under the hood. To check if it's a valid token. It have to talk with kinde api somewhere.

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

      If you would implemente this in one language where they don't have a sdk the workflow would be: api receives the header jwt token > api asks kinde if this token is valid > then api checks if this token is from the right audience or kinde checks Idk > then api allow request. Probably there are more things.

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

    I took a good decision choosing mern over next js

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

    Legend 🫡

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

    so node.js is better than next.js?

  • @ChitranshAnkitSaxena
    @ChitranshAnkitSaxena 2 місяці тому +1

    Awesome

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

    Please make a tutorial to build express API then.

  • @ts8960
    @ts8960 7 днів тому

    Am i the only one who hates the heavy push for server side frameworks? I like my websites to have a loading spinner, and then present a fully working page to the user with smooth experience, while server side frameworks have unpredictable behavior and jittery experience just because developers feel the need to overcomplicate things. Isnt this one of the reasons that chatgpt website moved away from nextjs to a different framework
    Not to mention keeping seperate files for server and client makes perfect sense, while nextjs throws everything in one src file

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

    for kind or similar: it s not a good idea to store users data in service cloud

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

      Kinde allows you to export the data

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

      @@ByteGrad it s not about export data, i am talking to not share your that with CS like kind or others

  • @FikriHaikal-he4bg
    @FikriHaikal-he4bg 7 місяців тому

    This is getting nut

  • @zlackbiro
    @zlackbiro 7 місяців тому +52

    Vercel is pure crap hosting for Node-like apps and its too expensive for no reason. It offers nothing useful. Custom VPS and long live Linux for the win. PM2, NginX, Docker and sky is the limit.

    • @flexdash
      @flexdash 7 місяців тому +15

      Vercel provides you with zero downtime deployments, something that's extremely hard to do on your own. Unless you use something like Caprover.

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

      Can you provide resources everything about deployment and what service is good if not vercel . I am new i don't know about this

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

      ​@@flexdash me laughs w kubernetes

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

      There are plenty of alternatives for having zero downtime deployments beside vercel.. literally hundreds, the only thing you need is stop being lazy and learn something new 😅
      My personal preferences are Jelastic (now part of Virtuozzo offering) or kubernetes, combined with multi region clusters I can even survive entire data centers blowing up 😂

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

      I think using a vps with next.js is great in a lot of situations but I don’t know what you’re thinking saying that vercel offers nothing… it’s definitely the easiest way to deploy next.js and offers a lot.

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

    11:09 what a mess

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

    Only way to use next.JS is backend as a frontend. No need to be putting business logic on there

  • @Андрей-й9ц6я
    @Андрей-й9ц6я 7 місяців тому

    too large font

  • @ameernabil3951
    @ameernabil3951 6 місяців тому

    detebeyss

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

    Great video but raw access token in cookie isn’t very nice