Admin Subdomain Setup Guide
Goal: Configure as custom domain for crop-front-admin
Admin Subdomain Setup Guide
Goal: Configure admin.crop-dev.app as custom domain for crop-front-admin
Current URL: crop-front-admin.vercel.app
New URL: admin.crop-dev.app
Prerequisites
- Cloudflare account with crop-dev.app domain
- Vercel project:
crop-front-admin - Clerk account:
sensible-jay-41.clerk.accounts.dev
Step 1: Cloudflare DNS (1 min)
- Go to Cloudflare Dashboard →
crop-dev.app→ DNS → Records - Click "Add record"
- Configure:
- Type: CNAME
- Name:
admin - Target:
cname.vercel-dns.com - Proxy status: ☁️ Proxied (orange cloud)
- TTL: Auto
- Save
Expected result:
CNAME admin cname.vercel-dns.com ProxiedStep 2: Vercel Domain (2 min)
- Go to Vercel Dashboard
- Select project:
crop-front-admin - Settings → Domains → Add Domain
- Enter:
admin.crop-dev.app - Add - Vercel will automatically verify DNS and provision SSL
Verification:
- Vercel will check CNAME record
- SSL certificate will be auto-provisioned (Let's Encrypt)
- Should show "Valid Configuration" within 1-2 minutes
Step 3: Clerk Domain (2 min)
- Go to Clerk Dashboard
- Select instance:
sensible-jay-41(Admin instance) - Configure → Domains
- Add domain:
admin.crop-dev.app - Save
Important:
- This is the admin Clerk instance (
sensible-jay-41) - NOT the frontend instance (
mature-coral-22) - No cross-domain auth needed - they are separate apps
Step 4: Vercel Environment Variables (2 min)
- Go to Vercel Dashboard →
crop-front-admin→ Settings → Environment Variables - Add new variable:
- Key:
NEXT_PUBLIC_CLERK_DOMAIN - Value:
admin.crop-dev.app - Environment: Production ✅ Preview ✅ Development ❌
- Key:
- Save
Note: Do NOT set this for Development (localhost)
Step 5: Redeploy (1 min)
- Go to Vercel Dashboard →
crop-front-admin→ Deployments - Latest deployment → ⋯ → Redeploy
OR trigger new deployment:
cd /Users/vova/Code/CROP/crop-front-admin
git commit --allow-empty -m "chore: trigger redeploy for admin.crop-dev.app"
git pushStep 6: Verification (5 min)
DNS Check
dig +short admin.crop-dev.app
# Should return Cloudflare IPs: 104.x.x.x or 172.67.x.xSSL Check
curl -I https://admin.crop-dev.app
# Should return HTTP/2 200
# server: VercelApp Check
- Open:
https://admin.crop-dev.app - Expected: Dashboard loads
- Click: "Sign In"
- Expected: Clerk sign-in page
- Sign in with your credentials
- Expected: Redirected to
/dashboard
Rollback Plan
If something goes wrong:
- Remove Vercel domain:
- Vercel → Settings → Domains →
admin.crop-dev.app→ Remove
- Vercel → Settings → Domains →
- Remove Cloudflare CNAME:
- Cloudflare → DNS →
admin→ Delete
- Cloudflare → DNS →
- Remove Clerk domain:
- Clerk → Domains →
admin.crop-dev.app→ Remove
- Clerk → Domains →
- Remove Vercel env var:
- Vercel → Settings → Env Vars →
NEXT_PUBLIC_CLERK_DOMAIN→ Delete
- Vercel → Settings → Env Vars →
Old URL crop-front-admin.vercel.app will continue to work.
Troubleshooting
DNS not resolving
# Check DNS propagation
dig admin.crop-dev.app @1.1.1.1
dig admin.crop-dev.app @8.8.8.8Solution: Wait 5 minutes for DNS propagation
Vercel shows "Invalid Configuration"
Cause: CNAME not found or incorrect target
Solution: Verify CNAME target is exactly cname.vercel-dns.com
Clerk auth fails
Cause: Domain not added to Clerk
Solution: Add admin.crop-dev.app in Clerk Dashboard → Domains
SSL certificate error
Cause: Vercel still provisioning certificate Solution: Wait 2-3 minutes, Vercel auto-provisions Let's Encrypt cert
Local Environment Changes
File: /Users/vova/Code/CROP/crop-front-admin/.env.local
# Updated (commented out for local dev):
# Production domain: admin.crop-dev.app
# NEXT_PUBLIC_CLERK_DOMAIN=admin.crop-dev.appNote: Leave commented for localhost development!
Summary
| Step | Action | Time | Status |
|---|---|---|---|
| 1 | Cloudflare CNAME | 1 min | ⏳ Pending |
| 2 | Vercel Domain | 2 min | ⏳ Pending |
| 3 | Clerk Domain | 2 min | ⏳ Pending |
| 4 | Vercel Env Vars | 2 min | ⏳ Pending |
| 5 | Redeploy | 1 min | ⏳ Pending |
| 6 | Verify | 5 min | ⏳ Pending |
Total: ~13 minutes
Benefits
✅ Professional URL: admin.crop-dev.app vs crop-front-admin.vercel.app
✅ Brand Consistency: All under crop-dev.app domain
✅ Cloudflare Protection: WAF, DDoS, SSL
✅ Custom Domain Control: Not tied to Vercel branding
✅ Zero Cost: Free with existing Cloudflare + Vercel plans
Part Number Discrepancy Analysis Report
Date: January 8, 2025 Purpose: Analysis of McHale part number mismatches between photo folders and DIS Status: ✅ ROOT CAUSE FOUND AND FIXED
DIS Integration Refactoring Plan
Investigation of ~500 "not found" parts revealed several data quality and code architecture issues. This document provides constructive criticism of current...