onlook icon indicating copy to clipboard operation
onlook copied to clipboard

poc: Add supabase migration for API files

Open Kitenite opened this issue 8 months ago • 2 comments

Description

  • create api_files storage bucket migration
  • update migration journal and snapshot

Related Issues

Type of Change

  • [ ] Bug fix
  • [ ] New feature
  • [ ] Documentation update
  • [ ] Release
  • [ ] Refactor
  • [x] Other (please describe): infrastructure

Testing

  • bun format
  • bun lint (fails: missing environment variables)
  • bun test (failures: 8 tests failed)

Screenshots (if applicable)

Additional Notes


https://chatgpt.com/codex/tasks/task_e_6855cd109f508323b45280c04e7f69f1


[!IMPORTANT] Adds api_files storage bucket in Supabase and updates infrastructure for handling file uploads and deployments.

  • Supabase Migration:
    • Adds api_files storage bucket in 0011_api_files_storage.sql with public access policies for select and insert operations.
    • Updates migration journal in _journal.json and snapshot in 0011_snapshot.json.
  • Hosting Manager (index.ts):
    • Implements file upload to api_files bucket using uploadBlobToStorage.
    • Modifies publish and deployWeb methods to handle storage path instead of serialized files.
  • API Router (preview.ts):
    • Adds logic to download and extract files from api_files bucket using downloadFileFromStorage.
    • Updates publish mutation to accept either storagePath or files.
  • Utilities (server.ts):
    • Adds downloadFileFromStorage function to retrieve files from Supabase storage.
  • Constants (storage.ts):
    • Adds API_FILES to STORAGE_BUCKETS.

This description was created by Ellipsis for 2549efc11e12559db8c9a855b2904353321b9780. You can customize this summary. It will automatically update as commits are pushed.

Kitenite avatar Jun 20 '25 23:06 Kitenite

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 11:54pm
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 11:54pm

vercel[bot] avatar Jun 20 '25 23:06 vercel[bot]

Updates to Preview Branch (codex/extend-supabase-storage-for-file-upload-and-download) ↗︎

Deployments Status Updated
Database Fri, 20 Jun 2025 23:50:40 UTC
Services Fri, 20 Jun 2025 23:50:40 UTC
APIs Fri, 20 Jun 2025 23:50:40 UTC

Tasks are run on every commit but only new migration files are pushed. Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Fri, 20 Jun 2025 23:50:51 UTC
Migrations Fri, 20 Jun 2025 23:50:53 UTC
Seeding Fri, 20 Jun 2025 23:50:53 UTC
Edge Functions Fri, 20 Jun 2025 23:50:53 UTC

❌ Branch Error • Fri, 20 Jun 2025 23:50:54 UTC

failed to bundle function: exit status 1

View logs for this Workflow Run ↗︎. Learn more about Supabase for Git ↗︎.

supabase[bot] avatar Jun 20 '25 23:06 supabase[bot]