Get started with Next.js
Welcome to the presentation of Next.js!!!
As it’s called tryer, it means that it is for you, just have to try and learn by doing. If you are new to JavaScript, I recommend this great resource. On that course you will learn the basis of Next.js by learning some concepts of JavaScript, React.js. Don’t forget that you need to be familar with some web development concepts.
If you know already about Next.js, you can skip this page and go to the next page. If you don’t mind, just try it will be as a revision.
System requirements
You need to have required system informations or program/software:
Automatic Setup
I recommend creating a new Next.js application using the following command create-next-app. It is similar to React.js app creation command create-react-app. Yuo noticed that we just replaced next by next keyword in the command.
Then to create a project called sample_project, run:
npx create-next-app sample_project
# change the directory
cd sample_project
On this tutorial, we have used JavaScript, we won’t use TypeScript. After creating a app, now let look at the files generated. You will have package.json, node_modules/, next.config.json, etc.
Open package.json file, you will see dependencies installed: react, react-dom and next. The rest of files, we will have a look on it later.
After the installation is complete:
- Run
npm run dev, to start the development server on localhost at the port 3000 - Visit http://localhost:3000 to see your default application
- Edit the
index.jsfile under thepagesfolder and save the file, you will see the page updated in your browser.
