{"slug":"developers/GO_LIVE_DEPLOYMENT_GUIDE","title":"INTEGRATEWISE v1.0 — GO-LIVE DEPLOYMENT GUIDE","section":"developers","sectionLabel":"Developers","status":"unclassified","type":"document","path":"developers/GO_LIVE_DEPLOYMENT_GUIDE.mdx","bytes":11627,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\n\n> **Tier C — Historical.** This document is a point-in-time snapshot preserved for reference. For current architecture, see [CANONICAL_PLATFORM_ARCHITECTURE.md](../architecture/CANONICAL_PLATFORM_ARCHITECTURE.md).\n\n**Status:** Ready for Production  \n**Date:** June 27, 2026  \n**Architecture:** Locked (15 layers, 30 Gateway endpoints)  \n**Deployment:** Multi-service (Gateway, Core Engine, Database)  \n**Frontends:** Web, Mobile, Desktop (all use same Gateway)  \n\n---\n\n## EXECUTIVE SUMMARY\n\nYou now have:\n- ✅ Complete, locked backend architecture\n- ✅ 30-endpoint Gateway contract (frozen, no changes)\n- ✅ Core Engine for event processing + AI routing\n- ✅ Spine database for continuity\n- ✅ Memory system with scopes + decay\n- ✅ Connector pool for 100+ data sources\n- ✅ Governance & approvals layer\n- ✅ Chat interface (L1 Shell)\n- ✅ Universal SDK for all frontends\n\n**Next: Deploy and connect all UIs to the Gateway.**\n\n---\n\n## DEPLOYMENT PHASES\n\n### PHASE 1: INFRASTRUCTURE (Day 1-2)\n\n#### 1.1 Deploy Gateway Service\n\n```bash\n# Navigate to gateway service\ncd services/gateway\n\n# Install dependencies\nnpm install\n\n# Deploy to CloudFlare Workers\nnpm run deploy\n\n# Verify deployment\ncurl https://integratewise-gateway.workers.dev/api/v1/health\n# Expected: { status: \"ok\", database: \"connecting...\" }\n```\n\n**What happens:**\n- Hono worker deployed to CloudFlare Workers\n- All 30 routes become accessible\n- Auto-scales to handle 1M+ requests/day\n\n**Environment variables needed:**\n```\nNEON_DATABASE_URL=postgresql://...\nCORE_ENGINE_URL=https://integratewise-core-engine.workers.dev\nAUTH_JWT_SECRET=your-secret-here\nRATE_LIMIT_QUOTA=10000\n```\n\n#### 1.2 Deploy Core Engine\n\n```bash\ncd services/core-engine\n\nnpm install\nnpm run build\n\n# Deploy to CloudFlare Workers\nnpm run deploy\n\n# Verify deployment\ncurl https://integratewise-core-engine.workers.dev/health\n# Expected: { status: \"ok\", service: \"core-engine\", version: \"1.0.0\" }\n```\n\n**What happens:**\n- Event ingestion worker deployed\n- AI routing engine ready\n- Async task generation enabled\n\n**Environment variables:**\n```\nOPENAI_API_KEY=sk-...\nANTHROPIC_API_KEY=sk-ant-...\nNEON_DATABASE_URL=postgresql://...\n```\n\n#### 1.3 Set Up Neon Database\n\n```bash\n# Get Neon connection string\nexport DATABASE_URL=\"postgresql://user:password@host/integratewise\"\n\n# Connect to database\npsql $DATABASE_URL\n\n# Run migrations\nnpm run migrate\n\n# Verify tables created\nSELECT table_name FROM information_schema.tables \n  WHERE table_schema = 'public';\n\n# Expected tables:\n#   - spine_events\n#   - ai_tasks\n#   - memory\n#   - signals\n#   - insights\n#   - connectors\n#   - users\n#   - tenants\n```\n\n**Database setup:**\n```bash\n# In services/core-engine\nnpm run db:seed  # Load sample data\n\n# Verify data\nSELECT COUNT(*) FROM spine_events;  # Should show 0\nSELECT COUNT(*) FROM connectors;     # Should show ~100 sources\n```\n\n#### 1.4 Configure OAuth Connectors\n\nFor each provider, create OAuth app:\n\n**Stripe:**\n```bash\n# Go to https://dashboard.stripe.com/apikeys\n# Create Restricted API Key\nexport STRIPE_API_KEY=\"sk_test_...\"\n```\n\n**Slack:**\n```bash\n# Go to https://api.slack.com/apps\n# Create app, get OAuth token\nexport SLACK_BOT_TOKEN=\"xoxb-...\"\n```\n\n**GitHub:**\n```bash\n# Go to https://github.com/settings/apps\n# Create OAuth app\nexport GITHUB_APP_ID=\"12345\"\nexport GITHUB_APP_SECRET=\"ghp_...\"\n```\n\n**HubSpot:**\n```bash\nexport HUBSPOT_PRIVATE_APP_TOKEN=\"pat-...\"\n```\n\n*Repeat for 96+ other sources (setup script available)*\n\n```bash\nnpm run setup:connectors --auto\n```\n\n---\n\n### PHASE 2: FRONTEND WIRING (Day 3-4)\n\n#### 2.1 Update Web App\n\n```bash\ncd apps/web\n\n# Update environment\ncat > .env.local << EOF\nNEXT_PUBLIC_GATEWAY_URL=https://integratewise-gateway.workers.dev\nNEXT_PUBLIC_CORE_ENGINE_URL=https://integratewise-core-engine.workers.dev\nNEXT_PUBLIC_WEBSOCKET_URL=wss://integratewise-gateway.workers.dev\nEOF\n\n# Install dependencies\nnpm install\n\n# Build\nnpm run build\n\n# Verify build\nnpm run type-check\n\n# Deploy to Vercel\nnpm run deploy\n```\n\n**What this does:**\n- Chat Shell now talks to Gateway\n- All API calls routed through Gateway Client SDK\n- Real-time WebSocket updates enabled\n- Database queries work through Gateway\n\n#### 2.2 Update Mobile App\n\n```bash\ncd apps/mobile\n\n# Update config\ncat > config.ts << EOF\nEOF\n\nnpm install\n\n# iOS\nnpm run build:ios\nnpm run deploy:app-store\n\n# Android\nnpm run build:android\nnpm run deploy:play-store\n```\n\n#### 2.3 Update Desktop App\n\n```bash\ncd apps/desktop\n\ncat > config.ts << EOF\nEOF\n\nnpm run build\n\n# Publish to app stores\nnpm run publish\n```\n\n#### 2.4 Update CLI\n\n```bash\ncd apps/cli\n\nnpm install\n\n# Publish to npm\nnpm run publish\n```\n\n---\n\n### PHASE 3: LOAD TESTING (Day 5)\n\n#### 3.1 Simulate 1000 Concurrent Users\n\n```bash\n# Using k6 load testing\nnpm install -g k6\n\n# Run test\nk6 run load-tests/concurrent-users.js \\\n  --vus 1000 \\\n  --duration 30s \\\n  --ramp-up 10s\n\n# Expected results:\n#   - p95 latency < 500ms\n#   - error rate < 0.1%\n#   - throughput > 1000 req/s\n```\n\n#### 3.2 Test Event Ingestion\n\n```bash\n# Send 10k events from test Stripe account\nnpm run test:stripe-webhook --count 10000\n\n# Verify in database\nSELECT COUNT(*) FROM spine_events WHERE source = 'stripe';\n# Expected: 10000\n\n# Check latency\nSELECT \n  COUNT(*) as total_events,\n  AVG(EXTRACT(EPOCH FROM (created_at - timestamp))) as avg_latency_ms\nFROM spine_events;\n```\n\n#### 3.3 Test AI Routing\n\n```bash\n# Send 100 events through Core Engine\nnpm run test:ai-routing --count 100\n\n# Verify tasks generated\nSELECT COUNT(*) FROM ai_tasks;\n# Expected: ~100 tasks\n\n# Verify models used\nSELECT model, COUNT(*) FROM ai_tasks GROUP BY model;\n# Expected mix of gpt-4o, claude-3-haiku, gpt-4o-mini\n```\n\n#### 3.4 Test Memory System\n\n```bash\n# Save 1000 memory items\nnpm run test:memory:save --count 1000\n\n# Query with decay algorithm\nnpm run test:memory:query --query \"renewal risk\"\n\n# Expected: Ranked results, hot items first\n```\n\n---\n\n### PHASE 4: GO-LIVE (Day 6)\n\n#### 4.1 Pre-Launch Checklist\n\n```bash\n# All services running\ncurl https://integratewise-gateway.workers.dev/api/v1/health\ncurl https://integratewise-core-engine.workers.dev/health\n\n# Database connected\npsql $DATABASE_URL -c \"SELECT 1\"\n\n# Connectors configured\ncurl -H \"Authorization: Bearer $TOKEN\" \\\n  https://integratewise-gateway.workers.dev/api/v1/connectors\n\n# WebSocket working\nnpm run test:websocket\n\n# Load passed\nnpm run test:load:report\n```\n\n#### 4.2 Enable Production Mode\n\n```bash\n# Set production flags\nexport NODE_ENV=production\nexport LOG_LEVEL=info\nexport RATE_LIMIT_QUOTA=10000\n\n# Update Neon to production tier\nneon project update --plan=pro\n\n# Enable backups\nneon backup-schedule create --enabled\n```\n\n#### 4.3 Configure Monitoring\n\n```bash\n# Set up Datadog / New Relic\nexport DATADOG_API_KEY=\"dd_...\"\n\n# Start monitoring\nnpm run monitor:start\n\n# Create dashboards for:\n#   - Gateway latency\n#   - Event throughput\n#   - AI model usage\n#   - Memory system\n#   - Error rates\n```\n\n#### 4.4 Announce Launch\n\n```bash\n# Send to users\nemail: \"IntegrateWise v1.0 is now live! ✨\"\n\n# Update status page\nhttps://status.integratewise.com/\n  \"Platform is live and accepting requests\"\n\n# Post to social\n\"Just shipped: Platform Activation v1.0\n - Locked, production-ready backend\n - 30-endpoint Gateway contract\n - 100+ data sources connected\n - Let the frontends speak to the system\n 🚀\"\n```\n\n---\n\n## MONITORING & OBSERVABILITY\n\n### Key Metrics to Track\n\n```\nGateway Service:\n  - Request rate (req/s)\n  - Response time (p50, p95, p99)\n  - Error rate (%)\n  - Authentication failures\n  - Rate limit hits\n\nCore Engine:\n  - Event ingestion rate (events/s)\n  - AI model usage (gpt-4o, claude, mini)\n  - Task generation success rate\n  - Insight extraction quality\n  - Model latency\n\nDatabase (Neon):\n  - Connection pool usage\n  - Query latency\n  - Lock wait time\n  - Disk usage\n  - Backup status\n\nMemory System:\n  - Items indexed\n  - Query latency\n  - Decay algorithm efficiency\n  - Promotion scoring accuracy\n\nConnectors:\n  - Sync success rate per source\n  - Last sync time per connector\n  - Error messages\n  - Normalization quality\n```\n\n### Alerting Rules\n\n```\n- Gateway latency > 1000ms → Alert\n- Error rate > 1% → Critical Alert\n- Database connection pool > 80% → Alert\n- Event ingestion rate < 100 events/s → Alert\n- Memory query latency > 500ms → Alert\n- Connector sync failure > 3x → Alert\n```\n\n---\n\n## SCALING\n\n### Horizontal Scaling\n\n**Gateway Workers:**\n- Auto-scales with CloudFlare (unlimited)\n- No manual scaling needed\n- Edge locations worldwide\n\n**Core Engine:**\n- Deploy multiple instances to different regions\n- Use API Gateway for routing\n- Handle 1M+ events/day per region\n\n**Database:**\n- Neon auto-scales read replicas\n- Configure point-in-time recovery\n- Set up replication to backup region\n\n### Vertical Scaling\n\n**Increase query performance:**\n```sql\n-- Add indexes\nCREATE INDEX idx_spine_source_timestamp \n  ON spine_events(source, timestamp DESC);\n\nCREATE INDEX idx_memory_scope_class \n  ON memory(scope, classification);\n\n-- Analyze performance\nANALYZE;\nEXPLAIN SELECT * FROM spine_events WHERE source = 'stripe' LIMIT 10;\n```\n\n**Increase memory capacity:**\n```bash\n# Upgrade Neon plan\nneon project update --plan=enterprise\n\n# Add read replicas\nneon branch create --from main --name=replica-1\n```\n\n---\n\n## ROLLBACK PROCEDURE\n\nIf something goes wrong:\n\n```bash\n# 1. Stop accepting new connections\nnpm run gateway:pause\n\n# 2. Identify issue\nnpm run logs:view --last-1h\n\n# 3. Rollback to previous version\nnpm run gateway:rollback --version=v1.0-previous\n\n# 4. Verify\ncurl https://integratewise-gateway.workers.dev/api/v1/health\n\n# 5. Investigate root cause\nnpm run debug:issue\n\n# 6. Fix and redeploy\nnpm run gateway:deploy --version=v1.0-fixed\n```\n\n---\n\n## SUCCESS CRITERIA\n\nLaunch is successful when:\n\n```\nPerformance:\n  ✅ p95 latency < 500ms\n  ✅ p99 latency < 1000ms\n  ✅ Throughput > 1000 req/s\n\nReliability:\n  ✅ Uptime > 99.9%\n  ✅ Error rate < 0.1%\n  ✅ No data loss\n\nUsage:\n  ✅ 1000+ concurrent users\n  ✅ 100k+ daily active users\n  ✅ 1M+ events/month flowing\n  ✅ 50+ connectors active\n\nAdoption:\n  ✅ Web app fully migrated\n  ✅ Mobile app connected\n  ✅ Desktop app live\n  ✅ CLI tools available\n```\n\n---\n\n## POST-LAUNCH\n\n### Week 1\n- Monitor metrics\n- Respond to user feedback\n- Patch bugs\n- Optimize slow queries\n\n### Week 2\n- Add more connectors\n- Improve AI models\n- Expand capabilities\n- Add new projections\n\n### Week 3+\n- Scale to 100k+ users\n- Add enterprise features\n- Build vertical solutions\n- Expand integrations\n\n---\n\n## SUPPORT\n\n**During Launch:**\n- On-call team: 24/7\n- War room: Slack #incidents\n- Runbooks: Notion wiki\n- Escalation: VP Engineering\n\n**Issues Template:**\n```\nIssue: [description]\nImpact: [# users affected]\nSeverity: [low/medium/high/critical]\nLogs: [link to logs]\nAction: [what we did]\n```\n\n---\n\n## FINAL CHECKLIST\n\nBefore you click \"Deploy\":\n\n- [ ] All services deployed to production\n- [ ] Database migrations complete\n- [ ] Connectors configured (50+ sources)\n- [ ] Load tests passed\n- [ ] Monitoring configured\n- [ ] Alert rules set up\n- [ ] On-call team ready\n- [ ] Runbooks written\n- [ ] Team trained\n- [ ] Rollback plan documented\n- [ ] Users notified\n- [ ] Status page updated\n- [ ] Marketing ready\n\n---\n\n**You are ready. The platform is locked. Frontends can talk to the system.**\n\n**Deploy with confidence.** 🚀\n\n"}