Skip to content

integrate Vercel Blob (Issue #209)#227

Merged
Deodat-Lawson merged 6 commits into
mainfrom
feat/vercel-deploy
Mar 4, 2026
Merged

integrate Vercel Blob (Issue #209)#227
Deodat-Lawson merged 6 commits into
mainfrom
feat/vercel-deploy

Conversation

@EricLiu2795
Copy link
Copy Markdown
Collaborator

Closes #209

Summary

  • Store uploads in Vercel Blob via a typed server helper; persist only blob metadata in Postgres (no new base64/bytes stored).
  • Make file_uploads.file_data nullable and add Blob metadata columns + migration so legacy DB-backed rows still work.
  • Update file serving: /api/files/:id returns a 307 redirect to the Blob URL when present.
  • Adjust uploader UX for the new server-side flow (ZIPs are uploaded as archives for server-side expansion; DOCX preview is now a download CTA to avoid bundling mammoth/jszip in the client).

Schema / Migration (Required)

  • file_uploads.file_data is now nullable and new columns were added (storage_provider, storage_url, storage_pathname, blob_checksum).
  • Apply drizzle/0002_vercel_blob.sql via pnpm db:push before deploying/running the updated upload path.

Testing (Manual)

  • Set BLOB_READ_WRITE_TOKEN=...
  • pnpm install && pnpm db:push
  • pnpm dev (or deploy on Vercel with the token)
  • Upload a PDF via /employer/upload with UploadThing disabled:
    • /api/upload-local returns { provider: "vercel_blob", url: "https://...vercel-storage.com/..." }
  • curl -I http://localhost:3000/api/files/<id> returns 307 with Location: <blob-url>
  • psql $DATABASE_URL -c "select id, storage_provider, storage_url, storage_pathname, blob_checksum, file_data from file_uploads where id=<id>;" shows metadata populated and file_data is NULL for new rows
  • Verify an existing legacy DB-backed file row still downloads/streams via /api/files/:id (no redirect)

Commits

  • feat: store local uploads in vercel blob
  • chore: load dotenv in scripts
  • docs: document vercel blob rollout and verification

Rollout

  1. Add BLOB_READ_WRITE_TOKEN (and usual DB + Clerk env vars) in .env or Vercel Project Settings.
  2. Install deps and apply migrations: pnpm install && pnpm db:push.
  3. Start the app (pnpm dev) or redeploy to Vercel.
  4. Upload a file via /employer/upload and confirm:
    • curl -I http://localhost:3000/api/files/<id> returns 307 with Blob URL in Location
    • DB row has Blob metadata populated and file_data is NULL
  5. (Optional) Confirm the object exists in the Vercel Blob dashboard and download it directly.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pdr-ai-v2 Ready Ready Preview, Comment Mar 4, 2026 10:23pm

@Deodat-Lawson Deodat-Lawson merged commit a0f1c96 into main Mar 4, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MinIO + Vercel Blob Integration

2 participants