Recently, I deployed my Next.js project on Vercel, and it was surprisingly easy. If you're new to deploying Next.js apps, here's how I did it:
1. Create a Next.js Project
First, I created my Next.js project using the command:
npx create-next-app@latest
This sets up the basic structure of the app.
2. Push to GitHub
Once my project was ready, I pushed the code to a GitHub repository. If you haven't done this before, you can initialize a git repository using:
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-github-repo-url>
git push -u origin main
3. Connect to Vercel
I then went to Vercel, signed in, and clicked on the "New Project" button. Vercel automatically detected my GitHub repositories, so I selected my Next.js project from the list.
4. Deploy
Once selected, I simply clicked "Deploy", and that’s it! Vercel took care of the rest. It deployed my Next.js app, and in a few minutes, my project was live with a URL.
5. Live Link
After deployment, I got a live link where my Next.js project was hosted. Now, I can easily share it with anyone.
That's how I deployed my Next.js project using Vercel. The whole process was smooth, and it hardly took any time!