Introduction to Vercel and Quick Start
🎯 Introduction
By the end of this article, you will understand what Vercel is and how it differs from deploying to a traditional server. You will also complete a deployment: push a local Vite project to GitHub, deploy it with Vercel, and get a URL accessible worldwide.
🧱 What Is Vercel?
Vercel is a deployment platform for frontend projects. Think of it as a valet service: hand over your code by pushing it to a Git repository, and it handles building, uploading, domains, HTTPS, and global delivery.
Deploying a website the traditional way requires you to:
- Rent a cloud server.
- Install Nginx and configure the site directory.
- Run
npm run buildmanually and upload the output to the server. - Register a domain, configure DNS, obtain an SSL certificate, and more.
Vercel reduces this to two steps: push code → deploy automatically. Every subsequent git push automatically rebuilds and deploys your site.
✨ Why Choose Vercel?
- A useful free plan: The free Hobby plan lets you deploy learning projects and personal blogs.
- Deploy on every Git push: Connect a GitHub repository to build and deploy automatically whenever you push.
- Automatic HTTPS and a global CDN: Deployments include
https://and global delivery without requiring you to obtain certificates yourself. - Preview deployments: Each branch and pull request gets its own preview URL so you can check changes before releasing them.
- Support for frontend frameworks: Vercel detects projects built with Vite, Vue, React, Nuxt, Next.js, and other frameworks for zero-configuration deployment.
🚀 Step 1: Prepare and Push Your Project
If you already have a Vite project from Stage4, use it. Otherwise, create one now (this course uses Node.js v22.0.0):
npm create vite@latest vercel-demo -- --template vue
cd vercel-demo
npm install
Push the project to GitHub using the workflow from the Stage1 Git course:
git init
git add .
git commit -m "init vercel demo"
git remote add origin https://github.com/your-username/vercel-demo.git
git push -u origin main
🛠 Step 2: Import the Project into Vercel
- Open vercel.com, click Sign Up, and choose Continue with GitHub to sign in with GitHub.
- In the dashboard, click Add New... → Project.
- Find
vercel-demoin the repository list and click Import. - Vercel detects the Vite project and fills in the build command (
npm run build) and output directory (dist). Leave these settings as they are. - Click Deploy and wait a few dozen seconds.
The celebration screen means your deployment succeeded! Click the preview image or a URL under Domains to visit your site.
🌐 Get a Public URL
After deployment, Vercel assigns a free default domain:
https://vercel-demo-xxxx.vercel.app
You can share this publicly accessible URL with friends.
Now try updating the title in your local src/App.vue, then commit and push:
git add .
git commit -m "update title"
git push
Open the Vercel dashboard after pushing. A new deployment starts automatically. Refresh your site a few dozen seconds later to see the updated content. That is deployment on push.
.vercel.app domains and some Vercel services may be unreliable on networks in mainland China. You can still follow the course, but for a commercial project, consider a custom domain and evaluate accessibility. Article 5 covers domains.❓ Knowledge Check
Q1: How does Vercel differ from GitHub Pages?
GitHub Pages hosts static files only, and you need to arrange the build process. Vercel automatically runs npm run build and supports preview deployments and serverless functions, making it a good fit for modern frontend projects.
Q2: What limits apply to the free Hobby plan?
It is primarily for personal, noncommercial projects. Bandwidth and builds have usage limits, but these are sufficient for learning projects. Upgrade to Pro if you exceed them.
Q3: Can I deploy a private repository?
Yes. After connecting your GitHub account, you can import private repositories that Vercel has permission to access.
Q4: What should I do if deployment fails?
Open the deployment in the dashboard and check Build Logs. A common cause is code that fails to build. Make sure npm run build succeeds locally before pushing.
🧪 Practice
- Create a Vite project (or use an existing one), push it to GitHub, and deploy it to Vercel. Share the resulting
.vercel.appURL with a friend. - Update the homepage text and run
git pushagain. Watch the automatic deployment in the dashboard and confirm that the live content changes.
🎉 You have completed your first Vercel deployment! Next, we will use Vercel CLI to deploy with a single terminal command.
