Domain Management Guide
Domain Management Guide
Overview
This guide ensures Eden Academy maintains consistent domain references and prevents the recurring issue of incorrect domain usage.✅ CORRECT Domain
Eden Academy:eden-academy.vercel.app
❌ INCORRECT Domains (Never Use)
eden-academy-flame.vercel.appeden-academy-ftf22wjgo-edenprojects.vercel.appCentralized Domain Configuration
All domain references are managed through/src/config/domains.ts:
``typescript
import { URLS, DOMAINS } from '@/config/domains';
// ✅ CORRECT - Use centralized config
const academyUrl = URLS.EDEN_ACADEMY;
// ❌ WRONG - Hard-coded domain
const academyUrl = 'https://eden-academy-flame.vercel.app';
`
Validation Tools
1. Domain Validator
Scans codebase for incorrect domain references:
`bash
npm run validate-domains
`
2. Domain Fixer
Automatically fixes incorrect domain references:
`bash
npm run fix-domains
`
3. Pre-commit Hook
Automatically runs validation before each commit to prevent incorrect domains from entering the codebase.
Usage Examples
✅ Frontend Components
`typescript
import { getEdenAcademyUrl } from '@/config/domains';
export function ShareButton() {
const academyUrl = getEdenAcademyUrl();
return (
${academyUrl}/admin/docs}>
View Documentation
);
}
`
✅ API Routes
`typescript
import { URLS } from '@/config/domains';
export async function GET() {
const registryUrl = process.env.NEXT_PUBLIC_REGISTRY_URL || URLS.EDEN_GENESIS_REGISTRY_API;
// Use registryUrl...
}
`
✅ Environment Variables
`bash
NEXT_PUBLIC_EDEN_ACADEMY_URL=https://eden-academy.vercel.app
`
Development Workflow
Before Making Changes
Check domains.ts: Use centralized configuration
Run validation: npm run validate-domains
Review changes: Ensure no hard-coded domains
Adding New Services
Update domains.ts: Add new domain to centralized config
Update validator: Add to CORRECT_DOMAINS list if needed
Document usage: Update this guide with examples
Fixing Domain Issues
Run fixer: npm run fix-domains (automatic)
Manual review: Check complex cases manually
Validate: npm run validate-domains
Test: Verify functionality still works
Common Pitfalls
❌ Hard-coded URLs
`typescript
// WRONG
const url = 'https://eden-academy-flame.vercel.app/api/health';
`
✅ Use Configuration
`typescript
// CORRECT
import { URLS } from '@/config/domains';
const url = ${URLS.EDEN_ACADEMY}/api/health;
`
❌ Copy-paste from Documentation
`markdown
Visit https://eden-academy-flame.vercel.app
`
✅ Use Current Domain
`markdown
Visit https://eden-academy.vercel.app
`
Emergency Procedures
If Incorrect Domains Are Deployed
Immediate: Run npm run fix-domains
Validate: Run npm run validate-domains`
If Validation Blocks Deployment
Architecture Integration
This domain management system integrates with:Monitoring
Health Checks
Metrics
Support
When to Use This Guide
Escalation
Remember: Domain consistency prevents user confusion and maintains professional brand standards. When in doubt, use the centralized configuration and validation tools.