Create a New Next.js and TypeScript Project

Lazar Nikolov
InstructorLazar Nikolov
Share this video with your friends

Social Share Links

Send Tweet
Published 2 years ago
Updated 2 years ago

Next.js is React’s recommendation for building server side rendered (SSR) web apps. It features SSR and Static Site Generation (SSG), TypeScript support, routing, and more.

In this lesson you will also set up this course’s example and learn to create a new Next.js and TypeScript project.

Instructor: [0:01] Let's begin by learning what Next.js is. Next.js is an open-source React framework built on top of Node.js. It enables developers to build super fast, optimized websites and web apps.

[0:12] While traditional React apps are rendered on the client side, Next.js gives you the option to also render your pages on the server side. Its features like the built-in router, per-page rendering options, incremental static regeneration, TypeScript support, etc., provide the best-in-class developer experience and rapid feature development.

[0:33] The React documentation lists Next.js as the recommended tool chain for building server-side-rendered web apps. It is originally built by Guillermo Rauch and is developed and maintained by Vercel. That's a small intro to what Next.js is.

[0:49] To begin with this course, go ahead and clone this repo. This is a mono repo that contains all 15 lessons that we're going to go through in this course. Feel free to pause this video and clone the repo.

[1:04] After you've cloned this repo, open it up in Visual Studio Code. The first thing we need to do is run npm install at the root of the project. This will install all of the packages and dependencies for this course.

[1:16] Throughout this course, we'll be working in the Exercises folder. As the first exercise, we are going to create a new Next.js TypeScript project. Let's see into the Exercises folder and enter the first exercise. To create a new Next.js TypeScript project, we need to run npx create-next app. We'll provide a name for our app. Let's call it Hello Next.js.

[1:45] Then we will pass the TypeScript flag. Just hit y on this step, and there we go. This command will create our Next.js TypeScript project called Hello Next.js. If we cd into it and execute npm run dev, it will start our development server. We can visit localhost:3000, and we're going to see the new project page.

[2:13] That's about it. To recap, we learned what Next.js is, some facts and history about Next.js, and we've created a new Next.js TypeScript project.

egghead
egghead
~ 25 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today