Skip to content

[PB-045] Add reproducible Supabase storage bucket provisioning for project documents #96

@Bdon101

Description

@Bdon101

Task ID

PB-045

Owner Role

agent1

Depends On

Context

Document upload code expects a storage bucket (default project-documents), but fresh environments do not provision this bucket from repo-owned setup. Upload behavior can fail in new setups unless bucket creation is done manually.

Goal

Make storage bucket setup reproducible from repository migrations/setup so document upload works in fresh environments without manual Supabase dashboard steps.

Acceptance Criteria

  • Repo-managed setup creates/verifies the required document bucket (project-documents by default).
  • Bucket config matches upload constraints (private bucket, 15MB limit, allowed mime types used by upload validator).
  • Environment docs clearly describe bucket name overrides and required settings.
  • Fresh environment initialized from repo setup can upload a supported file through /api/projects/:projectId/documents.
  • Failure mode for missing/misconfigured bucket returns actionable error text.

Constraints

  • Keep current upload API surface and storage key pattern unchanged.
  • Do not expose private storage objects publicly.
  • Align with Supabase migration/management approach already used in this repo.

Files to create or edit

  • EDIT: /ProjectBeacon/ProjectBeacon/supabase/migrations/* (new migration/setup step)
  • EDIT: /ProjectBeacon/ProjectBeacon/lib/storage/upload-project-document.ts
  • EDIT: /ProjectBeacon/ProjectBeacon/lib/env.ts
  • EDIT: /ProjectBeacon/ProjectBeacon/README.md
  • EDIT: /ProjectBeacon/ProjectBeacon/HANDOFF.md

Expected output / interface

Fresh repo setup consistently provisions usable document storage so project file uploads work without manual infra patching.

Blocking Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions