
No Comments Yet
Be the first to share your thoughts and start the conversation.
Here we are—your project is set up and ready to go. You’ll notice many files and folders, so let me walk you through them from bottom to top,
Jokes aside, it’s a folder containing all the dependencies (packages) code required to run this application.
And finally, the most important folder is the app folder, which we’ll explore next,
Be the first to share your thoughts and start the conversation.
By logging in, you'll unlock full access to this and other free tutorials on JSM Pro.
Why? Logging in lets us personalize your learning experience, track your progress, and keep you in the loop with new workshops, coding tips, and platform updates.
You'll also be the first to know about upcoming launches, events, and exclusive discounts.
No spam—just helpful content to level up your skills.
If that sounds fair, go ahead and log in to continue →
Enter your name and email to get instant access
In this crash course on Next.js, you'll gain an overview of the framework's most important new features, with an emphasis on creating a small demo project. This introduction leads into a more comprehensive ultimate course where you'll explore Next.js in greater detail. Below are the key takeaways from this session:
npx create-next-app
command with various configurations.tsconfig.json
: Configures TypeScript for the project.tailwind.config.ts
: Allows customization of Tailwind settings.package.json
: Contains dependencies and scripts for running and building the app.localhost:3000
, and changes can be seen instantly thanks to hot module replacement (HMR).page.tsx
, where you manage the homepage.globals.css
and Tailwind CSS.layout.tsx
file are reflected across all pages of the application.00:00:00 This is a big course, and Next.js is a big framework with lots of features.
00:00:05 In this course, we'll dive deep into every single one of these features.
00:00:09 But I want you to get a quick feel for Next.js by going over some of the most important new features.
00:00:15 And that's why I prepared a crash course as an introduction to this huge ultimate course.
00:00:20 This is a part that has been released to YouTube as well, but everything else is completely redone for the course itself.
00:00:26 Still, I would highly recommend that you watch this too and follow along.
00:00:29 We'll build a small demo project in which you'll be able to get the first time feel for most of these Next.js features.
00:00:35 And then later on in our big ultimate Dev Overflow application, you'll be able to dive into all of these features in a lot of detail.
00:00:43 To get started, create a new empty folder on your desktop and open up your terminal.
00:00:49 Once you're there, run mpx create-next-app add-latest and press enter.
00:00:57 After that, press Y to install the installer.
00:01:00 And you'll be prompted to answer a couple of questions.
00:01:02 For the project name, just type dot slash because we're already in the folder within which we want to create our Next.js app.
00:01:09 In this case, say yes for TypeScript, yes for ESLint, yes for Tailwind CSS.
00:01:15 In this case, we don't need a source directory.
00:01:17 We definitely will be using the app router with its latest functionalities, as well as the Turbo Pack which runs your application more smoothly.
00:01:25 We don't need to customize the import alias.
00:01:28 The default one is fine.
00:01:29 And that's it.
00:01:30 Your application will soon get initialized with all of the dependencies needed to run it.
00:01:35 There we go.
00:01:36 That was a success.
00:01:37 Now that your project is set up and ready to go, you'll notice many files and folders.
00:01:43 So let me walk you through them from bottom to top.
00:01:45 The first one on our list is tsconfig.json.
00:01:49 This is the configuration file for TypeScript.
00:01:52 It defines what should be typed, checked, ignored, and the rules to follow.
00:01:57 Next, we have a tailwind.config.ts.
00:02:00 This is where you can add additional Tailwind setup.
00:02:03 You can extend Tailwind by customizing colors, sizes, shadows, plugins, or anything else you might need.
00:02:09 You know about readme, right?
00:02:10 It's a simple markdown file that explains how to run the project.
00:02:13 Next, we have a post-css-config.mgs.
00:02:17 It's a configuration file for post-css, a tool used to process CSS with different plugins.
00:02:23 In this case, it uses Tailwind CSS as a plugin, which allows you to use utility-first classes in your project.
00:02:30 Package-lock.json is a file that locks the version of dependencies and their sub-dependencies.
00:02:36 ensuring that everyone working on the project uses the exact same versions.
00:02:40 Packajson is a bit simpler, and it contains all the current dependencies and scripts.
00:02:45 There's a dev script which starts Next.js in development mode with hot module reloading, error reporting, and more.
00:02:53 Build creates an optimized production build of your app.
00:02:56 Starts simply starts Next.js in production mode.
00:02:59 And there's also Lint, which runs ESLint for all files in the source app directory and more.
00:03:05 Finally, you can also see three very important dependencies.
00:03:09 React, React DOM, and the current version of Next.
00:03:13 By the time you're watching this video, you should just be able to see 15 right here.
00:03:18 After package.json, we have a nextenv.d.ts, which is a TypeScript declaration file for Next.js.
00:03:25 And as it says right here, this file should not be edited.
00:03:28 It's specifically for Next.js.
00:03:31 On the other hand, next.config.ts should be edited, and it allows you to configure Next.js features, such as experimental options,
00:03:39 image settings, build settings, and more.
00:03:41 And you all know the good old git ignore.
00:03:44 It's very important not to miss adding something there.
00:03:47 Thankfully, Next.js adds the .env for us.
00:03:50 That's good.
00:03:51 No more leaked environment variables.
00:03:53 After that, we have a .eslintrc.json, allowing you to configure your linting options.
00:03:58 Then we dive into folders.
00:04:00 First, we have a public folder, which contains static assets.
00:04:04 always put your images and other static data here.
00:04:07 And then, of course, there's the node modules, the heaviest object in the universe.
00:04:13 Jokes aside, it is a folder containing all the dependencies or packages needed to run your application.
00:04:20 And finally, there's the app folder, the most important folder in every Next.js application.
00:04:26 In the app folder, of course, we have our primary homepage, page.tsx.
00:04:31 But before we check out the rest of these pages in detail, let's first run our application to see it in the browser.
00:04:37 I'll open up the terminal and press npm run dev.
00:04:42 This will run it on localhost 3000. So, open it up.
00:04:47 There we go.
00:04:48 Next.js.
00:04:49 Get started by editing app-page.tsx.
00:04:52 Save and see your changes instantly.
00:04:54 Well, this is the new version of the boilerplate page.
00:04:57 I like it.
00:04:58 You'll also notice something at the bottom left.
00:05:00 I'll tell you what that is later on.
00:05:02 But for now, the page you've just seen is right here within page.tsx.
00:05:07 This file represents the homepage or the forward slash route of your site.
00:05:12 By default, it contains some boilerplate code.
00:05:15 So, let's remove it and return a single H1 that says welcome to next.js.
00:05:22 We can also give it a class name of text-3xl.
00:05:26 If I save it and go back to the browser, you'll see the changes instantly thanks to HMR, hot module replacement.
00:05:34 Among the other folders that we have here, the first one are fonts, and this is where you can store your font files.
00:05:40 It's actually preferable to using something like Google Fonts.
00:05:43 Think of it as self-hosting your own fonts.
00:05:46 There's a favicon.ico.
00:05:48 It's a file that appears on your browser's tab.
00:05:50 Then there's the globals.css file, where you can write all of your custom CSS or simply import Tailwind CSS.
00:05:58 After that, we have a layout.tsx.
00:06:01 This is the main entry point for your application.
00:06:04 Anything you do here will be applied across all pages and routes.
00:06:08 That's why here we're importing the fonts, the styles, and the metadata.
00:06:14 For example, let's change the metadata from Create Next App to something like Hello, Next.js.
00:06:21 I've even added a waving emoji.
00:06:24 And even without reloading, you can see the changes in your browser.
00:06:27 And I know many of you will wonder what kind of browser is this.
00:06:30 I'm using Arc.
00:06:31 You can check it out.
00:06:32 I like it quite a lot.
00:06:33 And finally, we're getting back to the page.tsx where we initially made those changes.
00:06:37 That's it.
00:06:38 That's the most important folder of your app.
00:06:40 And all of the changes that you make to your app will go inside of this app folder.