The dev branch is now fully configured for automated testing, deployment previews, and continuous integration. This guide explains how to work with the dev branch and keep it in sync with main.
main (production)
↓
develop/dev (staging/testing)
↓
feature/* (development)
-
CI Pipeline (
.github/workflows/ci.yml)- Triggers: Push/PR to main, develop, or dev
- Actions: Lint, type-check, test, build
- Matrix: Node 18 & 20
-
Deploy Preview (
.github/workflows/deploy-preview.yml)- Triggers: PR to main, develop, or dev
- Actions: Deploy to Vercel preview environment
- Provides preview URL in PR comments
-
Auto-merge (
.github/workflows/auto-merge.yml)- Automatic PR merging when all checks pass
- Requires: 1+ approval, no changes requested
- Label:
auto-mergeor Dependabot PRs
For dev branch deployments, configure these in your CI/CD environment:
# Solana Configuration
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
WALLET_PRIVATE_KEY=your_private_key_here
# Admin Panel
ADMIN_USERNAME=admin
ADMIN_PASSWORD=secure_password
JWT_SECRET=your_jwt_secret
# Trading Configuration
MINIMUM_PROFIT_SOL=0.01
MAX_SLIPPAGE=0.01
GAS_BUFFER=1.5
# Dev Fee (configure before enabling)
DEV_FEE_ENABLED=true
DEV_FEE_PERCENTAGE=0.10
DEV_FEE_WALLET=your_wallet_address
# Vercel Deployment
VERCEL_TOKEN=your_vercel_token
VERCEL_PROJECT_ID=your_project_id
VERCEL_ORG_ID=your_org_id
# Optional: Enhanced Features
QUICKNODE_RPC_URL=your_quicknode_url
NEYNAR_API_KEY=your_neynar_keyNavigate to: Settings → Secrets and variables → Actions
Add these secrets:
VERCEL_TOKENVERCEL_PROJECT_IDVERCEL_ORG_IDNEXT_PUBLIC_RPC_URL(optional)CODECOV_TOKEN(optional)
# Update local branches
git checkout main
git pull origin main
git checkout dev
git pull origin dev
# Merge main into dev
git merge main
# Resolve any conflicts
# Then push
git push origin devgit checkout dev
git pull origin dev
# Rebase dev on top of main
git rebase origin/main
# Force push (use with caution)
git push origin dev --force-with-lease# Create a sync branch
git checkout -b sync-main-to-dev main
git merge origin/dev
# Push and create PR
git push origin sync-main-to-dev
# Open PR: sync-main-to-dev → dev# Install dependencies
npm ci
cd webapp && npm ci
# Run linting
npm run lint
npm run lint:webapp
# Run type checking
npm run type-check
npm run type-check:webapp
# Run tests
npm test
npm run test:webapp
# Build
npm run build:backend
npm run build:webappPush to dev branch triggers:
- ✅ ESLint validation (backend & webapp)
- ✅ TypeScript type checking
- ✅ Unit tests (39 tests)
- ✅ Security audits
- ✅ Build verification (Node 18 & 20)
Every PR to dev automatically:
- Builds the webapp
- Deploys to Vercel preview
- Comments preview URL on PR
- Updates preview on new commits
Example preview URL:
https://reimagined-jupiter-xxx.vercel.app
Preview deployments include:
/api/health- API health status- Root page - Full webapp functionality
- All mock/placeholder code replaced or documented
- No TODO/FIXME comments remain
- ESLint configuration enforces quality
- TypeScript strict mode enabled
- No secrets in code
- All sensitive data from environment variables
- Input validation on all endpoints
- Transaction security validated
- MEV protection documented
- 39 unit tests passing
- Integration test framework ready
- CI runs tests automatically
- Type safety enforced
- Environment variables documented
- Security guide complete
- CI/CD setup documented
- Architecture clearly explained
These features are scaffolded and ready for production SDK integration:
Status: Validated framework, awaiting SDK
To Enable:
npm install @mrgnlabs/marginfi-client-v2Update src/integrations/marginfiV2.ts:
- Replace placeholder instructions with SDK calls
- Test on devnet first
- Deploy to mainnet
Status: Error handling ready, needs package
To Enable:
npm install @bonfida/spl-name-serviceUpdate src/utils/profitDistribution.ts:
- Implement SNS resolution logic
- Test with known .sol domains
Status: Wallet validation working, program integration needed
To Enable: Integrate with specific airdrop program instructions:
- Jupiter airdrop program
- Jito airdrop program
- Pyth airdrop program
- Go to repository → Actions tab
- Select workflow run
- View job logs for details
# If using Vercel CLI
vercel logs --project=reimagined-jupiter
# Or check Vercel dashboard
# https://vercel.com/dashboardIssue: CI fails with dependency errors
# Solution: Update package-lock.json
npm ci
npm run build
git add package-lock.json
git commit -m "Update dependencies"Issue: Preview deployment fails
# Solution: Check Vercel secrets are configured
# Verify VERCEL_TOKEN, VERCEL_PROJECT_ID, VERCEL_ORG_IDIssue: Tests fail on CI but pass locally
# Solution: Ensure Node version matches (use 20)
nvm use 20
npm testnpm run validate # Runs lint, type-check, and testsgit commit -m "feat: Add new feature X"
git commit -m "fix: Resolve issue with Y"
git commit -m "docs: Update README"Sync with main at least weekly to avoid merge conflicts.
Always check the preview URL before merging to ensure:
- UI renders correctly
- API endpoints work
- No console errors
Don't merge until all CI checks pass:
- ✅ Lint
- ✅ Type check
- ✅ Tests
- ✅ Build
If dev deployment has issues:
# Revert to last known good commit
git revert HEAD
git push origin dev
# Or reset to specific commit
git reset --hard <commit-hash>
git push origin dev --force-with-lease- CI/CD Documentation:
.github/CI_CD_SETUP_GUIDE.md - Security Guide:
SECURITY_GUIDE.md - Architecture:
ARCHITECTURE.md - Contributing:
CONTRIBUTING.md
Run these before considering dev branch production-ready:
# 1. Clean install
rm -rf node_modules webapp/node_modules
npm ci
cd webapp && npm ci && cd ..
# 2. Lint everything
npm run lint && npm run lint:webapp
# 3. Type check
npm run type-check && npm run type-check:webapp
# 4. Test
npm test
# 5. Build
npm run build
# 6. Security audit
npm audit --audit-level=high
cd webapp && npm audit --audit-level=highAll commands should pass with zero errors.
Last Updated: 2025-12-21 Branch Status: ✅ Fully Automated & Sync-Ready Next Steps: Continue Phase 4 - Build & Test Validation