Master Next.js 13 by Completing This Single Project

Posted by


In this tutorial, we will learn how to use Next.js 13 by building a project from scratch. Next.js is a React framework that allows you to build server-side rendered and static websites with ease. With the latest version 13, Next.js has introduced several new features and improvements that make the development process even smoother.

Before we begin, make sure you have Node.js installed on your machine. If not, you can download and install it from the official Node.js website.

Let’s start by creating a new Next.js project. Open your terminal and run the following commands:

npx create-next-app@13 my-next-project
cd my-next-project
npm run dev

This will create a new Next.js project in a folder called my-next-project and start the development server. You can now open your browser and navigate to http://localhost:3000 to see the default Next.js homepage.

Next, let’s create a new page for our project. Inside the pages directory, create a new file called index.js and add the following code:

import React from 'react';

const HomePage = () => {
  return (
    <div>
      <h1>Welcome to my Next.js 13 project!</h1>
    </div>
  );
};

export default HomePage;

Now, if you navigate to http://localhost:3000, you should see the new homepage we just created.

Next, let’s add some styles to our project using Tailwind CSS. First, install Tailwind CSS and its dependencies by running the following command in your terminal:

npm install tailwindcss@latest postcss@latest autoprefixer@latest

Next, create a new file called styles/globals.css and add the following code:

@tailwind base;
@tailwind components;
@tailwind utilities;

Now, import the globals.css file in the _app.js file located in the pages directory:

import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
  return <Component {...pageProps} />;
}

export default MyApp;

Now, you can start adding Tailwind CSS styles to your components and pages.

Finally, let’s deploy our project to Vercel. First, sign up for a Vercel account if you don’t already have one. Next, link your Vercel account to your GitHub repository, where your Next.js project is hosted. Finally, run the following command in your terminal:

npm run build

This will create a production build of your project. Next, run the following command to deploy your project to Vercel:

vercel --prod

Follow the prompts to deploy your project to Vercel. Once the deployment is complete, you will receive a URL where your project is hosted.

Congratulations! You have successfully learned how to build a project with Next.js 13. Now you can continue exploring the features and capabilities of Next.js to build your own custom projects.

0 0 votes
Article Rating
48 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@CleverProgrammer
30 days ago

I just screenshot 21:52. That tells me EVERYTHING I need to know haha. Dude amazing explanation. I was fighting moving to 13.4 next so hard now I'm fucking excited to hop in!

@michaelpichardo
30 days ago

If I wanted to deploy this project to prod, what service would I use?

@trongnhantran7330
30 days ago

Nice video man

@user-br9zx3ip3x
30 days ago

I like how he explains content generally but the pace of his videos are way too fast. Completing this tutorial will definitely take longer than the runtime if you're learning for the first time, for anyone who is curious.

@tbone587
30 days ago

That "use server" string is very odd. Is that some native javascript mechanism?

@ronaldronald8819
30 days ago

I like this. Tanks for the upload. it is getting me up to speed fast 🙂

@boosboop
30 days ago

This video was amazing! Thank you so much for the great content and breaking things down the way that you do!

@andrewstefankiv8921
30 days ago

Thank you from Ukraine =)

@vladharanich
30 days ago

Great tutorial, but you rushed too much through the video

@AissaDev
30 days ago

Thank you kyle, best explanation now next one of my favorites frameworks

@shaylee3969
30 days ago

was that teaching or reminding???

@m1r342b2r
30 days ago

You explain is very clearly! Thank you so much!

@m1r342b2r
30 days ago

Hello! What application are using to create this video? Is amazing!

@XprimeX-q7l
30 days ago

Just wow. Can this be used with springboot application running on postgresql. Can prisma be used

@MSEIN2303
30 days ago

This was not a NextJS training at all, but a general training of something else that was not suitable at all

@danielratiu4318
30 days ago

@latest is 14 now 😀

@Dziejkoo
30 days ago

Everything is awesome except that my laptop is burning XD

@sunilanthony17
30 days ago

Hey Kyle, now that next.js is on version 14, do you still need to create the db singleton function?

@ikazak
30 days ago

thanks for the tutorial!

@ערןקראוס
30 days ago

What would you do if the action for toggleTodo was throw an error or just failed with some db connections error ? The client shows true but the db think it’s false ?