Skip to main content

Implementation Plan: Custom Domains

Feature ID: custom-domains Spec: ./spec.md Status: Done (Retrospective) Last updated: 2026-05-01


1. Architecture

2. Tech Choices

ConcernChoiceRationale
Source of truthDB (custom_domains table)Survives provider changes
Provider syncOne-way DB → providerIdempotent; conflict handling at the boundary
VerificationProvider-driven, platform pollsProvider knows DNS state
Auto-promoteTriggered on verification successUX — no extra step for users

3. Data Model

@Entity('custom_domains')
export class CustomDomain {
@PrimaryGeneratedColumn('uuid') id: string;
@Column() workId: string;
@Column() domain: string;
@Column({ default: false }) verified: boolean;
@Column({ default: 'production' }) environment: string;
@Column() provider: string; // plugin id
@CreateDateColumn() createdAt: Date;
@UpdateDateColumn() updatedAt: Date;
}

Migration: additive, with composite index (workId, domain).

4. API Surface

MethodEndpointDescription
GET/api/deploy/works/:id/domainsList domains
POST/api/deploy/works/:id/domainsAdd domain
DELETE/api/deploy/works/:id/domains/:domainRemove domain
POST/api/deploy/works/:id/domains/:domain/verifyTrigger verification

5. Plugin Surface

Deploy provider plugins implement:

interface IDeployCapability {
addDomain(workId, domain, settings): Promise<DnsRecords>;
removeDomain(workId, domain, settings): Promise<void>;
verifyDomain(workId, domain, settings): Promise<{ verified: boolean; details? }>;
}

6. Web / CLI

  • Web: work Settings → Domains with add / verify / remove controls and per-row DNS instructions.
  • CLI: ever-works work domain add/verify/rm commands.

7. Background Jobs

None today. (Question raised in spec.md §8 about scheduled re-verification.)

8. Security & Permissions

  • Edit permission required for all mutations.
  • Read permission for listing.

9. Observability

Activity log entries: domain_added, domain_verified, domain_removed with domain and provider fields.

10. Risks & Mitigations

RiskMitigation
Provider rejects domain (already-claimed)Surface error; roll back DB write
DNS not configured at verify timeverified: false returned; user can retry
Auto-promote breaks an in-flight URLPromote only when current URL is the provider subdomain

11. Constitution Reconciliation

See spec.md §9.

12. References

  • Spec: ./spec.md
  • Implementation:
    • apps/api/src/plugins-capabilities/deploy/deploy.service.ts
    • packages/plugins/vercel/