To scaffold a NextJs app, Type:
npx create-next-app
or
Manual setup, Type:
Install next, react and react-dom
in your project folder:
Open package.json and add the following scripts:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}Create a pages directory inside your project.
Populate ./pages/index.js with the following contents:
function HomePage() {
return <div>Welcome to Next.js!</div>
}
export default HomePageTo start developing your application type npm run dev
Visit http://localhost:3000 to view your application.
source: https://nextjs.org/