npm install -g wrangler
wrangler logincd apps/web
npm install
npm run build # This generates 'out' foldercd ../..
npx wrangler pages deploy apps/web/out --project-name=robocodeSet these in Cloudflare Pages Dashboard → Settings → Environment Variables:
WORKOS_API_KEY=sk_test_...
WORKOS_CLIENT_ID=client_...
COCKROACHDB_CONNECTION_STRING=postgresql://...
APPWRITE_PROJECT_ID=app_...
APPWRITE_API_KEY=...
JWT_SECRET=your_256_bit_secret
BATTLE_ENGINE_SECRET=your_256_bit_secret
The Express API server (apps/server) must be deployed separately to a Node.js platform:
- Railway:
railway up - Render: Connect GitHub repo, set root to
apps/server - Fly.io:
fly launchinapps/server
-
Deploy Backend First:
cd apps/server npm install # Deploy to Railway/Render/Fly
-
Update Frontend API URLs:
- Edit
apps/web/src/lib/api.ts - Replace
/apiwith your deployed backend URL
- Edit
-
Deploy Frontend:
cd apps/web npm install npm run build npx wrangler pages deploy out --project-name=robocode
- Frontend: https://robocode.pages.dev
- Backend: (your-railway-url.railway.app)