Prompt file imported from TopGdaddy/cheese-and-dope (
.windsurf/workflows/deploy-frontend.md). Copyright stays with the author.
Deploy Frontend to Netlify
This workflow deploys the React frontend to Netlify.
Prerequisites
- Netlify CLI installed and authenticated, OR
- Netlify dashboard access with site connected to Git repository
Deployment Steps
-
Verify Frontend Configuration
- Ensure
frontend/.nvmrcexists with20(alternative to netlify.toml for Node version) - Ensure
frontend/netlify.tomlexists with correct build settings - Ensure
frontend/package.jsonhas Node engine set to>=20.0.0 - Ensure
REACT_APP_BACKEND_URLis set in Netlify environment variables
- Ensure
-
Check Build Command
- Verify
netlify.tomlhas:command = "npm install --legacy-peer-deps && npm run build" - This handles React 19 peer dependency issues
- Verify
-
Deploy to Netlify
Option A: Deploy via Netlify CLI (if installed)
cd frontend netlify login netlify link netlify deploy --prodOption B: Auto-deploy via Git (recommended)
- Push to your connected Git repository (GitHub/GitLab)
- Netlify automatically builds and deploys
- Check deploy logs in Netlify dashboard
Option C: Manual deploy via Netlify Dashboard
- Go to https://app.netlify.com
- Select your site
- Click "Deploys" → "Trigger deploy"
-
Verify Deployment
- Check that build completes without errors
- Verify site loads at your Netlify URL
- Test API calls to Railway backend
- Confirm CORS is working (no browser console errors)
-
Environment Variables Ensure these are set in Netlify dashboard:
REACT_APP_BACKEND_URL= your Railway backend URLNODE_VERSION= 20 (or set in netlify.toml)
Troubleshooting
- If build fails with React version errors: Check
--legacy-peer-depsflag is in build command - If API calls fail: Verify
REACT_APP_BACKEND_URLpoints to correct Railway URL - If CORS errors: Check backend CORS origins include your Netlify domain
- If auth fails: Verify cookies are configured with
secure=true, samesite=nonein backend
Post-Deployment
- Test login/logout flow
- Verify real-time tracking (Socket.IO) connects
- Check all dashboard features work correctly