Monorepo for Aesthetic.Computer aesthetic.computer
core feed DP1-FEED-CHECKLIST.md
7.6 kB

DP1 Feed Deployment Checklist #

✅ Pre-Deployment (Completed) #

📋 Deployment Steps (To Do) #

Step 1: Authenticate with Cloudflare #

Alternative (API Token):

set -x CLOUDFLARE_API_TOKEN "YOUR_CLOUDFLARE_API_KEY_HERE"
set -x CLOUDFLARE_EMAIL "me@jas.life"
wrangler whoami

Step 2: Create Cloudflare Resources #

  • Created namespace with title "aesthetic-feed-DP1_PLAYLISTS"
     ID: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

Step 3: Update Configuration #

Step 4: Generate and Set Secrets #

  • set api_secret (openssl rand -hex 32)
    echo "Save this API Secret: $api_secret"
    echo $api_secret | wrangler secret put API_SECRET --env production
    
  • npm run jwt:generate-keys
    
  • cat private-key.txt | wrangler secret put ED25519_PRIVATE_KEY --env production
    
  • echo "your-issuer" | wrangler secret put JWT_ISSUER --env production
    echo "your-audience" | wrangler secret put JWT_AUDIENCE --env production
    

Step 6: Deploy to Production #

Step 7: Configure Custom Domain #

Step 8: Verify Deployment #

  • curl https://feed.aesthetic.computer/api/v1/health
    
  • {
      "status": "healthy",
      "timestamp": "2024-10-06T...",
      "version": "1.0.0"
    }
    
  • curl https://feed.aesthetic.computer/api/v1
    
  • curl -X POST https://feed.aesthetic.computer/api/v1/playlists \
      -H "Authorization: Bearer YOUR_API_SECRET" \
      -H "Content-Type: application/json" \
      -d '{
        "dpVersion": "1.0.0",
        "title": "test-playlist",
        "items": [{
          "source": "https://aesthetic.computer/prompt",
          "duration": 300,
          "license": "open"
        }]
      }'
    

Step 9: Monitor & Verify #

Step 10: Documentation & Integration #

🔍 Verification Commands #

Run these after deployment to verify everything:

# Check DNS resolution
dig feed.aesthetic.computer

# Test API health
curl https://feed.aesthetic.computer/api/v1/health

# List playlists (should return empty array initially)
curl https://feed.aesthetic.computer/api/v1/playlists

# Check worker logs
cd /workspaces/aesthetic-computer/feed/dp1-feed
wrangler tail --env production

# List secrets (verify they're set)
wrangler secret list --env production

# Check deployments
wrangler deployments list --env production

📊 Success Criteria #

🚨 Common Issues & Solutions #

Issue: "Worker not found" #

Solution: Wait 1-2 minutes after deployment, DNS needs to propagate

Issue: "Unauthorized" when creating playlist #

Solution: Verify API_SECRET is set correctly:

wrangler secret list --env production

Issue: "KV namespace not found" #

Solution: Check namespace IDs in wrangler.toml match created namespaces

Issue: Custom domain not working #

Solution:

  1. Check domain is added in Cloudflare dashboard
  2. Verify DNS record was created automatically
  3. Wait up to 5 minutes for propagation

Issue: "Module not found" error #

Solution:

  1. Ensure dependencies are installed: npm install
  2. Try: npm run worker:build to verify TypeScript compiles

📝 Important Notes #

  1. API Secret: Save it securely - you can't retrieve it later
  2. Ed25519 Keys: Keep private key secure, back up both keys
  3. KV Namespace IDs: Must match in wrangler.toml
  4. DNS Propagation: Can take 2-5 minutes
  5. CORS: Configured to allow requests from aesthetic.computer
  6. Rate Limits: Default Cloudflare Worker limits apply

🎯 Quick Reference #

Key Files #

  • dp1-feed/wrangler.toml - Configuration
  • dp1-feed/worker.ts - Entry point
  • dp1-feed/app.ts - Main logic

Key Commands #

npm run feed:setup         # One-time setup
npm run feed:deploy        # Deploy to production
npm run feed:dev           # Local development
npm run feed:logs          # Watch logs
npm run feed:test          # Run tests

Key URLs #

⏱️ Estimated Time #

  • Total Setup Time: 10-15 minutes
  • Step 1 (Auth): 1-2 minutes
  • Step 2 (Resources): 2-3 minutes
  • Step 3 (Config): 1 minute
  • Step 4 (Secrets): 2-3 minutes
  • Step 5 (Test): 2 minutes (optional)
  • Step 6 (Deploy): 1-2 minutes
  • Step 7 (Domain): 1-2 minutes
  • Step 8 (Verify): 2-3 minutes

Ready to deploy? Start with Step 1! 🚀

Need help? See DP1-FEED-SETUP.md for detailed instructions.