Create your own Next.js Starter Template

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024

Комментарии • 106

  • @syntaxfm
    @syntaxfm  Месяц назад +10

    Here are the main sections you can skip to, see the description for the full timestamps:
    01:36 Existing Starter Kits
    10:08 Code Style / Editor Settings
    33:12 Tailwind Component Libraries
    39:08 Set Up NextUI
    01:05:58 Typesafe env Setup
    01:13:43 Next.js Authentication Options
    01:15:37 Next Auth Set Up
    01:38:14 Database Libraries
    01:40:25 drizzle set up
    02:10:53 Next.js Server Action Libraries
    02:13:10 Building a Simple Guestbook
    Next.js CLIs, Starter Kits, Templates, Toolkits and Wrappers | gist.github.com/w3cj/4fa5180fec37ececf0fceec0e3fcc8ab
    View the code here: github.com/w3cj/next-start

  • @cant_sleeeep
    @cant_sleeeep Месяц назад +49

    this guy creates very useful yt videos

    • @mamlzy
      @mamlzy Месяц назад +4

      for real, CJ is awesome

  • @williamschafer4583
    @williamschafer4583 Месяц назад +14

    Whenever CJ drops a video, I always learn something new. His way of explaining things is super clear. Keep it up!👏

  • @WesBos
    @WesBos Месяц назад +13

    MONSTER video. Nice job CJ!

  • @vishalsss123
    @vishalsss123 Месяц назад +3

    Always felt so proud to be follower of CJ, and he mesmerises me every time I watch his content. Favourite content creator & developer who pushes me to learn something new with a in-depth knowledge and teaches how to start & develop an application properly.

  • @dirtbagmoto
    @dirtbagmoto Месяц назад

    I’ve been a web dev for 15+ years and always learn quite a few new things from your videos. Thank you! 🍻

  • @debopamgupta
    @debopamgupta 22 дня назад

    Had this video in my watch later turned out to be very exhaustive and a lot to learn from! You constantly help in building an in-depth knowledge and guide how to develop an application properly. This is very useful with all the best practices and the ability to learn and use all these new libraries together so quickly, thanks for helping to build that engineer mindset, something I'm trying to focus more on. 👍👏

  • @colyndev
    @colyndev Месяц назад +3

    CJ is one of the good humans we need more of. Thanks CJ!

  • @Website_TV_1
    @Website_TV_1 Месяц назад

    This is exactly what I needed! Building a custom Next.js starter template saves so much time for future projects. Thanks for breaking down each step clearly and explaining why certain configurations are important. Looking forward to experimenting with this setup! 🙌

  • @l_i_t_108
    @l_i_t_108 Месяц назад

    bro, I am just starting out to be good in frontend, your vid is the first one I am watching after basic html and css and js stuff, this is so easy to understand. thanks a ton for your effort.

  • @jitxhere
    @jitxhere Месяц назад +1

    Another banger from CJ. Quite informative and easy to understand. Thanks CJ and Syntax

  • @cedericprivat
    @cedericprivat 18 дней назад

    Love the video! I actually learned a lot ☺️
    Small tip for the "next-themes" setup:
    You don‘t need a custom "useSystemTheme" hook. The "useTheme" hook actually returns a property called "resolvedTheme", which does exactly the same thing 😊

  • @sun33t
    @sun33t Месяц назад

    Thanks for taking the time to put this resource together CJ. It's absolutely brilliant 👍

  • @louisv9447
    @louisv9447 Месяц назад

    Wow. I don't think I have ever learnt so much in 24 minutes. Excellent video 👏🏻

  • @gitlit5489
    @gitlit5489 21 день назад

    This is insanely informative, helpful, and some really high quality content, thanks!

  • @mushoodhanif305
    @mushoodhanif305 Месяц назад +1

    Starting from 10:08, everything you did, blew my mind! thanks dude!

  • @laduniestu
    @laduniestu Месяц назад

    I just saved a lot of time after watching your video. Can't wait to see your next video about building a real project with those boilerplate!

  • @juniorgarcia3595
    @juniorgarcia3595 Месяц назад +4

    Thanks for choosing NextUI 🚀 -- Creator here

    • @syntaxfm
      @syntaxfm  Месяц назад

      Thanks for making it!

  • @bubbastylin
    @bubbastylin 19 дней назад

    This content is amazing! Thank you Syntax and CJ!

  • @the42nd
    @the42nd Месяц назад

    Wow this is a goldmine of value and experience! And read minds by putting your base branch in there. Epic share. Subbed.

  • @martinsherry
    @martinsherry Месяц назад +1

    this is a fantastic video with so much rich content. i would love this guy to do a cursor + replit/vercel video building on this.

  • @kiwaikos
    @kiwaikos Месяц назад

    ok, I'm totally subscribed. this was fun to watch, and also learned so much! thank you man!

  • @TedDaddin
    @TedDaddin Месяц назад

    Awesome video! Would love it if we got a fullscreen window in the future since a lot of the text would get cut out. Thanks for a great video CJ!

  • @Sezar_SZ
    @Sezar_SZ Месяц назад

    WHAT A VIDEO! I learned A LOT! Thank you so much CJ 🔥

  • @KumananMurugesan
    @KumananMurugesan 8 дней назад

    Really learnt a lot of stuff from your video. Fantastic. Thank you very much.

  • @jrduarte99
    @jrduarte99 8 дней назад

    I have some Python experience, but I have been learning JS and React recently. This video has been imensely helpful. I've been creating and fine-tuning my template for the last 3 days, using Cursor and v0 to help, and it has been a fantastic journey! What should I learn now, CJ? 😂

  • @MuneebR7
    @MuneebR7 Месяц назад

    woah its better then most of the premium courses out there. sick content. Keep it up.

  • @dawidstolarski6823
    @dawidstolarski6823 Месяц назад

    That feeling when Wags from Billions drops another "how to code" video on yt ♥

  • @paperC_CSGO
    @paperC_CSGO 19 дней назад

    This is fantastic! What would be really great is to create similar start videos for Astro and Remix too. Then we could easily compare them

  • @xcrap
    @xcrap Месяц назад

    Wow, this is nuts. I felt like Next was on another level, but it feels like patching CSS hacks in the 2010s for IE/Firefox, when nothing worked straight out of the box. It was more like… yes, but… lol. Great video explaining the whole process, but it feels like a nightmare because you’re not really working on the product; you’re just tweaking and trying to integrate the packages. Congrats on your great videos and best luck :)

  • @darawan_omar
    @darawan_omar Месяц назад +1

    Hey man what are you did that is useful and great you are the best, this is one of the best video I have ever been seen

  • @codernerd7076
    @codernerd7076 Месяц назад +2

    would be even better with Tests setup but maybe that's a topic for another video!

    • @syntaxfm
      @syntaxfm  Месяц назад +1

      Yes I will cover this in a future video.

  • @obensunday
    @obensunday Месяц назад +1

    This is superb! Can you talk about multi-tenant routing (subdomain/custom domain), image optimization/handling...

  • @StephenRayner
    @StephenRayner Месяц назад +2

    Need a video like this but for unit (vitest/jest), integration (vitest/jest/MSW) and e2e (Playwright) testing. Probably contract testing too (pact)

  • @KenatoHat-rg9mb
    @KenatoHat-rg9mb 20 дней назад

    You provide clean and gold information ❤ hard to find anywhere

  • @deyonyt
    @deyonyt Месяц назад

    Earned my sub after the beautiful coolify video. Thank you man

  • @gynflo
    @gynflo Месяц назад +1

    It's more than complete! Thank you

  • @zapphoddbubbahbrox5681
    @zapphoddbubbahbrox5681 Месяц назад

    wow.. that was exhaustive! i guess you getting your terminal coffee by the gallon. thanks!

  • @ebratz
    @ebratz Месяц назад

    Thanks CJ! You ROCK!

  • @altermunmis
    @altermunmis Месяц назад

    Amazing content! 👏👏👏 thanks for sharing it!

  • @lukemelnik
    @lukemelnik Месяц назад

    Thanks for another great video CJ! I'm curious what you think the best procedure is for applying migrations to the prod db? I'd also love a vid on securely self hosting a postgres db 🙏

  • @prashlovessamosa
    @prashlovessamosa Месяц назад

    Cj thanks for sharing indeed very helpful.

  • @vrfEducation
    @vrfEducation 28 дней назад

    super super cool man. Thanks

  • @dtlvan
    @dtlvan Месяц назад +1

    Waooo ❤
    How about payments, queues, events notifications ... as you mentioned in start of the video?

  • @fujiwara1977
    @fujiwara1977 24 дня назад

    Hi CJ, when you override the pages signIn to the "/", you actually changed the login default page to that location, if i am not mistaken.

    • @syntaxfm
      @syntaxfm  23 дня назад

      Yes that is correct. For this example we only have 1 auth provider, so this is okay. If you have multiple you might want to use the built in next-auth login page, or be sure to create a page that allows users to login in multiple ways.

    • @fujiwara1977
      @fujiwara1977 23 дня назад

      @@syntaxfm haaaa, i did not knew that. Also, two interesting things:
      a) i tested with credentials (username + pass ) only, and if i use signIn("credentials", urlToRedirect) it auto signs me, can't figured out why, yet.
      b) when you assigned the router.push to the navigate prop in the NextUIProvider, if you go the mobile version, the navbar does not close when you go navigate to another link.

  • @colyndev
    @colyndev Месяц назад

    When you created a type for "theme" which comes from useTheme as either string or undefined, just because you forced it to use your custom type does not mean it won't still be undefined. It seems you may have just hidden a potential bug only by telling typescript to be quiet about it.

    • @syntaxfm
      @syntaxfm  Месяц назад

      theme will only be undefined when running on the server. On the client, the next-themes library always uses a fallback value: github.com/pacocoursey/next-themes/blob/main/next-themes/src/index.tsx#L208

  • @abdulhajiyev
    @abdulhajiyev Месяц назад

    Thanks for useful and informative video! How are you adding emojis to commit messages ? Are they automatically added or you type them in commit message ?

  • @bibblebabl
    @bibblebabl Месяц назад +1

    Huge thanks for the content! ❤ Except semi: true 😂😜

  • @lituanaskobea.9826
    @lituanaskobea.9826 18 дней назад

    new subscriber!! thank your for thiss!!!

  • @jafffar5885
    @jafffar5885 Месяц назад

    Great video, highly appreciate your work, Kindly request you make similar video for vanilla react with vite

  • @browntigerus
    @browntigerus Месяц назад

    Great video! Thanks.

  • @Daniel-n7l2k
    @Daniel-n7l2k 18 дней назад

    Great video , and very helpfull, it will be so great that you can show us how to set up translation with a library for example i18n...

  • @Rajesh-rg6fw
    @Rajesh-rg6fw Месяц назад

    Can you tell me which is better: Auth.js or Lucia Auth? Or do you have any other recommendations? I'm planning to use it in production and need long-term support because I don't want to change it frequently.

    • @syntaxfm
      @syntaxfm  Месяц назад

      auth.js is still in beta unless you stick with next-auth v4, but they do have a larger ecosystem of plugins / adapters. You typically write less code with Auth.js but in my experience it is harder to customize if you have specific auth flow needs that they don't account for.
      Lucia requires a bit more code and configuration to get up and going but is much more customizable because of this.

  • @jonathankurtis
    @jonathankurtis Месяц назад

    insanely good. mooaaar, please!

  • @santoshbadal1111
    @santoshbadal1111 Месяц назад

    If possible can you please share your vscode settings/extensions/theme/fonts etc

    • @syntaxfm
      @syntaxfm  Месяц назад

      I go over my settings in this video: ruclips.net/video/85q9FTdVyJs/видео.html
      All of my settings are detailed here: github.com/codinggarden/vscode-settings

  • @whatinquest
    @whatinquest Месяц назад

    Hey, CJ. Thank you for this valuable tutorial. I learnt a lot about decision making and code-setup.
    I had a query related to session storing in DB. Is it good to have a table for sessions in the database? As an application scales there will be drastic upthrust in session information with increasing traffic which might take a toll on the database (too many write or read operations).
    Also, the workaround for the strategy change from 'jwt' to 'database' probably can be mitigated by using next-auth callbacks. I'm not too sure though, it'd be great if you can verify for us learners in a part 2 of the same.
    Much thanks 👾✨

    • @syntaxfm
      @syntaxfm  Месяц назад +1

      Yes you are right, sessions stored in the DB will need to be looked up on every request.
      In other systems I have built, I have stored the sessions in an external cache database like Redis so the lookups are fast. This should be possible with next-auth using a custom adapter.
      I chose not to use the 'jwt' only strategy because there is no built in way to revoke tokens. A secure jwt implementation would need to provide this (lookup revoked tokens during token validation, or use a token version to know if a token is still valid) since tokens cannot be revoked on their own, they only have an expiration time.
      I'm not sure if next-auth callbacks can provide the same functionality as middleware 🤔 - would be worth looking in to.
      This article from authjs talks about the problem with middleware - authjs.dev/guides/edge-compatibility#middleware

  • @bunyaminerdal2478
    @bunyaminerdal2478 Месяц назад

    awesome video

  • @St0rMsk
    @St0rMsk Месяц назад

    🤯of a video as always. Just a quick question: Do you need to add the around {children} in the root layout? Isn't it automatically added by the loading.tsx file? for any page

    • @syntaxfm
      @syntaxfm  Месяц назад +2

      Yes good catch! In this case the component in Layout is unnecessary.
      The next.js docs say:
      "In the same folder, loading.js will be nested inside layout.js. It will automatically wrap the page.js file and any children below in a boundary."
      nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming#instant-loading-states

  • @brayanyevenes5954
    @brayanyevenes5954 Месяц назад +1

    Is it possible to share the presented excalidraw?

    • @syntaxfm
      @syntaxfm  Месяц назад +1

      excalidraw.com/#json=7apmPAJYqjLmN2-WSkjHf,3wfAsRZh844VXWCYhH2CFw

  • @status-200-ok
    @status-200-ok Месяц назад

    I leave like and sub, it's an excellent content, I'd like you go up like this

  • @gold-junge91
    @gold-junge91 Месяц назад

    Would be cool if you can increase font size, and make vscode bigger

  • @SachinYadav-yx1rc
    @SachinYadav-yx1rc Месяц назад

    Coding garden with CJ❤

  • @LastChain
    @LastChain 7 дней назад

    Thank you

  • @shubhamjangid5936
    @shubhamjangid5936 Месяц назад

    I am facing a bad issue in my vscode, html attributes are not suggested to me in a ".jsx" file , im soo confused please help

  • @jrcologne2663
    @jrcologne2663 Месяц назад +1

    1:42:58 You did reveal your Google client credentials at this point in the video and multiple times after that entirely. Hope you're aware of this. 😅

    • @syntaxfm
      @syntaxfm  Месяц назад +1

      Yes thank you! Eventually I realized I'd have to show the .env file - credentials have been deleted.

  • @mehmethanifierenler3612
    @mehmethanifierenler3612 Месяц назад

    very very thanks

  • @dprophecyguy
    @dprophecyguy 28 дней назад

    There was an error while adding jitti and this is how you've to do write the implementation :
    ```
    import { fileURLToPath } from "node:url";
    import { createJiti } from "jiti";
    const jiti = createJiti(fileURLToPath(import.meta.url));
    await jiti.import("./src/env/server.ts");
    ```
    Put this in `next.config.mjs` file

  • @Learnwithjoseph
    @Learnwithjoseph Месяц назад

    well talk good work

  • @tatiperez2738
    @tatiperez2738 Месяц назад

    16:44 I followed all the steps for the prettier sort imports but it is not doing anything :( I moved the imports around in layout.tsx and saved the file but no sorting is occurring. Is there a way to know if it was installed properly? Also, is there a command to make it run on demand and not just when the file is saved? this would help me troubleshoot. Any help is appreciated 🙏🙏🙏🙏🙏🙏🙏

    • @syntaxfm
      @syntaxfm  Месяц назад

      To run prettier on demand - CMD/CTRL + OPTION + F or CMD/CTRL + SHIFT + P and search for "Format Document"
      Some things to check:
      1. Make sure the package is installed and listed in the package.json - github.com/w3cj/next-start/blob/main/package.json#L34
      2. Make sure the plugin is listed in the .prettierrc.json file - github.com/w3cj/next-start/blob/main/.prettierrc.json#L15
      3. Make sure eslint-config-prettier is installed - github.com/w3cj/next-start/blob/main/package.json#L42
      4. Make sure prettier is the last item listed in the extends section of the .eslintrc.json - github.com/w3cj/next-start/blob/main/.eslintrc.json#L2
      5. Double check your .vscode/settings.json - github.com/w3cj/next-start/blob/main/.vscode/settings.json#L4
      6. Restart / reload VS code to make sure the latest settings get picked up. (CMD/CTRL+SHIF+P - search for "Developer: Reload Window"

    • @tatiperez2738
      @tatiperez2738 Месяц назад

      After spending a day on it I was able to solve the problem so I'll leave the answer here for any other noobies that have the same issue. I don't know if it matters but I'm on windows 10 using VisualCode Studio.
      *First you need to make sure you have the prettier extension installed in vscode
      *After you follow the directions to install the prettier sort import plugin, if you don't see the sorting happening on file save, your visual code isnt using prettier as the default formatter.
      *Make sure you add this option to the settings.json in your .vscode folder:
      {
      "editor.formatOnSave": true,
      "editor.codeActionsOnSave": {
      "source.fixAll": "always"
      },
      "editor.defaultFormatter": "esbenp.prettier-vscode",
      "[javascript]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
      }
      }
      *I hope this made sense to anyone that this issue. If you need any help just tag me here and I'll reply as soon as I can! I know what is like to feel like no one is there for you to help. Happy coding!

  • @emilianoferreyra8221
    @emilianoferreyra8221 Месяц назад

    Gold ❤

  • @josealfa04
    @josealfa04 Месяц назад

    How can I do to don’t love that guy?? ❤❤
    I love CJ tutorials and I miss self-host series!!😢

  • @wisdomshop1639
    @wisdomshop1639 11 дней назад

    None of these come with Zustand? Why is that?

  • @w3mw
    @w3mw Месяц назад

    Amazing video, but I have a problem, I created the way you started with next js aswell vith npx create-next-app@latest.
    But my eslint dosent show the error as in the video, like when you writing console.log(process.env.DATABASE_URL) for ex, after you fix with eslint file, process.env will have a red underscore to show something is wrong, it dosent on my end.
    What can be the problem?

    • @syntaxfm
      @syntaxfm  Месяц назад

      Things to double check:
      Install the "eslint-plugin-n" plugin if you have not yet: www.npmjs.com/package/eslint-plugin-n
      Make sure "n" is listed in the list of plugins: github.com/w3cj/next-start/blob/main/.eslintrc.json#L3
      Make sure the rule is enabled: github.com/w3cj/next-start/blob/main/.eslintrc.json#L9
      You might need to restart vs code after updating your eslintrc - (CMD+SHIFT+P or CTRL+SHIFT+P) search for "Developer: Reload Window"

    • @dommafia
      @dommafia Месяц назад

      I had to install the eslint extension in Visual studio code, the ide i'm using, not sure if this is your case.

  • @reze_dev
    @reze_dev Месяц назад

    Thanks, but you should add email password authentication too

  • @Divyv520
    @Divyv520 Месяц назад

    Hey Syntax , very good video ! I was wondering if I can help you with more Quality Editing in your videos and make Highly Engaging Thumbnails which will help your videos to get more views and engagement . Please let me know what do you think ?

  • @rence9522
    @rence9522 Месяц назад

    can you make also in nuxt

  • @freakinfocus
    @freakinfocus Месяц назад

    Hey! Whats the name of this vscode theme?

    • @syntaxfm
      @syntaxfm  Месяц назад +1

      It is called "Just Black" - you can see me go over all of my settings here: ruclips.net/video/85q9FTdVyJs/видео.html

    • @freakinfocus
      @freakinfocus Месяц назад

      @@syntaxfm Thanks a ton!

  • @StephenRayner
    @StephenRayner Месяц назад

    BiomeJS!

  • @pulpml
    @pulpml Месяц назад

    Prisma Homepage says trusted by teams at Syntax 🤣

    • @syntaxfm
      @syntaxfm  Месяц назад

      Prisma is great! We use it on syntax.fm

  • @Deus-lo-Vuilt
    @Deus-lo-Vuilt Месяц назад +1

    Like and subi , thanks 😊

  • @РодионЧаускин
    @РодионЧаускин Месяц назад

    Wilson John Thomas Shirley Lewis Barbara

  • @DontFollowZim
    @DontFollowZim Месяц назад

    Even though, I'm a Vue/Nuxt guy, I love watching this stuff because there's always something I can take away from it. I know you like Vue, so maybe we'll see something for it or Nuxt some time? Or do you want to keep making sure you're hitting the largest audience possible by sticking to React stuff?

  • @VK-xw6ky
    @VK-xw6ky Месяц назад

    More CJ!