Why Vercel?
- Zero configuration: Optimized for Vite and React out of the box
- Serverless functions: Native support for
/apiroutes (used for AI coaching) - Automatic deployments: Git integration with preview deployments for PRs
- Global CDN: Fast content delivery worldwide
- Free tier: Generous limits for personal projects
- Custom domains: Easy setup with automatic SSL
Prerequisites
- A GitHub, GitLab, or Bitbucket account
- Estudio Three repository pushed to your Git provider
- Supabase project configured
- Environment variables ready
Deployment Steps
Sign up for Vercel
Go to vercel.com and sign up using your Git provider
Import repository
- Click Add New → Project
- Select your Git provider
- Find and select your Estudio Three repository
- Click Import
Configure project
Vercel auto-detects Vite configuration:
- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist - Install Command:
npm install
You typically don’t need to change these settings
Add environment variables
Click Environment Variables and add:
| Name | Value | Environment |
|---|---|---|
GROQ_API_KEY | gsk_xxxxxxxxxxxx | Production, Preview |
VITE_SUPABASE_URL | https://your-project.supabase.co | Production, Preview, Development |
VITE_SUPABASE_ANON_KEY | eyJxxxxxxxxxxxx | Production, Preview, Development |
VITE_APP_URL | https://your-domain.vercel.app | Production |
VITE_APP_URL | https://$VERCEL_URL | Preview |
NODE_ENV | production | Production |
Deploy
Click DeployVercel will:
- Clone your repository
- Install dependencies
- Build the application
- Deploy to a production URL
Serverless Functions
Estudio Three uses Vercel serverless functions for the AI coaching feature.Configuration (vercel.json)
Thevercel.json file configures routing and function settings:
- Rewrites: Routes
/api/*requests to serverless functions - maxDuration: Allows up to 30 seconds for AI responses (Groq API calls)
The
api/ directory in your project contains serverless function handlers that run on Vercel’s edge networkFunction Limits
| Plan | Max Duration | Concurrent Executions | Memory |
|---|---|---|---|
| Hobby (Free) | 10s | 10 | 1024 MB |
| Pro | 60s | 100 | 3008 MB |
Custom Domains
Add domain in Vercel
- Go to your project Settings → Domains
- Enter your custom domain (e.g.,
estudio.yourdomain.com) - Click Add
Update VITE_APP_URL
Go to Settings → Environment VariablesUpdate Then redeploy the application
VITE_APP_URL to your custom domain:Vercel automatically provisions SSL certificates for custom domains using Let’s Encrypt
CI/CD with GitHub
Vercel automatically creates deployments for Git events:Automatic Deployments
| Event | Deployment Type | URL |
|---|---|---|
Push to main | Production | https://estudio.vercel.app |
| Push to other branch | Preview | https://estudio-git-feature.vercel.app |
| Pull request | Preview | Unique URL per PR |
Preview Deployments
Every pull request gets a unique preview URL:- Test changes before merging
- Share with team for review
- Automatic comments on GitHub PRs with preview link
Branch Deployments
You can configure specific branches for production:Environment Variables Management
Updating Variables
Select environment
Choose which environments use this variable:
- Production: Live site
- Preview: Pull request previews
- Development: Local development (via
vercel env pull)
Environment Variable Precedence
- Vercel Dashboard: Highest priority
- vercel.json: Configuration file (not recommended for secrets)
- Local .env: Only for local development
Pulling Environment Variables Locally
Performance Optimization
Edge Network
Vercel deploys your application to a global Edge Network:- 50+ global regions: Content served from nearest location
- Automatic caching: Static assets cached at the edge
- Brotli compression: Automatic compression for faster loads
Build Optimization
Monitoring
View analytics
Go to Analytics tab to see:
- Page views
- Top pages
- Visitor geography
- Performance metrics
Check function logs
Functions tab shows:
- Invocation count
- Errors
- Duration
- Logs from serverless functions
Troubleshooting
Build fails with “Command failed”
Problem:npm run build fails during deployment
Solution: Check build logs in Vercel dashboard:
- Missing environment variables
- TypeScript errors
- Dependency installation failures
“Serverless Function has crashed”
Problem: API routes return 500 errors Solution:- Check Functions tab for error logs
- Verify
GROQ_API_KEYis set correctly - Ensure function doesn’t exceed timeout (10s on free tier)
OAuth redirect mismatch
Problem: Authentication fails with redirect error Solution:- Update
VITE_APP_URLto match your Vercel URL - Add URL to Supabase Authentication → URL Configuration:
- Redeploy after changing
VITE_APP_URL
Preview deployments using wrong environment
Problem: Preview deployments connect to production database Solution: Create separate Supabase project for staging:“This Serverless Function has exceeded the uncompressed maximum size”
Problem: Serverless function bundle too large (>250MB uncompressed) Solution:- Reduce dependencies in
api/functions - Use external APIs instead of bundling heavy libraries
- Consider upgrading to Pro plan (50MB limit → 250MB limit)
Cost Considerations
Hobby Plan (Free)
- ✅ Unlimited deployments
- ✅ 100 GB bandwidth/month
- ✅ 100 GB-Hrs serverless function execution
- ✅ SSL certificates
- ⚠️ 10s max function duration
- ⚠️ Commercial use not allowed
Pro Plan ($20/month)
- ✅ 1 TB bandwidth/month
- ✅ 1000 GB-Hrs serverless function execution
- ✅ 60s max function duration
- ✅ Commercial use allowed
- ✅ Custom deployment protection
- ✅ Advanced analytics
Most personal projects and MVPs work well on the Hobby plan. Upgrade when you need longer function timeouts or commercial usage.
Next Steps
After deploying to Vercel:- ✅ Configure environment variables
- ✅ Set up Supabase
- ✅ Test authentication and AI coaching features
- ✅ Add custom domain (optional)
- ✅ Set up monitoring and alerts
For on-premise deployments or full control, see Docker deployment