docs(17-03): complete client image URL migration and migration script plan

This commit is contained in:
2026-04-05 12:29:23 +02:00
parent 6f40f94551
commit 4109f9fd78
4 changed files with 120 additions and 12 deletions

View File

@@ -35,7 +35,7 @@ Requirements for this milestone. Each maps to roadmap phases.
### Image Storage
- [x] **IMG-01**: Images are stored in MinIO (S3-compatible) instead of local filesystem
- [ ] **IMG-02**: Existing uploaded images are migrated to MinIO
- [x] **IMG-02**: Existing uploaded images are migrated to MinIO
- [x] **IMG-03**: Image upload and retrieval work through the new storage layer
- [x] **IMG-04**: Docker Compose provides MinIO for local development
@@ -133,7 +133,7 @@ Which phases cover which requirements. Updated during roadmap creation.
| MULTI-05 | Phase 16 | Complete |
| MULTI-06 | Phase 16 | Pending |
| IMG-01 | Phase 17 | Complete |
| IMG-02 | Phase 17 | Pending |
| IMG-02 | Phase 17 | Complete |
| IMG-03 | Phase 17 | Complete |
| IMG-04 | Phase 17 | Complete |
| GLOB-01 | Phase 18 | Pending |

View File

@@ -53,7 +53,7 @@
- [ ] **Phase 14: PostgreSQL Migration** — Replace SQLite with Postgres, make all operations async, establish new test infrastructure
- [ ] **Phase 15: External Authentication** — Integrate self-hosted OIDC auth provider for user registration and login
- [x] **Phase 16: Multi-User Data Model** — Add user ownership to all entities with cross-user data isolation (completed 2026-04-05)
- [ ] **Phase 17: Object Storage** — Move images from local filesystem to MinIO (S3-compatible)
- [x] **Phase 17: Object Storage** — Move images from local filesystem to MinIO (S3-compatible) (completed 2026-04-05)
- [ ] **Phase 18: Global Items & Public Profiles** — Global item catalog, user profiles, and public setup sharing
## Phase Details
@@ -161,11 +161,11 @@ Plans:
2. All previously uploaded images are accessible after migration to MinIO (no broken images)
3. Image URLs work correctly in all views (collection, planning, setups, comparison table)
4. Docker Compose includes MinIO for local development with no manual bucket setup required
**Plans:** 2/3 plans executed
**Plans:** 3/3 plans complete
Plans:
- [x] 17-01-PLAN.md — Storage service abstraction + Docker Compose MinIO infrastructure
- [x] 17-02-PLAN.md — Server-side image handling refactoring (routes, services, MCP tools)
- [ ] 17-03-PLAN.md — Client component updates + image migration script
- [x] 17-03-PLAN.md — Client component updates + image migration script
### Phase 18: Global Items & Public Profiles
**Goal**: Users can discover gear through a global catalog and share their setups publicly via profile pages
@@ -200,5 +200,5 @@ Plans:
| 14. PostgreSQL Migration | v2.0 | 0/? | Not started | - |
| 15. External Authentication | v2.0 | 0/? | Not started | - |
| 16. Multi-User Data Model | v2.0 | 2/4 | Complete | 2026-04-05 |
| 17. Object Storage | v2.0 | 2/3 | In Progress| |
| 17. Object Storage | v2.0 | 3/3 | Complete | 2026-04-05 |
| 18. Global Items & Public Profiles | v2.0 | 0/? | Not started | - |

View File

@@ -3,14 +3,14 @@ gsd_state_version: 1.0
milestone: v1.3
milestone_name: Research & Decision Tools
status: planning
stopped_at: Completed 17-02-PLAN.md
last_updated: "2026-04-05T10:24:04.581Z"
stopped_at: Completed 17-03-PLAN.md
last_updated: "2026-04-05T10:29:15.199Z"
last_activity: 2026-04-03 — v2.0 roadmap created (Phases 14-18)
progress:
total_phases: 11
completed_phases: 9
completed_phases: 10
total_plans: 28
completed_plans: 25
completed_plans: 26
percent: 0
---
@@ -56,6 +56,7 @@ Key decisions made during v2.0 planning:
- Single-user SQLite mode diverges at v2.0 boundary
- [Phase 17]: Private S3 bucket with presigned URLs (1h default), MinIO pinned to quay.io RELEASE.2025-09-07
- [Phase 17]: Image URL enrichment at route level, not service level, keeping services storage-agnostic
- [Phase 17]: Use createObjectURL for immediate upload preview, presigned URLs for existing images
### Pending Todos
@@ -68,6 +69,6 @@ None active.
## Session Continuity
Last session: 2026-04-05T10:24:04.579Z
Stopped at: Completed 17-02-PLAN.md
Last session: 2026-04-05T10:29:15.196Z
Stopped at: Completed 17-03-PLAN.md
Resume file: None

