DEV Community

Christopher Demahy
Christopher Demahy

Posted on

How to Start a Next.Js Project.

Next.Js is a server-side rendered React framework that offers a lot of benefits over the traditional client-side rendered applications. While many of these benefits were covered in this previous article, this will serve as a tutorial for those looking to get started with a Next.js project.

In order to get started with the Next.js project, we first need to initialize the project.

The command-line tool will prompt you for the name of the application. In this example, we can just name it 'counter-example'. This will create the scaffold of a next.js app that we can use as our blank canvas. Next will give us a basic structure with three folders, public, styles, and pages. The public folder will contain any non-javascript static assets such as images. Styles will contain, well, styles. Next.js has support for SCSS and LESS as well as CSS. Lastly we have the pages folder, where we will store our components that represent pages in our application.

Each component in the pages folder will become a route in your app, so if you have "pages/users.jsx" it will become example.com/users.

Top comments (0)