Prerequisites
- A Vercel account (free tier works)
- Git repository containing your Autonome codebase
- Backend API already deployed and accessible
Deployment Configuration
vercel.json
The project includes avercel.json configuration file:
vercel.json
Vercel will automatically use Bun as the package manager and runtime based on this configuration. No additional setup is required.
Environment Variables
Configure these environment variables in your Vercel project settings:Required Variables
Optional Variables
Deployment Steps
Connect Repository
- Go to vercel.com and sign in
- Click “Add New Project”
- Import your Git repository (GitHub, GitLab, or Bitbucket)
Configure Build Settings
Vercel will auto-detect the settings from
vercel.json:- Framework Preset: None (TanStack Start uses custom Vite config)
- Build Command:
bun run build - Install Command:
bun install - Output Directory:
.output/public(auto-detected)
Set Environment Variables
In the Vercel project settings:
- Go to Settings → Environment Variables
- Add
VITE_API_URLwith your backend URL - Add any optional variables like
VITE_APP_TITLE - Save changes
Deploy
Click Deploy. Vercel will:
- Install dependencies with
bun install - Build the project with
bun run build - Deploy to a global CDN
- Provide a production URL (e.g.,
autonome.vercel.app)
Build Process
Thebun run build command executes:
package.json
.output/public/ that Vercel serves via its global CDN.
What Gets Built
- Static Assets: CSS, JS bundles with code splitting
- HTML Pages: Pre-rendered for optimal SEO
- Client Router: TanStack Router handles navigation
- API Client: oRPC client configured to call
VITE_API_URL
Custom Domains
To use a custom domain:Troubleshooting
API Requests Fail
Problem: Frontend cannot reach backend API Solutions:- Verify
VITE_API_URLis set correctly in Vercel environment variables - Check backend CORS settings include your Vercel domain
- Ensure backend is running and accessible at the configured URL
- Check browser console for specific error messages
Build Failures
Problem:bun run build fails during deployment
Solutions:
- Check Vercel build logs for specific error messages
- Verify all required dependencies are in
package.json - Test build locally:
bun run build - Ensure Bun version matches (Vercel uses latest stable)
Environment Variables Not Working
Problem:VITE_API_URL is undefined in browser
Solutions:
- Verify variable is prefixed with
VITE_ - Redeploy after adding environment variables
- Check that variable is set in Vercel dashboard
- Clear browser cache and hard reload
Preview Deployments
Vercel automatically creates preview deployments for:- Every Git branch
- Every pull request
- Every commit
autonome-git-feature-branch.vercel.app
Preview deployments use the same environment variables as production. To test against a staging backend, create a separate Vercel project with different
VITE_API_URL.Performance Optimization
The frontend build includes:- Code Splitting: Automatic route-based chunking
- Tree Shaking: Removes unused code
- Minification: Compressed JS/CSS
- CDN Caching: Static assets cached globally
Monitoring
Vercel provides built-in monitoring:- Analytics: Page views, unique visitors
- Speed Insights: Core Web Vitals
- Logs: Real-time deployment and runtime logs
Next Steps
Backend Deployment
Deploy the API server to VPS
Database Setup
Configure PostgreSQL and migrations

