Skip to content

feat(storage): migrate media to S3-compatible storage - #9

Merged
AmzBG merged 2 commits into
mainfrom
feat/object-storage-migration
Aug 7, 2026
Merged

feat(storage): migrate media to S3-compatible storage#9
AmzBG merged 2 commits into
mainfrom
feat/object-storage-migration

Conversation

@AmzBG

@AmzBG AmzBG commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Description

  • Store profile pictures, project logos, and project media in S3-compatible object storage instead of the API container filesystem.
  • Add an object-storage module that uses IAM task-role credentials in production and MinIO credentials for local development.
  • Validate uploaded image content before persisting it and clean up uploaded objects when the related database operation fails.
  • Preserve legacy /uploads/ serving during the transition and add a resumable migration command that uploads each legacy object before atomically updating its database URL.
  • Mirror seeded profile and project media into object storage so seeded records do not depend on external image URLs.
  • Add MinIO and bucket initialization to Docker Compose for local development.
  • Add coverage for object uploads, cleanup behavior, profile uploads, and project media flows.

Link to issue or ticket

N/A

Steps to QA

  1. Start the local services with npm run services:init and confirm the MinIO API is available on port 9000.

  2. Start the application and upload a profile picture; confirm both cropped and original objects appear under profile-pictures/ in the configured bucket.

  3. Upload, replace, and remove a project logo and project media; confirm the database URLs use the configured public object-storage URL and replaced/removed objects are deleted.

  4. Run npm run db:migrate-media --workspace=@repo/db and confirm it reports legacy media without changing files or database rows.

  5. Run the migration with -- --apply against a prepared environment and confirm uploaded objects are available before their database URLs change; rerun the dry run and confirm zero candidates remain.

  6. Verify the production CloudFront URLs for the migrated profile images return 200 and render in both the profile page and profile-picture editor.

  7. Run the automated checks:

    • npm test --workspace=api -- --runInBand
    • npm run build
    • npx turbo run lint
    • npx turbo run check-types
    • npm run format:check

Screenshots

N/A

@AmzBG AmzBG self-assigned this Aug 7, 2026
@AmzBG AmzBG added enhancement New feature or request prod labels Aug 7, 2026
@AmzBG
AmzBG merged commit 326dbe3 into main Aug 7, 2026
1 check passed
@AmzBG
AmzBG deleted the feat/object-storage-migration branch August 7, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request prod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant