Team Workflow
Work quickly within a team dynamic
Last updated on: November 5, 2025
No Preview Environments: Cloudflare Workers doesn't currently support Convex preview deployments like Vercel does. All testing must be done locally before creating PRs.
Development Workflow
Every time anyone in your team comes back to work on a project based off of Yugen within a team dynamic, do the following:
1. Pull the latest changes
git checkout main && git pull2. Install dependencies
bun installIn case any new dependencies were added
3. Start Dev Servers
Terminal 1 - Cloudflare Workers dev server (via Alchemy):
From the apps/web/ directory:
bun alchemy devMake sure you're in the apps/web/ directory (where alchemy.run.ts exists).
Terminal 2 - Frontend Web Server + Convex + Fumadocs:
bun run devThis starts:
- App:
http://localhost:3002(web server) - Cloudflare Workers:
http://localhost:3001(Cloudflare Workers dev server) - Docs:
http://localhost:4000
4. Webhook Testing
ngrok http 3002Remember, you only need to run ngrok when testing webhooks (payments only). Use port 3002 (web server), not 3001 (Cloudflare Workers dev server).
If you do use ngrok, every time you run ngrok http 3002, it will generate a new URL so you need to update these locations:
-
Local Environment (
.env.convex.dev,packages/backend/.env.local,apps/web/.env.local):SITE_URL=https://new-ngrok-url.ngrok.app -
Apply to Convex:
bun run setup:convex:dev -
Polar.sh Webhook URL:
- Navigate to Polar Dashboard → Settings → Webhooks
- Update the webhook URL to use your new ngrok URL
5. Restart Servers
# Stop and restart both dev servers
bun run dev # From root
bun alchemy dev # From apps/web/Building Features and Fixing Bugs
Now you can start building features or fixing bugs.
1. Creating a PR
Once you think you're done with a feature (and have sufficiently tested it locally), you can do the following:
- Ensure all tests pass locally
- Test the feature thoroughly with ngrok (if webhooks involved)
- Document any new environment variables in the PR description
- Open a PR
- Wait for team review and approval
Since Cloudflare Workers doesn't support preview environments with Convex, make sure you test everything locally before opening the PR.
2. Merging to Production
Once the PR has been tested and approved, you should do the following as the Author of the PR:
- Go to your Convex Dashboard →
Settings→Environment Variables→Production - Add any extra Environment Variables that this PR required
- Add any extra Environment Variables that this PR required to your Cloudflare Workers production settings
- Click
Save - Deploy to production:
bun run deploy - Test the change in Production to ensure it works as expected and hasn't broken anything
- Monitor Convex logs for any errors
Feature Flags
Feature flags are an additional safety layer that let you test new features in production without affecting all users.
Coming soon...
Best Practices
- ✅ Always test locally before creating PR
- ✅ Document all environment variable changes in PR description
- ✅ Test production thoroughly after merge
- ✅ Monitor Convex and Cloudflare Workers logs
- ✅ Keep ngrok URLs updated when testing webhooks
- ❌ Don't merge untested code
- ❌ Don't skip local testing because preview environments aren't available