Pluggable adapter library: Stripe, Twilio/WhatsApp, Resend, S3 behind a common interface

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
8/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
aws, go
Domain
api, backend

Research direction

No files, tests or entry points are named in the issue. Start by mapping the Go module and any existing mail, storage, payments or messaging wiring to see where adapter contracts would live, then compare that with the four proposed interfaces. Done means the contracts exist, at least one adapter per category is implemented, and a config change switches providers without handler edits.

Written by the indexing model from the issue text.

Description

enhancement

Vision

Every business app needs payments + SMS + email + file storage. Today, each app picks providers and wires them — switching providers is a 1-week migration. A framework that abstracts these behind one interface and ships swappable adapters wins the "oh I'll just build it on Grit" moment.

Proposal

Three adapter contracts:

```go
type PaymentsAdapter interface {
Charge(ctx, ChargeRequest) (Charge, error)
Refund(ctx, RefundRequest) (Refund, error)
Subscribe(ctx, SubRequest) (Subscription, error)
Webhook(payload []byte) (Event, error)
}

type MessagingAdapter interface {
SendSMS(ctx, to, body) (MessageReceipt, error)
SendWhatsApp(ctx, to, body, attachments) (MessageReceipt, error)
}

type StorageAdapter interface {
Put(ctx, key, body, contentType) (URL, error)
PresignPut(ctx, key) (URL, error)
Delete(ctx, key) error
}

type MailAdapter interface {
Send(ctx, MailMessage) (Receipt, error)
SendBatch(ctx, []MailMessage) ([]Receipt, error)
}
```

Ship adapters: Stripe + Paystack (payments), Twilio + WasenderAPI + WhatsApp Cloud (messaging), Resend + SendGrid + SES (mail), S3 + R2 + MinIO (storage). Switching providers is a config change.

Why this is differentiating

Encore + WunderGraph are betting the company on this exact pattern. Grit beating them to it for self-hosted Go is a real opening.

Acceptance

  • Switching from Stripe to Paystack (for African markets) is a one-line config change — zero handler edits
  • A Grit app written today still works in 5 years when Stripe pivots their API; the adapter shim absorbs the change
Dominant language
Go
Stars
152
Forks
20
Avg merge
1d 49m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MUKE-coder/grit

All issues in MUKE-coder/grit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.