Overview
The Sunflower Capital website is optimized for deployment on Vercel, the platform built by the creators of Next.js. Vercel provides automatic deployments, preview environments, and excellent performance out of the box.Prerequisites
- A GitHub account with the repository
- A Vercel account (free tier works perfectly)
- Node.js 20.x or higher installed locally
Deployment Steps
Connect to Vercel
- Go to vercel.com and sign in
- Click “Add New” → “Project”
- Import your GitHub repository
- Vercel will automatically detect it’s a Next.js project
Set Environment Variables (Optional)
If you’re using Google Analytics, add your tracking ID:
| Key | Value | Notes |
|---|---|---|
NEXT_PUBLIC_GA_ID | G-XXXXXXXXXX | Google Analytics 4 ID |
The current implementation uses a hardcoded GA ID (
G-SR59L3T5LT) in layout.tsx. Consider moving this to an environment variable for better configuration management.Next.js Configuration
The project uses a minimal Next.js configuration:next.config.mjs
Build Scripts
The following npm scripts are available for deployment:Automatic Deployments
Production Deployments
Production Deployments
Every push to your
main branch triggers an automatic production deployment:- Vercel builds and deploys automatically
- Updates your production domain
- Runs build checks and optimizations
Preview Deployments
Preview Deployments
Every pull request gets a unique preview URL:
- Independent deployment for each PR
- Perfect for testing before merge
- Automatic updates on new commits
- Preview URL format:
https://your-project-git-branch-name.vercel.app
Custom Domain Setup
Add Domain in Vercel
- Go to your project settings
- Navigate to “Domains”
- Click “Add” and enter your domain (e.g.,
sunflowercapital.co)
Performance Optimization
Vercel automatically provides:Edge Network
Global CDN with 100+ edge locations
Image Optimization
Automatic image optimization and WebP conversion
Smart Caching
Intelligent caching at the edge
Analytics
Built-in Web Analytics (see Analytics Setup)
Troubleshooting
Build Failures
Build Failures
If your build fails:
- Check the build logs in Vercel dashboard
- Run
npm run buildlocally to reproduce - Verify all dependencies are in
package.json - Check for TypeScript errors with
npm run lint
Environment Variables Not Working
Environment Variables Not Working
- Client-side variables must start with
NEXT_PUBLIC_ - Redeploy after adding new environment variables
- Check the “Environment Variables” tab in project settings
404 on Refresh
404 on Refresh
This shouldn’t happen with Next.js on Vercel, but if it does:
- Verify you’re using Next.js App Router (not Pages Router)
- Check that
vercel.jsondoesn’t have conflicting rewrites
Production Checklist
- All environment variables configured
- Custom domain added and verified
- SSL certificate issued (automatic)
- Analytics tracking verified
- OG images displaying correctly
- Mobile responsiveness tested
- Build completes without errors
- Lighthouse score reviewed
Next Steps
Analytics Setup
Configure Vercel Analytics and Google Analytics
Vercel Documentation
Learn more about Vercel features