Deployment Overview
Exchange Web is a static React application that can be deployed to any platform supporting static site hosting. The build output from Vite is optimized for production and ready to serve.Prerequisites
Before deploying, ensure:- Your application builds successfully:
yarn build - All tests pass (if applicable)
- Environment variables are configured
- Production configuration is set
Vercel Deployment (Recommended)
Exchange Web includes Vercel configuration and is optimized for Vercel deployment.Configuration
The project includesapps/web/vercel.json for routing configuration:
Deploy to Vercel
For monorepo deployment, ensure Vercel builds from the root directory to properly resolve workspace dependencies.
Vercel Dashboard Deployment
Alternatively, deploy via the Vercel dashboard:Connect repository
- Go to vercel.com
- Click “Add New Project”
- Import your Git repository
Configure build settings
Set the following in your project settings:
| Setting | Value |
|---|---|
| Framework Preset | Vite |
| Root Directory | apps/web |
| Build Command | cd ../.. && yarn build |
| Output Directory | dist |
| Install Command | yarn install |
Add environment variables
In the Vercel dashboard, add any required environment variables (prefixed with
VITE_):VITE_API_URLVITE_WS_URL- Any other configuration
Vercel Analytics
Exchange Web includes@vercel/analytics for performance monitoring:
Alternative Deployment Platforms
Netlify
AWS S3 + CloudFront
Configure CloudFront
- Create a CloudFront distribution
- Point to your S3 bucket
- Configure error pages to redirect to
/index.htmlfor SPA routing
Docker Deployment
Environment Variables
Production Environment Variables
Create.env.production in apps/web:
Platform-Specific Configuration
Production Considerations
Performance
- Enable gzip/brotli compression on your server
- Configure CDN caching for static assets
- Set proper cache headers for immutable assets
- Enable HTTP/2 or HTTP/3 for faster loading
Security
HTTPS
Always serve over HTTPS in production. Most platforms (Vercel, Netlify) provide this automatically.
Monitoring
- Enable Vercel Analytics (included in dependencies)
- Set up error tracking (Sentry, Rollbar, etc.)
- Monitor Web Vitals for performance
- Configure uptime monitoring
Rollback Strategy
Most platforms support instant rollback to previous deployments. Familiarize yourself with your platform’s rollback process.
- Vercel: Instant rollback via dashboard
- Netlify: Rollback to any previous deploy
- AWS: Deploy previous version from S3
CI/CD Integration
GitHub Actions Example
Troubleshooting
Build Fails
- Check Node.js version (must be 18+)
- Clear Turborepo cache:
yarn turbo build --force - Verify all dependencies are installed
Routes Don’t Work
- Ensure rewrites/redirects are configured for SPA routing
- Verify
vercel.jsonor equivalent is present
Environment Variables Not Loading
- Confirm variables are prefixed with
VITE_ - Rebuild after changing environment variables
- Check platform-specific environment variable configuration
Next Steps
After deployment:- Set up monitoring and alerting
- Configure custom domain
- Enable automatic deployments from Git
- Set up staging environment
- Document your deployment process