feat: add pushduck as S3-native upload alternative to UploadThing#68
Open
abhay-ramesh wants to merge 1 commit intoreliverse:mainfrom
Open
feat: add pushduck as S3-native upload alternative to UploadThing#68abhay-ramesh wants to merge 1 commit intoreliverse:mainfrom
abhay-ramesh wants to merge 1 commit intoreliverse:mainfrom
Conversation
- Add /api/upload route using pushduck/server with imageUploader and videoUploader - Add ImageUploader and VideoUploader React components using pushduck/client - Mirror same route names (imageUploader, videoUploader) as UploadThing for easy swap - Add AWS_S3_* env vars to .env.example (supports R2, Spaces, MinIO too) - UploadThing integration is untouched β pushduck runs in parallel at /api/upload Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds pushduck as a parallel, opt-in upload alternative to the existing UploadThing integration. UploadThing is completely unchanged β both systems coexist and users can choose either.
What changed
New files:
src/app/api/upload/route.tsβ pushduck API route at/api/uploadsrc/ui/components/pushduck-upload.tsxβ drop-in<ImageUploader />and<VideoUploader />React componentsModified files:
.env.exampleβ addsAWS_S3_*vars section under UPLOADSpackage.jsonβ adds"pushduck": "^0.4.0"dependencyWhy pushduck
imageUploader,videoUploaderimageUploader,videoUploaderKey design decisions
imageUploader,videoUploader) so swapping is a one-line import change.auth.api.getSession()identically tocore.ts, so session handling is consistent.AWS_S3_*vars work with any S3-compatible provider (Cloudflare R2, DigitalOcean Spaces, MinIO) by adjusting the endpoint.Required env vars (optional β only if using pushduck)
Test plan
/api/uploadthing(nothing changed)<ImageUploader />from~/ui/components/pushduck-uploadrenders and accepts image files<VideoUploader />from~/ui/components/pushduck-uploadrenders and accepts video filesπ€ Generated with Claude Code