Hi everyone. This article will explain how you can create an application using Next.js and how you can deploy it to Vercel.
Creating a Next.js Application
Let's start to create an application using the command line.
Use the command below for the start of creating an application.
“npx create-next-app”
- After you run that command, CLI will ask you to project name. Then CLI will continue to installing packages for Next.js boilerplate.
After installation is completed CLI will introduce you to how you can run the project in your locale.
When you open your project in IDE you can see the structure and start the coding.
Deploying to Vercel
Vercel is a company that you can deploy your applications easily. Also, Next.js is one of the products of Vercel.
First of all, you need to push your application to Github for integration to Vercel.
Also, you have to create an account on Vercel. You can use the Github login as I used. After login, you will see a screen like this. (Without projects)
Then click the new project for adding your new Next.js project.
Then you will see the selection for the template of your new website. In the left box, your Github repositories are listed. Also, black icons on the left of projects show these projects created with Next.js.
Select the project.
Then you will see the configurations of the new deployment. For the new project no need to configure.
- Click deploy and Vercel will start the steps of deploying your project.
- Then your project is live!
- It gives random url for your project. And you can visit directly. (For my project: https://test-gray-three.vercel.app/)
- Also when you open your projects Github page. You can see the project is configured by Vercel. (URL and Environment)
In this article, I have explained how you can create a Next.js application and deploy it to Vercel. I hope you enjoy it.
Thank you for reading. Sharing and applause will increase motivation :).