View File

@@ -0,0 +1,107 @@
---
phase: 17-object-storage
plan: 03
subsystem: ui
tags: [s3, minio, presigned-urls, image-migration, react, client-components]
requires:
- phase: 17-object-storage
provides: "S3 storage service and API response enrichment with presigned imageUrl"
provides:
- "All client components display images via presigned URLs from API responses"
- "One-time migration script for local uploads/ to MinIO"
affects: [client-image-display, deployment]
tech-stack:
added: []
patterns: ["imageUrl prop on card/list components", "local preview via createObjectURL for new uploads"]
key-files:
created:
- scripts/migrate-images-to-minio.ts
modified:
- src/client/components/ImageUpload.tsx
- src/client/components/ItemCard.tsx
- src/client/components/CandidateCard.tsx
- src/client/components/CandidateListItem.tsx
- src/client/components/ComparisonTable.tsx
- src/client/components/CollectionView.tsx
- src/client/components/ItemForm.tsx
- src/client/components/CandidateForm.tsx
- src/client/routes/setups/$setupId.tsx
- src/client/routes/threads/$threadId.tsx
key-decisions:
- "Use createObjectURL for immediate preview after upload, presigned URL for existing images"
- "Migration script preserves originals - manual deletion after verification"
patterns-established:
- "imageUrl prop: all image-displaying components accept imageUrl from API, not construct /uploads/ paths"
- "ImageUpload dual-source: localPreview (just uploaded) > imageUrl (presigned) > null (placeholder)"
requirements-completed: [IMG-02, IMG-03]
duration: 4min
completed: 2026-04-05
---
# Phase 17 Plan 03: Client Image URL Migration and Migration Script Summary
**Replaced all client /uploads/ path references with presigned S3 URLs and created one-time image migration script**
## Performance
- **Duration:** 4 min
- **Started:** 2026-04-05T10:25:33Z
- **Completed:** 2026-04-05T10:30:00Z
- **Tasks:** 2
- **Files modified:** 11
## Accomplishments
- All 6 client image components now use imageUrl from API responses instead of constructing /uploads/ paths
- Zero /uploads/ references remain in client code
- Migration script reads uploads/ directory and uploads each file to MinIO preserving filenames
- ImageUpload component supports both presigned URLs (existing images) and local object URLs (new uploads)
## Task Commits
Each task was committed atomically:
1. **Task 1: Update client components to use imageUrl from API responses** - `8c64bf9` (feat)
2. **Task 2: Create image migration script** - `6f40f94` (feat)
## Files Created/Modified
- `src/client/components/ImageUpload.tsx` - Added imageUrl prop, local preview via createObjectURL
- `src/client/components/ItemCard.tsx` - Added imageUrl prop, use presigned URL for display
- `src/client/components/CandidateCard.tsx` - Added imageUrl prop, use presigned URL for display
- `src/client/components/CandidateListItem.tsx` - Added imageUrl to interface, use presigned URL
- `src/client/components/ComparisonTable.tsx` - Added imageUrl to interface, use presigned URL
- `src/client/components/CollectionView.tsx` - Pass imageUrl to ItemCard
- `src/client/components/ItemForm.tsx` - Pass imageUrl to ImageUpload from item record
- `src/client/components/CandidateForm.tsx` - Pass imageUrl to ImageUpload from candidate record
- `src/client/routes/setups/$setupId.tsx` - Pass imageUrl to ItemCard
- `src/client/routes/threads/$threadId.tsx` - Pass imageUrl to CandidateCard
- `scripts/migrate-images-to-minio.ts` - One-time migration from uploads/ to S3
## Decisions Made
- Used createObjectURL for immediate preview after upload (presigned URL not available until next GET)
- Migration script does not auto-delete originals (user deletes manually after verification)
## Deviations from Plan
None - plan executed exactly as written.
## Issues Encountered
None
## User Setup Required
None - no external service configuration required. Migration script usage documented in script header comments.
## Next Phase Readiness
- Full stack now uses MinIO for image storage
- Migration script ready to run for existing deployments: `bun run scripts/migrate-images-to-minio.ts`
- All client and server /uploads/ references eliminated
---
*Phase: 17-object-storage*
*Completed: 2026-04-05*