Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Creating a Next.js Project | Section
Building Web Apps with Next.js

bookCreating a Next.js Project

Pyyhkäise näyttääksesi valikon

Before building applications with Next.js, you need to create a project with the correct setup. Next.js provides an official tool that handles everything for you, so you do not need to configure the project manually.

The easiest way to start is by using the create-next-app command. It creates a ready-to-use project with the App Router, development tools, and a clean structure.

Create a New Project

Run the following command in your terminal:

npx create-next-app@latest my-app

You will be asked a few setup questions, such as:

  • Do you want to use TypeScript?
  • Do you want to use Tailwind CSS?
  • Do you want to use the App Router?

For this course:

  • Choose Yes for TypeScript;
  • Choose Yes for Tailwind CSS;
  • Choose Yes for the App Router.

After the setup is complete, navigate into the project folder:

cd my-app

Start the Development Server

Run the following command:

npm run dev

Then open your browser and go to:

http://localhost:3000

You will see your Next.js app running.

What You Get by Default

The created project already includes: a working Next.js configuration, a basic folder structure using the App Router, development scripts, optional TypeScript support, optional Tailwind CSS setup.

You do not need to install or configure routing, bundling, or optimization tools manually.

question mark

Which command is used to create a new Next.js project?

Valitse oikea vastaus

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 3

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Osio 1. Luku 3
some-alt