Build Process
The application uses Vite as its build tool. The build process is configured invite.config.ts and produces optimized static assets.
Build Commands
npm run build) creates an optimized bundle in the dist/ directory with:
- Minified JavaScript and CSS
- Code splitting for optimal loading
- Hashed filenames for cache busting
- Optimized assets
Environment Variables
Before deploying, you need to configure the following environment variables:Your Supabase project URL (e.g.,
https://xxxxx.supabase.co)Your Supabase anonymous/public API key
Deployment Platforms
- Vercel
- Netlify
- Cloudflare Pages
- Custom Server
Vercel provides seamless deployment for Vite applications with automatic builds and previews.
Build Settings
If deploying via the Vercel dashboard:- Framework Preset: Vite
- Build Command:
npm run build - Output Directory:
dist - Install Command:
npm install - Node Version: 18.x or higher
Domain Configuration
After deployment, configure your custom domain:Add Domain to Platform
Add your custom domain in your hosting platform’s dashboard (Vercel, Netlify, etc.).
Update DNS Records
Add the required DNS records provided by your platform:
- A Record or CNAME Record pointing to your platform
- AAAA Record for IPv6 (if provided)
Enable HTTPS
Most platforms automatically provision SSL certificates via Let’s Encrypt. Enable HTTPS redirect in your platform settings.
Post-Deployment Checklist
Environment variables are configured correctly
Supabase connection is working
Authentication flows work properly
All routes are accessible (no 404 errors)
SSL/HTTPS is enabled
Custom domain is configured
Error monitoring is set up (optional)
Performance monitoring is configured (optional)
Continuous Deployment
Enable automatic deployments by connecting your Git repository:- Connect Repository: Link your GitHub, GitLab, or Bitbucket repository to your hosting platform
- Configure Branch: Set your production branch (usually
mainormaster) - Enable Auto-Deploy: Every push to the production branch will trigger a new deployment
- Preview Deployments: Most platforms create preview deployments for pull requests
Preview deployments are useful for testing changes before merging to production.
Troubleshooting
Build Fails
- Check Node.js version (18.x or higher recommended)
- Verify all dependencies are installed:
npm install - Check for TypeScript errors:
npm run lint - Review build logs for specific error messages
Blank Page After Deployment
- Verify environment variables are set correctly
- Check browser console for errors
- Ensure base path is configured correctly in
vite.config.ts - Verify Supabase URL and API key are valid
404 on Page Refresh
- Configure URL rewriting rules (see platform-specific instructions above)
- Ensure all routes redirect to
index.htmlfor client-side routing
Supabase Connection Error
- Verify
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEYare set - Check Supabase project status
- Ensure API keys haven’t been regenerated
- Verify domain is in Supabase allowed URLs
Next Steps
Supabase Setup
Configure your Supabase backend for production
Analytics Dashboard
Monitor your platform with real-time analytics