Overview
Vercel is the official hosting platform for Next.js applications, offering zero-configuration deployment, automatic CI/CD, and global edge network distribution. This portfolio is optimized for Vercel deployment with integrated analytics and performance monitoring.Quick Deploy
Connect Repository
- Push your code to GitHub, GitLab, or Bitbucket
- Visit vercel.com/new
- Import your repository
Configure Project
Vercel automatically detects Next.js projects. The default settings work for this portfolio:
- Framework Preset: Next.js
- Build Command:
npm run build - Output Directory:
.next(auto-detected) - Install Command:
npm install
Your portfolio will be live at
https://your-project.vercel.app within minutes. Custom domains can be added in project settings.CLI Deployment
For deployment via command line:Next.js Configuration
The portfolio’snext.config.mjs is optimized for both Vercel and standalone deployments:
Integrated Analytics
This portfolio includes Vercel Analytics and Speed Insights:- Web Analytics: Privacy-friendly visitor tracking without cookies
- Speed Insights: Real User Metrics (RUM) for Core Web Vitals
- Audience Insights: Geographic and device analytics
Environment Variables
Add Environment Variables
In your Vercel project dashboard:
- Go to Settings → Environment Variables
- Add variables for each environment (Production, Preview, Development)
Variables prefixed with
NEXT_PUBLIC_ are exposed to the browser. Keep sensitive keys without this prefix.Image Optimization
The portfolio leverages Vercel’s Image Optimization with configured remote patterns:- Automatic format conversion (WebP, AVIF)
- Responsive image serving
- Lazy loading with blur placeholders
- CDN caching on Vercel Edge Network
Automatic CI/CD
Vercel provides automatic deployments for every Git push: Production Deployments:- Triggered by commits to
mainormasterbranch - Assigned to your production domain
- Requires manual promotion or automatic via branch settings
- Created for every push to non-production branches
- Unique URL for each commit
- Perfect for reviewing changes before merging
Custom Domain Setup
Add Domain
In Vercel project settings:
- Navigate to Settings → Domains
- Enter your custom domain (e.g.,
luannguyen.net)
SSL certificates are automatically issued via Let’s Encrypt and renewed. HTTPS is enforced by default.
Performance Optimization
Vercel Edge Network:- Automatic static asset caching
- Global CDN distribution across 40+ regions
- Edge Functions for dynamic content
- Automatic code splitting
- Tree shaking and minification
- Incremental Static Regeneration (ISR) support
Technology Stack
This portfolio leverages these technologies on Vercel:- Node.js 18+ (automatically selected)
- Edge Runtime available for API routes
Monitoring & Debugging
Deployment Logs:- View real-time build logs in Vercel dashboard
- Check for build errors or warnings
- Access function execution logs
- Monitor API route performance
- Track errors with Vercel Error Tracking
- Core Web Vitals tracking
- Page load performance metrics
- User interaction analytics
Rollback Deployments
Instantly rollback to previous deployments:Preview Comments & Collaboration
Vercel enables team collaboration on preview deployments:- Visual Feedback: Comment directly on preview deployments
- Integration: Works with GitHub, GitLab, Bitbucket PR comments
- Approval Workflow: Require approvals before production promotion
Best Practices
Use Environment Variables
Never commit secrets to Git. Use Vercel environment variables for API keys and sensitive data.
Enable Branch Protection
Configure production branch protection to require preview deployment success before merging.