S3 SDK replaced with Supabase Storage native SDK in storage.ts
adamwolfe2 drops the AWS S3 client and its request presigner in favor of `@supabase/supabase-js`'s built-in Storage API. The public interface stays the same. The trade-off: fewer dependencies and a simpler env surface, but no more Cloudflare R2 support.
backend/src/lib/storage.ts goes from 104 lines to 39. The four exported functions (uploadFile, downloadFile, deleteFile, getSignedUrl) keep the same signatures, so call sites don't change. What changes is the backend: @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner are gone, and the client is now createClient(url, key, { auth: { persistSession: false } }).storage using the existing Supabase credentials.
The env surface simplifies from five variables (R2_ENDPOINT_URL, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET_NAME, R2_REGION) down to two (SUPABASE_URL, SUPABASE_SECRET_KEY), both already required for auth. STORAGE_BUCKET takes precedence over the old R2_BUCKET_NAME with a fallback to "mike-documents".
There are two behavior differences to verify before adopting this. First, uploadFile now uses upsert: true, so uploads silently overwrite existing objects rather than failing. If your application uses duplicate-key conflicts as a guard, that behavior is gone. Second, getSignedUrl previously built a ResponseContentDisposition header inline to control the download filename for cross-origin anchors. The new version passes { download: normalizeDownloadFilename(downloadFilename) } to Supabase's createSignedUrl. Test that download filenames render correctly in your target browsers before flipping over in production.
The previous commit (cb87623) had added R2_REGION to keep Cloudflare R2 and Supabase Storage both in play. This commit drops that entirely. If your deployment is on R2, this change is not applicable.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?