feat: add media storage integration #87

Merged
erik merged 3 commits from feat/task-36204c4c-media-storage-integration into main 2026-06-03 08:16:59 -05:00
Owner

Summary\n- Add S3-compatible media storage config and AWS SDK S3 storage implementation with Garage path-style support.\n- Add local Garage process to make dev via Procfile.dev and scripts/dev-garage.sh.\n- Add media metadata migration and reusable media service for upload, public URL generation, metadata persistence, and delete.\n- Document local dev Garage and production homelab Garage env variables.\n\n## Verification\n- npm exec --workspace @slugkit/template-site -- vitest run --config ../../vitest.config.ts src/media src/db/tests/migrations.test.ts\n- npm run typecheck\n- ./scripts/pre-pr.sh\n\nTask: #task-36204c4c

## Summary\n- Add S3-compatible media storage config and AWS SDK S3 storage implementation with Garage path-style support.\n- Add local Garage process to make dev via Procfile.dev and scripts/dev-garage.sh.\n- Add media metadata migration and reusable media service for upload, public URL generation, metadata persistence, and delete.\n- Document local dev Garage and production homelab Garage env variables.\n\n## Verification\n- npm exec --workspace @slugkit/template-site -- vitest run --config ../../vitest.config.ts src/media src/db/__tests__/migrations.test.ts\n- npm run typecheck\n- ./scripts/pre-pr.sh\n\nTask: #task-36204c4c
feat: add media storage integration
Some checks failed
CI / build-lint-test (pull_request) Failing after 19s
311102a921
Task: #task-36204c4c
fix: sync lockfile for npm 11.13
All checks were successful
CI / build-lint-test (pull_request) Successful in 16m24s
5a5c1389e7
fix: map media errors to API responses
All checks were successful
CI / build-lint-test (pull_request) Successful in 28s
0d4a2b26ec
Author
Owner

PR Review: Approved

Summary

The PR adds the media storage foundation requested by task-36204c4c: S3-compatible storage configuration, Garage-compatible storage adapter, SQLite media metadata, reusable upload/delete/public URL service functions, local Garage dev process wiring, documented env vars, and fake-backed tests. A review gap around standard API error payloads for media validation/storage failures was fixed in follow-up commit 0d4a2b2.

Acceptance criteria

  • Media upload service stores a file in S3-compatible storage or a test fake.
  • Media metadata is created in SQLite.
  • Public media URL generation uses configured public base URL.
  • Delete removes media from storage and database where possible.
  • Unsupported media type fails with standard API error data.
  • Oversized upload fails with standard API error data.
  • .env.example documents required media storage variables.
  • Relevant lint/test checks pass.

Blocking issues

None.

Warnings

None.

Verification

  • npm exec --workspace @slugkit/template-site -- vitest run --config ../../vitest.config.ts src/media src/api/__tests__/responses.test.ts
  • npm run typecheck
  • ./scripts/pre-pr.sh
  • Forgejo CI run #99: success (build-lint-test, 28s)

Final verdict

Approved. Ready for human merge approval.

### PR Review: Approved #### Summary The PR adds the media storage foundation requested by `task-36204c4c`: S3-compatible storage configuration, Garage-compatible storage adapter, SQLite media metadata, reusable upload/delete/public URL service functions, local Garage dev process wiring, documented env vars, and fake-backed tests. A review gap around standard API error payloads for media validation/storage failures was fixed in follow-up commit `0d4a2b2`. #### Acceptance criteria - [x] Media upload service stores a file in S3-compatible storage or a test fake. - [x] Media metadata is created in SQLite. - [x] Public media URL generation uses configured public base URL. - [x] Delete removes media from storage and database where possible. - [x] Unsupported media type fails with standard API error data. - [x] Oversized upload fails with standard API error data. - [x] `.env.example` documents required media storage variables. - [x] Relevant lint/test checks pass. #### Blocking issues None. #### Warnings None. #### Verification - `npm exec --workspace @slugkit/template-site -- vitest run --config ../../vitest.config.ts src/media src/api/__tests__/responses.test.ts` - `npm run typecheck` - `./scripts/pre-pr.sh` - Forgejo CI run `#99`: success (`build-lint-test`, 28s) #### Final verdict Approved. Ready for human merge approval.
erik merged commit 6e55bf74bc into main 2026-06-03 08:16:59 -05:00
erik deleted branch feat/task-36204c4c-media-storage-integration 2026-06-03 08:16:59 -05:00
Sign in to join this conversation.
No description provided.