Vercel Deployment
Deploy RushChat frontend application using Vercel.
Vercel Deployment Overview
Prerequisites
- Vercel account (https://vercel.com/)
- GitHub account
- Code pushed to GitHub
Deployment Steps
1. Create Vercel Project
- Log in to Vercel
- Click "Add New Project"
- Select RushChat repository
- Configure project settings:
- Framework Preset: Create React App
- Root Directory:
client - Build Command:
npm run build - Output Directory:
build
2. Configure Environment Variables
Add environment variables in project settings:
REACT_APP_API_URL=https://your-backend.railway.app
REACT_APP_SOCKET_URL=https://your-backend.railway.app
3. Deploy
- Click "Deploy"
- Vercel will automatically build and deploy
- Wait for deployment to complete
- Get deployment URL
4. Configure Custom Domain
- In project settings
- Click "Domains"
- Add custom domain
- Configure DNS records
Auto Deployment
GitHub Integration
Vercel automatically:
- Monitors GitHub pushes
- Automatically triggers deployment
- Generates preview deployments (Pull Request)
Preview Deployment
Each Pull Request generates a preview deployment:
- Independent deployment URL
- For testing and preview
- Does not affect production environment
Build Optimization
Environment Variables
Ensure all environment variables are configured:
REACT_APP_API_URLREACT_APP_SOCKET_URL- Other frontend required variables
Build Configuration
Vercel automatically optimizes:
- Code splitting
- Resource compression
- CDN distribution
Troubleshooting
Build Failed
- Check Node.js version
- Check if dependencies are correct
- View build logs
Runtime Errors
- Check environment variables
- Check API URL configuration
- View browser console
CORS Error
- Check backend CORS configuration
- Ensure
CLIENT_URLis correct - Check if domain matches