Unclassified
IntegrateWise Deployment Guide
Complete step-by-step guide to deploy IntegrateWise to production using Doppler for secrets management.
Prerequisites
- Node.js 18+ installed
- Doppler CLI installed (
brew install doppler) - Supabase account (free tier works)
- Cloudflare account (for hosting)
- GitHub account (for OAuth)
Step 1: Doppler Setup (5 minutes)
1.1 Login to Doppler
doppler login
1.2 Create Doppler Project
# Create project
doppler projects create integratewise
# Setup local configuration
cd integratewise-complete/apps/web
doppler setup
# Select: integratewise → dev
1.3 Configure Secrets
Add these secrets to your Doppler project (dev, staging, and prod environments):
# Required secrets
doppler secrets set VITE_SUPABASE_URL "https://your-project.supabase.co"
doppler secrets set VITE_SUPABASE_ANON_KEY "eyJhbG..."
doppler secrets set SUPABASE_SERVICE_KEY "your-service-role-key"
# Optional secrets
doppler secrets set OPENROUTER_API_KEY "your-key"
doppler secrets set N8N_WEBHOOK_SECRET "your-secret"
Get Supabase credentials:
- Go to supabase.com dashboard
- Project Settings → API
- Copy Project URL and anon key
Step 2: Database Setup (10 minutes)
2.1 Create Supabase Project
- Go to supabase.com and sign in
- Click "New Project"
- Fill in:
- Name:
integratewise-prod - Database Password: Generate a strong one
- Region: Choose closest to your users
- Name:
- Wait for project creation (~2 minutes)
2.2 Apply SQL Migrations
Via Supabase Dashboard:
- Go to Supabase Dashboard → SQL Editor
- Run migrations in order:
001_supabase_schema.sqlthrough049_*.sql- CRITICAL:
050_rls_policies.sql(enables security)
Via Supabase CLI:
# Install Supabase CLI if needed
npm install -g supabase
# Login and link
supabase login
supabase link --project-ref your-project-ref
# Run migrations
for f in integratewise-complete/sql-migrations/*.sql; do
echo "Applying: $f"
supabase db execute < "$f"
done
2.3 Verify RLS is Enabled
Run in SQL Editor:
SELECT tablename, rowsecurity as rls_enabled
FROM pg_tables
WHERE schemaname = 'public'
AND tablename IN ('profiles', 'spine_entities', 'knowledge_insights', 'actions')
ORDER BY tablename;
All should show rls_enabled = true.
Step 3: Authentication Setup (5 minutes)
3.1 Configure OAuth Providers
Google OAuth:
- Google Cloud Console → APIs & Services → Credentials
- Create OAuth client ID (Web application)
- Authorized redirect URI:
https://your-project.supabase.co/auth/v1/callback - Copy Client ID and Secret
GitHub OAuth:
- GitHub Settings → Developer settings → OAuth Apps
- New OAuth App
- Authorization callback URL:
https://your-project.supabase.co/auth/v1/callback
3.2 Add OAuth to Supabase
- Supabase Dashboard → Authentication → Providers
- Enable Google and GitHub
- Paste Client IDs and Secrets
- Save
Step 4: Build & Test (5 minutes)
4.1 Install Dependencies
cd integratewise-complete/apps/web
npm install
4.2 Run Deployment Check
cd /Users/nirmal/Github/integratewise-live
./scripts/deploy-check.sh
4.3 Run Tests
cd integratewise-complete/apps/web
doppler run -- npm test
4.4 Build for Production
cd integratewise-complete/apps/web
doppler run -- npm run build
Output in dist/ folder.
Step 5: Deploy to Cloudflare Pages (5 minutes)
5.1 Configure Doppler Integration
- Doppler Dashboard → Integrations
- Add Cloudflare Pages integration
- Connect your Cloudflare account
- Select project and configure sync
5.2 Deploy via CLI
cd integratewise-complete/apps/web
# Deploy with Doppler secrets
doppler run -- wrangler pages deploy dist --project-name=integratewise
5.3 Set Custom Domain (Optional)
- Cloudflare Dashboard → Pages → Your Project
- Custom Domains → Set up custom domain
- Follow DNS configuration
Doppler Workflow Cheat Sheet
# Development
doppler run -- npm run dev
# Testing
doppler run -- npm test
# Build
doppler run -- npm run build
# Deploy
doppler run -- wrangler pages deploy dist
# View secrets
doppler secrets
# Edit secrets
doppler secrets edit
# Switch environment
doppler configure set config=prod
doppler run -- npm run build
Post-Deployment Verification
Health Checklist
- Visit deployed URL - site loads
- Sign up with email - success
- Log out and log back in - success
- Navigate to Dashboard - loads with data
- Create a task - appears in list
- View Accounts page - entities load
Verify Database
Check Supabase Dashboard → Table Editor:
- Records appear in
profilesafter signup - Records appear in
spine_entitieswhen created
Check RLS
Try accessing data without auth:
fetch("https://your-project.supabase.co/rest/v1/spine_entities", {
headers: { apikey: "anon-key" },
});
// Should return empty array
Troubleshooting
Build Fails
# Clean and reinstall
rm -rf node_modules package-lock.json
npm install
doppler run -- npm run build
Doppler Not Working
# Re-authenticate
doppler login
# Reconfigure project
doppler setup
# Verify secrets
doppler secrets get VITE_SUPABASE_URL --plain
Database Connection Errors
- Verify Doppler secrets are correct
- Check Supabase project is active
- Verify RLS policies applied
Auth Not Working
- Check OAuth redirect URLs match exactly
- Verify email confirmation settings in Supabase
- Check browser console for CORS errors
Security Checklist
Before going live:
- RLS enabled on all tables
- OAuth redirect URLs configured
- No secrets in git history
- Doppler configured for prod environment
- Custom domain has SSL enabled
- Service keys only in backend/workers
Environment Structure
Doppler Project: integratewise
├── dev # Local development
├── staging # Pre-production
└── prod # Production
Each environment contains:
├── VITE_SUPABASE_URL
├── VITE_SUPABASE_ANON_KEY
├── SUPABASE_SERVICE_KEY (backend only)
└── Optional: OPENROUTER_API_KEY, etc.
Support
If issues:
- Run
./scripts/deploy-check.shfor diagnostics - Check Doppler logs:
doppler activity - Check Supabase logs in Dashboard → Logs
- Check Cloudflare Pages build logs
Estimated Total Time: 30 minutes
Key Difference: No .env files — all secrets managed via Doppler.