2 Installing Tools and Application Structure
This chapter covers:
- Installing Next.js and create-next-app so that you can start new projects with ease
- Using create-next-app to install example Next.js applications and using them as a starting point for your own application
- The common files and directory structures found in every Next.js application and where to start hacking.
Before you’re able to start building your Next.js application, you need to install the supporting libraries and command line tools on your system. Before this, you have to make sure that your system is ready with the correct version of Node.js and npm. Thankfully, these two prerequisites are straightforward to tackle, and we’ll address these first thing in this chapter.
Then, we’ll get rolling with creating a Next.js project using Next.js tooling. Once you’ve seen how this works, you’ll appreciate everything that it takes care of for you so that you don’t have to. The same tool that you use to start your own Next.js projects can be used to install example Next.js projects and use them to either learn Next.js concepts, to use as the starting point of your project, or both.
Finally, we’ll walk through a brand-new project that create-next-app creates for us, so that you can get a feel for what you’re starting with when you get your hands dirty with a new Next.js application.