Prerequisites
Before deploying, ensure you have:- ✅ A configured Supabase project (setup guide)
- ✅ Environment variables ready (variables list)
- ✅ Git repository with your Hive source code
Deploying to Vercel (Recommended)
Vercel provides the best experience for deploying Hive with automatic serverless function deployment.Quick Deploy
Import Repository
- Go to vercel.com and sign in
- Click Add New… → Project
- Import your Git repository (GitHub, GitLab, or Bitbucket)
Configure Build Settings
Vercel should auto-detect the configuration. If not, set:
- Framework Preset: Other
- Build Command: (leave empty)
- Output Directory:
frontend - Install Command:
npm install - Root Directory:
source/frontend
Serverless Functions
Vercel automatically deploys files in the/api directory as serverless functions. Hive includes:
Both functions use the
@supabase/supabase-js package specified in package.json. Vercel automatically installs dependencies for serverless functions.Vercel Configuration
Create avercel.json in the frontend directory for advanced configuration:
vercel.json
Defines how Vercel processes different file types. Static files use
@vercel/static, API functions use @vercel/node.Routing rules for requests. API routes go to serverless functions, all other requests serve static files.
Memory allocation for serverless functions in MB. Increase if functions timeout.
Maximum execution time for serverless functions in seconds.
Deploying to Netlify
Netlify also supports serverless functions with a similar workflow.Netlify Functions have a different file structure than Vercel. You may need to adjust the
api directory exports to match Netlify’s format.Deploying to Other Platforms
Cloudflare Pages
Cloudflare Pages supports static hosting but requires Cloudflare Workers for serverless functions:- Deploy static files to Cloudflare Pages
- Deploy
/apifunctions as Cloudflare Workers - Configure routing rules to proxy
/api/*to Workers
Render
Render supports static sites with serverless functions:- Create a new Static Site on Render
- Set Build Command to (empty)
- Set Publish Directory to
source/frontend - Add environment variables
- For API functions, create separate Web Services or use Render’s serverless support (if available)
Railway
Railway is better suited for full-stack applications:- Deploy as a Node.js service
- Use Express or similar to serve static files and handle
/apiroutes - Not recommended for this static + serverless architecture
Custom Domain Setup
Vercel
Add Domain
- Go to Project Settings → Domains
- Enter your custom domain (e.g.,
hive.company.com) - Click Add
Configure DNS
Vercel provides DNS records to add to your domain registrar:
- A Record: Points to Vercel’s IP
- CNAME Record: Points to
cname.vercel-dns.com
Netlify
Similar process:- Domain Settings → Add custom domain
- Configure DNS with provided records
- Enable HTTPS (automatic with Let’s Encrypt)
SSL/HTTPS Configuration
Both Vercel and Netlify provide automatic SSL certificates via Let’s Encrypt:- ✅ Automatic renewal - Certificates renew before expiration
- ✅ Force HTTPS - Redirect HTTP to HTTPS automatically
- ✅ Modern TLS - Supports TLS 1.2 and 1.3
Environment-Specific Configuration
Preview Deployments
Both Vercel and Netlify support preview deployments for pull requests:- Vercel: Automatic preview URLs for every push
- Netlify: Deploy previews with unique URLs
Production vs Development
Use separate Supabase projects for production and development:Post-Deployment Checklist
Verify Environment Variables
Check that all required variables are set correctly in the deployment platform.
Performance Optimization
Caching
Configure caching headers invercel.json:
CDN
Both Vercel and Netlify include global CDN by default:- Static assets cached at edge locations
- Automatic compression (gzip, Brotli)
- HTTP/2 and HTTP/3 support
Serverless Function Optimization
Reduce cold start times:- Keep function code minimal
- Use environment variables instead of fetching config
- Cache Supabase client instances when possible
Troubleshooting
500 Error on API routes
500 Error on API routes
Serverless function crashed or timed out.Solution:
- Check function logs for error messages
- Verify environment variables are set
- Increase
maxDurationinvercel.jsonif timeout - Check that
@supabase/supabase-jsis inpackage.jsondependencies
404 Error on API routes
404 Error on API routes
API functions not deployed correctly.Solution:
- Verify
/apidirectory exists insource/frontend - Check build logs for function deployment messages
- Ensure
vercel.jsonornetlify.tomlroutes are correct
CORS errors on API calls
CORS errors on API calls
Missing CORS headers in serverless functions.Solution: Add CORS headers to API responses:
Build fails with 'Module not found'
Build fails with 'Module not found'
Missing dependencies or incorrect paths.Solution:
- Run
npm installinsource/frontend - Verify
package.jsonincludes@supabase/supabase-js - Check that all import paths are correct
Deployment succeeds but site is blank
Deployment succeeds but site is blank
Incorrect output directory or missing
index.html.Solution:- Verify
index.htmlexists insource/frontend - Check deployment logs for “Publish directory” path
- Ensure all referenced assets (CSS, JS) are accessible
Next Steps
Environment Variables
Review all available environment variables
Supabase Setup
Configure your Supabase backend
