Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Building the "shadcn/ui for Backend": A Contract-First Approach

Description and use

Plughub CLI users face SMTP blocking, but a contract-first design lets them switch between SMTP and HTTP providers without changing application code.

Problem

Users of the Plughub CLI may be blocked from using SMTP due to network restrictions, limiting email capability.

Outcome

The contract-first approach enables seamless provider swapping, allowing users to avoid transport lock-in and use alternative transports like HTTP over port 443.

Workflow

  • Define capability contract (e.g., sendEmail(input) -> result).
  • Import contract in application code.
  • Implement provider (SMTP or Resend) that fulfills the contract.
  • Swap provider by changing configuration; application code remains unchanged.

Evidence

I tried to send a real email, but my mobile carrier actively blocks outbound connections on port 587 (a common anti-spam measure).

Source

I decided to build an HTTP-based provider (Resend) that sends emails via port 443.

Source

When I swapped the SMTP provider for the Resend provider, the application code didn't change. It just kept calling email.sendEmail().

Source

Using the AWS SDK v3, the s3 provider can connect to AWS, Cloudflare R2, or a local MinIO instance.

Source

  • Record date: 2026-10-24T09:11:08.531Z