Skip to content

IPFS storage backend with Pinata integration #5

@theonlyhennygod

Description

@theonlyhennygod

v0.0.4 — IPFS Storage (Pinata)

Problem

Media is stored in R2/S3 only. For decentralization, media needs to be content-addressed on IPFS so any node can serve it.

Acceptance Criteria

  • IPFSStorageBucket implements the StorageBucket interface
  • STORAGE_BACKEND=ipfs activates Pinata uploads
  • Uploads pin to Pinata and return ipfs://CID URLs
  • Gateway resolution layer converts ipfs:// to HTTP gateway URL for browsers
  • Existing R2/S3 backends continue working
  • Environment vars: PINATA_JWT, PINATA_GATEWAY
  • E2E test: upload image, get IPFS CID, fetch via gateway

Files to create/modify

  • apps/api/src/lib/storage/ipfs.ts (NEW)
  • apps/api/src/middleware/storage.ts (add IPFS option)
  • apps/api/src/types/env.ts (add Pinata env vars)
  • apps/api/scripts/test-ipfs-upload.ts (NEW)

Test

PINATA_JWT=xxx bun run test:ipfs-upload

Version bump

All package.json files: 0.0.3 to 0.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions