Skip to content

Latest commit

 

History

History
282 lines (205 loc) · 8.22 KB

File metadata and controls

282 lines (205 loc) · 8.22 KB

Manual Deployment Steps for api.protocol-guide.com

Status: Code deployed to production. DNS and Railway configuration required.

GitHub Commit: 8b02c6d3 - feat: complete landing page wiring and API subdomain

Netlify Deploy: Auto-triggered by push to main branch


Step 1: Configure DNS for API Subdomain

At your domain registrar (where protocol-guide.com is registered):

Add the following CNAME record:

Record Type Hostname Value TTL
CNAME api protocol-guide-production.up.railway.app 3600

Example DNS Configuration:

Type    Name    Value
CNAME   api     protocol-guide-production.up.railway.app

DNS Propagation Time: 15 minutes - 2 hours (typically < 1 hour)

Verify DNS Propagation:

# Check DNS resolves correctly
dig api.protocol-guide.com +short

# Expected output:
# protocol-guide-production.up.railway.app.
# [IP addresses from Railway]

# Or use online tool:
# https://dnschecker.org/#CNAME/api.protocol-guide.com

Step 2: Configure Railway Custom Domain

Railway Dashboard: https://railway.app/project/[project-id]

  1. Navigate to protocol-guide-production project
  2. Click Settings tab
  3. Select Networking section
  4. Under Custom Domains, click + Add Domain
  5. Enter: api.protocol-guide.com
  6. Click Add Domain

Railway will:

  • Verify DNS CNAME points to Railway
  • Auto-issue Let's Encrypt SSL certificate (2-5 minutes)
  • Display certificate status in Networking section

Wait for SSL Certificate: Monitor the Networking section until you see:

api.protocol-guide.com
✓ SSL Certificate: Active
✓ Status: Healthy

Verify API Subdomain Works:

# Test health endpoint
curl -I https://api.protocol-guide.com/api/health

# Expected: HTTP/2 200 OK
# Expected: Certificate issued by Let's Encrypt

Step 3: Verify Netlify Deployment Complete

Check Netlify deploy status:

# Via Netlify CLI (optional)
netlify status --site protocol-guide

# Or via web:
# https://app.netlify.com/sites/protocol-guide/deploys

Expected:

  • Deploy status: Published
  • Commit: 8b02c6d3 - feat: complete landing page wiring...
  • Deploy time: < 3 minutes

Step 4: Production Verification

Run the verification script after both DNS and Railway are configured:

cd /Users/tanner-osterkamp/Protocol-Guide

# Create verification script
cat > scripts/verify-production.sh <<'EOFSCRIPT'
#!/bin/bash
BASE_URL="https://protocol-guide.com"
API_URL="https://api.protocol-guide.com"

echo "=== Protocol Guide Production Verification ==="

# 1. Landing page loads
echo "[1/6] Landing page..."
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$BASE_URL")
[ "$HTTP_CODE" = "200" ] && echo "  ✅ 200 OK" || echo "  ❌ FAIL: $HTTP_CODE"

# 2. "Sign In" link exists
echo "[2/6] Sign In link..."
curl -s "$BASE_URL" | grep -q "Sign In" && echo "  ✅ Present" || echo "  ❌ MISSING"

# 3. API subdomain resolves
echo "[3/6] API subdomain DNS..."
dig +short "$API_URL" | grep -q "." && echo "  ✅ Resolves" || echo "  ❌ NOT RESOLVED"

# 4. API subdomain SSL works
echo "[4/6] API subdomain HTTPS..."
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$API_URL/api/health" 2>/dev/null)
[ "$HTTP_CODE" = "200" ] && echo "  ✅ 200 OK" || echo "  ⚠️  Status: $HTTP_CODE (may be waiting for SSL)"

# 5. Health check returns healthy
echo "[5/6] Health status..."
HEALTH=$(curl -s "$BASE_URL/api/health" 2>/dev/null | grep -o '"status":"[^"]*"' | cut -d'"' -f4)
[ "$HEALTH" = "healthy" ] && echo "  ✅ healthy" || echo "  ⚠️  Status: $HEALTH"

# 6. Netlify proxies to API subdomain
echo "[6/6] API proxy routing..."
PROXY_TARGET=$(curl -sI "$BASE_URL/api/health" 2>/dev/null | grep -i "x-proxy-target" | awk '{print $2}' | tr -d '\r')
echo "  ℹ️  Proxy target: $PROXY_TARGET (should route to api.protocol-guide.com)"

