- Node.js 18+
- Rust toolchain (for contract)
- Stellar Testnet account with native assets
- Supabase account
- Vercel/Render/Railway account (for backend)
- Git
cd contract
cargo build --target wasm32-unknown-unknown --release
soroban contract optimize --wasm target/wasm32-unknown-unknown/release/stellar_escrow.wasmOutput: target/wasm32-unknown-unknown/release/stellar_escrow_optimized.wasm
# Set environment variables
export STELLAR_NETWORK=testnet
export SOROBAN_RPC_URL=https://soroban-testnet.stellar.org:443
export SOROBAN_NETWORK_PASSPHRASE="Test SDF Network ; February 2021"
# Use Soroban CLI to deploy
soroban contract deploy --wasm target/wasm32-unknown-unknown/release/stellar_escrow_optimized.wasm
# Save the contract ID
export CONTRACT_ID=C...curl https://soroban-testnet.stellar.org:443 \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getContractData",
"params": ["'$CONTRACT_ID'"]
}'- Go to supabase.com
- Create new project
- Save connection details
cd backend
# Create .env with DATABASE_URL from Supabase
echo "DATABASE_URL=postgresql://user:password@db.supabase.co:5432/postgres" > .env
# Run migrations
npx prisma migrate deploy
# Generate Prisma client
npx prisma generate-- In Supabase SQL Editor
-- Enable RLS on all tables
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
ALTER TABLE escrows ENABLE ROW LEVEL SECURITY;
ALTER TABLE milestones ENABLE ROW LEVEL SECURITY;
ALTER TABLE feedbacks ENABLE ROW LEVEL SECURITY;
ALTER TABLE transaction_logs ENABLE ROW LEVEL SECURITY;
-- Create policies (adjust based on your requirements)
-- Users can only see their own data
CREATE POLICY "Users can see own data" ON users
FOR SELECT USING (auth.uid()::text = id);cd backend
npm install# .env file
STELLAR_NETWORK=testnet
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
CONTRACT_ID=C... # from Step 1.2
DATABASE_URL=postgresql://... # from Step 2.1
PORT=3001
NODE_ENV=production
USE_REAL_CONTRACT=true
ENABLE_AUTO_APPROVAL_AGENT=true
ENABLE_SYNC_AGENT=true
ENABLE_FEEDBACK_AGENT=true# 1. Push code to GitHub
git push origin main
# 2. Create Render web service
# - Connect GitHub repo
# - Set environment variables
# - Build: npm install && npx prisma migrate deploy
# - Start: npm start
# - Use PostgreSQL external database from Supabase
# 3. Verify deployment
curl https://your-backend.onrender.com/healthOption A: Same process as backend Option B: Deploy to separate service on Render Option C: Use GitHub Actions + scheduled workflows
# .github/workflows/agents.yml
name: Run Agents
on:
schedule:
- cron: '*/5 * * * *' # Every 5 minutes
jobs:
agents:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: cd backend && npm install
- run: cd backend && npm run agentcd frontend
npm install# .env.production
VITE_API_URL=https://your-backend.onrender.com
VITE_STELLAR_NETWORK=testnet
VITE_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.orgnpm run build# Option 1: Vercel CLI
npm install -g vercel
vercel --prod
# Option 2: GitHub Integration
# 1. Push to GitHub
# 2. Connect repo on vercel.com
# 3. Set environment variables
# 4. Deploy automatically on pushUpdate all references to your deployment URLs:
- Backend: https://your-backend.onrender.com
- Frontend: https://your-domain.vercel.app
- Environment variables in all services
Backend src/server.js:
app.use(cors({
origin: ['https://your-domain.vercel.app'],
credentials: true
}));# Render provides automatic logging
# View at: https://dashboard.render.com/logs
# Add optional: Sentry for error tracking
npm install --save @sentry/nodeRender will automatically healthcheck:
GET /health every 5 minutes
Restart if no 200 response in 30s
Supabase automatically backs up:
- Daily backups retained for 7 days
- Weekly backups retained for 4 weeks
- Access via Supabase Dashboard > Backups
# Create testnet account with friendbot
curl -X POST https://friendbot.stellar.org?addr=GXXXXXX
# Test all flows:
# 1. Create escrow
# 2. Deposit funds
# 3. Submit milestone
# 4. Approve milestone
# 5. Check auto-release
# Use Testnet Explorer: https://stellar.expert/explorer/testnet/npm install -g k6
# Create load test script
# Test endpoints with concurrent users
k6 run loadtest.jscd backend
npm test
cd ../frontend
npm test- Contract deployed and verified on chain
- Backend running on production server
- Database configured and backed up
- Frontend deployed to CDN
- Custom domain configured
- SSL certificates valid
- Monitoring and logging active
- All API keys stored as environment variables
- Database password changed from default
- CORS properly configured
- Rate limiting enabled
- Input validation on all endpoints
- Secrets not committed to git
- Database backups automated
- Agents running and logging
- Alert channels configured (Slack, email)
- Runbook created for common issues
- Disaster recovery plan documented
- Team trained on deployment process
- Terms of service published
- Privacy policy compliant with GDPR/CCPA
- KYC requirements if needed
- AML/CFT compliance check
- Insurance considerations
# Check contract state
soroban contract info --id C...
# Check recent events
curl https://soroban-testnet.stellar.org \
-X POST -H "Content-Type: application/json" \
-d '{"method": "getEvents", "contract_id": "C..."}'# Check logs
tail -f logs.txt
# Restart service
npm start
# Clear database (dev only)
npx prisma migrate reset# Build locally to test
npm run build
npm run preview
# Check browser console for errors
# Check Network tab for API calls- Deploy new contract version
- Update CONTRACT_ID in backend
- Redeploy backend
- Notify users
- Revert to last working version
- Use Render dashboard to roll back
- Check database integrity
- Restart agents
- Restore from Supabase backup
- Verify data integrity
- Notify users of outage
- Clear caches
- Daily: Check health endpoints, review logs
- Weekly: Check agent execution, database size
- Monthly: Review costs, update dependencies
- Quarterly: Full backup test, disaster recovery drill
- GitHub Issues: Report bugs
- Discussions: Ask questions
- Stellar Developers Discord: Community support
- Email: contact@example.com
- Contract deployment:
100 XLM ($10) - Contract calls:
0.1 XLM per call ($0.01)
- Free tier: Up to 500MB database
- Starter: $25/month for larger databases
- Plus: $115/month for additional features
- Backend: $7-12/month for hobby tier
- Add Postgres: $15/month separate
- Frontend: Free tier
- Pro: $20/month for advanced features
Total estimate: $50-100/month for production