Vercel doesn't support wildcard subdomains for .vercel.app domains, so we can't use:
https://{preview-id}.bmad-preview.vercel.app❌
Instead of subdomains, use URL paths:
https://bmad-lead-gen-agent.vercel.app/preview/{preview-id}- Example:
https://bmad-lead-gen-agent.vercel.app/preview/a1b2c3d4
Pros:
- ✅ Works immediately with existing Vercel setup
- ✅ No domain configuration needed
- ✅ Still professional URLs for sharing
- ✅ All existing code works with minor routing changes
Cons:
- ❌ Less "premium" feel than custom subdomains
- ❌ Longer URLs
Purchase custom domain and configure wildcard:
https://{preview-id}.bmad-previews.com- Requires: Domain purchase + DNS configuration
Pros:
- ✅ True multi-tenant subdomains
- ✅ Most professional appearance
- ✅ Shortest URLs
Cons:
- ❌ Requires domain purchase (~$12/year)
- ❌ Additional DNS configuration
- ❌ More complex setup
Use path-based for immediate deployment, upgrade to custom domain later:
- Phase 1:
https://bmad-lead-gen-agent.vercel.app/preview/{id} - Phase 2:
https://{id}.bmad-previews.com(when ready)
This gives us immediate multi-tenant functionality with professional URLs that are easy to share:
https://bmad-lead-gen-agent.vercel.app/preview/rest456a(Restaurant)https://bmad-lead-gen-agent.vercel.app/preview/tech789b(Technology)https://bmad-lead-gen-agent.vercel.app/preview/law123c(Legal)
- ✅ Immediate: Works with current Vercel setup
- ✅ Professional: Clean, shareable URLs
- ✅ Functional: All multi-tenant features work
- ✅ Scalable: Can handle unlimited previews
- ✅ Mobile-Friendly: Responsive on all devices
- Backend: Update preview URLs to use path format (1 line change)
- Frontend: Already supports path-based routing (
/preview/[id]) - Sharing: URLs are still professional and easy to share
- ✅ Backend preview service: Working
- ✅ Frontend routing: Already supports
/preview/[id] - ✅ Professional UI: Ready
- 🔄 URL format: Need to update from subdomain to path-based
The good news is our frontend already supports path-based routing with /preview/[id].js!
We just need to update the backend to generate path-based URLs instead of subdomain URLs.