echo ""
echo "=== Verification Complete ==="
echo ""
echo "Next steps:"
echo "1. If API subdomain fails: Wait for DNS propagation (check every 5 min)"
echo "2. If SSL fails: Wait for Railway certificate (2-5 min after DNS propagates)"
echo "3. If all green: Test manually at https://protocol-guide.com"
EOFSCRIPT

chmod +x scripts/verify-production.sh

# Run verification
./scripts/verify-production.sh

Step 5: Manual QA Checklist

After verification script passes, test manually:

Landing Page (https://protocol-guide.com):

  • Page loads without errors
  • "Sign In" link visible in desktop navigation
  • "Sign In" link visible in mobile hamburger menu
  • Click "Sign In" → Redirects to /login
  • Click "Let's Go" → Redirects to /(tabs) (search)

Auth Flow:

  • Landing → /login → Google OAuth → Callback → /(tabs)
  • Landing → /login → Email/password → /(tabs)

Search Flow:

  • Enter "cardiac arrest medications"
  • Response returned in < 2 seconds
  • Citations present ([Protocol #XXX])

API Subdomain:

  • curl -I https://api.protocol-guide.com/api/health
  • Returns 200 OK with Let's Encrypt certificate
  • No certificate warnings in browser

Troubleshooting

DNS Not Propagating

Symptom: dig api.protocol-guide.com returns no results

Fix:

  1. Wait 15-30 minutes for DNS propagation
  2. Verify CNAME record is correct at registrar
  3. Check TTL is 3600 (1 hour) or lower
  4. Use https://dnschecker.org to check global propagation

Railway SSL Certificate Pending

Symptom: Railway shows "SSL: Pending" or HTTPS returns certificate error

Fix:

  1. Ensure DNS CNAME is propagated first (Railway can't issue cert without DNS)
  2. Wait 2-5 minutes after DNS propagates
  3. If stuck > 10 min: Remove custom domain from Railway, wait 5 min, re-add
  4. Contact Railway support if issue persists

Netlify Still Proxying to Railway URL

Symptom: API calls work but don't use api.protocol-guide.com

Fix:

  1. Wait for Netlify deploy to complete (check deploy logs)
  2. Clear Netlify CDN cache: netlify api purgeCache --site protocol-guide
  3. Hard refresh browser (Ctrl+Shift+R)

Health Check Returns "unhealthy"

Symptom: /api/health returns status: "unhealthy" or "degraded"

Fix:

  1. Check Railway logs for backend errors
  2. Verify all environment variables set in Railway dashboard
  3. Check Supabase database is accessible
  4. Verify Redis (Upstash) is reachable

Timeline

Step Duration Can Proceed While Waiting?
1. Configure DNS 2 min No - Railway needs DNS to issue SSL
DNS Propagation 15 min - 2 hours Yes - Monitor with dig command
2. Configure Railway 2 min No - Need DNS propagated
Railway SSL Cert 2-5 min No - Need cert for HTTPS
3. Netlify Deploy 3-5 min Already triggered, monitor status
4. Verification 5 min After all above complete
5. Manual QA 10 min After verification passes

Total Estimated Time: 30 minutes - 3 hours (mostly DNS propagation wait)


Success Criteria

Phase 1 deployment is complete when:

  • ✅ Code pushed to GitHub (8b02c6d3)
  • ✅ Netlify deploy successful
  • ⏳ DNS CNAME for api.protocol-guide.com configured
  • ⏳ Railway custom domain added with SSL certificate
  • ⏳ Verification script passes all checks
  • ⏳ Manual QA checklist complete

Current Status: Code deployed, awaiting DNS and Railway configuration.


Next Steps (Phase 2 - Post-Launch Testing)

After Phase 1 complete:

  1. Load Testing (Week 1)

    • Set up k6 for 100 concurrent users
    • File: tests/load/concurrent-users.k6.js
  2. UAT with EMS Professionals (Week 2-3)

    • Recruit 3-5 paramedics/EMTs
    • File: docs/UAT_TEST_PLAN.md
  3. Mobile Device Testing (Week 1-2)

    • Test on 4 real devices (iPhone 15 Pro, iPhone SE, Pixel 8, Galaxy A54)
    • File: docs/MOBILE_DEVICE_TEST_RESULTS.md
  4. Monitoring & Iteration (Ongoing)

    • Watch Sentry for errors
    • Monitor health checks (auto every 30 min)
    • Track performance metrics (P95 < 1s for search)

Full plan: /Users/tanner-osterkamp/.claude/plans/vivid-coalescing-puffin.md


Last Updated: 2026-02-23 Deployed By: Claude Code Opus 4.6 Agent Status: ✅ Code deployed, ⏳ DNS/Railway configuration pending