Commit Graph

389 Commits

Author SHA1 Message Date
574a12e6fa fix: OIDC auth flow, Vite proxy, and PostgreSQL query compat
- Add auth redirect in root layout for unauthenticated users
- Proxy OIDC routes (/login, /callback, /logout) through Vite dev server
- Strip Secure flag from OIDC cookies in dev mode (HTTP localhost)
- Disable retry on auth query to prevent stale cookie loops
- Fix SQLite .get()/.all()/.run() calls in category and global-item
  services for PostgreSQL compatibility
- Add userId scoping to category service functions
- Add OIDC error logging in auth middleware
- Apply linter auto-formatting across affected files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:25:31 +02:00
f7588827b1 docs(phase-18): complete phase execution
Some checks failed
CI / ci (push) Failing after 20s
CI / e2e (push) Has been skipped
2026-04-05 13:22:34 +02:00
b2936b098e Merge branch 'worktree-agent-af80e237' into Develop
# Conflicts:
#	.planning/REQUIREMENTS.md
#	.planning/STATE.md
2026-04-05 13:21:56 +02:00
0b9666e764 docs(18-05): complete user profiles and public sharing client plan
- Create SUMMARY.md with execution results
- Update STATE.md with progress and decisions
- Mark PROF-01 through PROF-05 requirements complete
2026-04-05 13:21:16 +02:00
5ddc5fa2f7 docs(18-04): complete global item catalog client plan
- SUMMARY.md with task commits and decisions
- STATE.md updated with progress and decisions
- ROADMAP.md updated with plan progress (4/5 plans complete)
- REQUIREMENTS.md: GLOB-03, GLOB-04, GLOB-05 marked complete
2026-04-05 13:19:47 +02:00
a9956681ba feat(18-05): add public profile page and setup visibility toggle
- Create public profile page at /users/$userId with avatar, name, bio, setups
- Create PublicSetupCard component for profile page setup listing
- Add isPublic toggle button on setup detail page
- Add Public badge to SetupCard in list view
- Update useSetups hook with isPublic field on interfaces
2026-04-05 13:19:36 +02:00
f5233d075f feat(18-04): add LinkToGlobalItem component for catalog linking
- Search-based dropdown to find and link global catalog items
- Shows linked status with link to global item detail page
- Unlink button to remove association
- Debounced search with loading and empty states
2026-04-05 13:18:24 +02:00
f53f66d321 feat(18-04): add global item hooks, catalog browse page, and detail page
- useGlobalItems/useGlobalItem/useLinkItem/useUnlinkItem hooks
- Global catalog browse page with search, debounce, and skeleton loading
- Global item detail page with owner count badge
- GlobalItemCard component with brand, model, specs badges
2026-04-05 13:17:39 +02:00
f120d179f7 feat(18-05): add profile hooks and profile edit UI in settings
- Create usePublicProfile and useUpdateProfile hooks
- Create ProfileSection component with avatar upload, display name, bio
- Add Profile section to settings page (visible when authenticated)
2026-04-05 13:17:31 +02:00
2843351d90 Merge branch 'worktree-agent-a86c0a6d' into Develop
# Conflicts:
#	.planning/REQUIREMENTS.md
#	.planning/STATE.md
#	src/db/schema.ts
#	src/db/seed.ts
#	src/server/index.ts
#	src/server/routes/setups.ts
#	src/server/services/category.service.ts
#	src/server/services/setup.service.ts
#	src/shared/schemas.ts
#	src/shared/types.ts
2026-04-05 13:13:34 +02:00
465297c398 Merge branch 'worktree-agent-a7e6e4b2' into Develop
# Conflicts:
#	.planning/REQUIREMENTS.md
#	.planning/ROADMAP.md
#	.planning/STATE.md
#	drizzle/meta/_journal.json
#	src/db/schema.ts
#	src/db/seed.ts
#	src/shared/schemas.ts
#	src/shared/types.ts
2026-04-05 13:13:26 +02:00
95143826ed docs(18-03): complete user profiles and public sharing plan
- SUMMARY.md with 2 tasks, 25 tests passing, 9 files modified
- STATE.md updated with progress and decisions
- REQUIREMENTS.md: PROF-01 through PROF-05 marked complete
2026-04-05 13:13:12 +02:00
eb8f4b7cb2 feat(18-03): add profile routes, public setup endpoint, and auth middleware updates
- GET /api/users/:id/profile: public profile with public setups (no auth)
- PUT /api/auth/profile: update own profile (requires auth)
- GET /api/setups/:id/public: public setup view with items (no auth)
- Auth middleware skips public profile and public setup GET endpoints
- Register profileRoutes at /api/users in index.ts
- Add getOrCreateUncategorized to category service (Rule 3 fix)
- 10 route tests covering auth, public access, and 404 cases
2026-04-05 13:10:13 +02:00
3c39bb60bf docs(18-02): complete global items service and routes plan
- SUMMARY.md with full task/commit/deviation documentation
- STATE.md updated to Phase 18, Plan 2/5
- ROADMAP.md progress updated
- REQUIREMENTS.md: GLOB-01 through GLOB-05 marked complete
2026-04-05 13:09:42 +02:00
d97d5d92ba feat(18-02): add global item routes, item link/unlink endpoints, and route tests
- GET /api/global-items with optional q search parameter
- GET /api/global-items/:id with ownerCount
- POST /api/items/:id/link to link user item to global item
- DELETE /api/items/:id/link to unlink
- Route registered in index.ts
- 10 route tests covering all endpoints
2026-04-05 13:07:26 +02:00
854811dd6b feat(18-03): add profile service and setup isPublic support
- updateProfile: update displayName, avatarUrl, bio for a user
- getPublicProfile: return user info with only public setups
- getPublicSetupWithItems: return setup details only if isPublic is true
- createSetup now accepts and persists isPublic field
- updateSetup can toggle isPublic
- getAllSetups includes isPublic in response
2026-04-05 13:06:44 +02:00
60dd9f4934 feat(18-02): implement global item service, seed script, and seed integration
- searchGlobalItems with LIKE-based case-insensitive search and wildcard escaping
- getGlobalItemWithOwnerCount with owner count from junction table
- linkItemToGlobal/unlinkItemFromGlobal for item-global linking
- seedGlobalItems idempotent seed from JSON catalog
- Integrated seed into seedDefaults startup
2026-04-05 13:06:07 +02:00
3a6876f7e8 test(18-02): add failing tests for global item service and seed
- 10 test cases covering search, owner count, link/unlink, seed idempotency
- Added globalItems/itemGlobalLinks tables to SQLite schema
- Added Zod schemas and types for global items
- Created 18-item bikepacking gear seed data JSON
2026-04-05 13:05:28 +02:00
2d5d4f9c1a test(18-03): add failing tests for profile service and setup isPublic
- Profile CRUD tests: updateProfile, getPublicProfile, getPublicSetupWithItems
- Setup service isPublic tests: create with isPublic, toggle, list includes isPublic
2026-04-05 13:05:02 +02:00
89b0496845 chore(18-03): apply 18-01 schema foundation as dependency baseline 2026-04-05 13:04:09 +02:00
6c49a9ad89 docs(18-01): complete schema foundations plan
- Create 18-01-SUMMARY.md with execution results
- Update STATE.md with phase 18 position and decisions
- Update ROADMAP.md with phase 18 progress (1/5 plans)
- Mark GLOB-01, GLOB-02, PROF-01, PROF-03 requirements complete
2026-04-05 13:01:21 +02:00
81b70a72ac feat(18-01): add Zod schemas, types, and global items seed data
- Add searchGlobalItemsSchema, linkItemSchema, updateProfileSchema to schemas.ts
- Add isPublic field to createSetupSchema and updateSetupSchema
- Add GlobalItem, ItemGlobalLink, SearchGlobalItems, LinkItem, UpdateProfile types
- Create global-items-seed.json with 18 bikepacking gear items across 7 categories
- Format fix in schema.ts (pre-existing biome formatting)
2026-04-05 12:59:21 +02:00
82657038cc feat(18-01): add globalItems, itemGlobalLinks tables and user profile/setup visibility columns
- Add globalItems table with brand, model, category, weightGrams, priceCents, imageUrl, description
- Add itemGlobalLinks junction table linking user items to global items (unique per item)
- Add displayName, avatarUrl, bio nullable columns to users table
- Add isPublic boolean column to setups table (default false)
- Import boolean from drizzle-orm/pg-core
- Generate migration 0001_tough_boomerang.sql
2026-04-05 12:57:49 +02:00
37d5711475 docs(18): create phase plan for global items and public profiles 2026-04-05 12:52:55 +02:00
c9117cd51a docs(18): research global items and public profiles domain 2026-04-05 12:38:40 +02:00
9cfbed1dce docs(state): record phase 18 context session 2026-04-05 12:34:23 +02:00
c16ad2e1ce docs(18): capture phase context 2026-04-05 12:34:21 +02:00
f1dbf0504b docs(phase-17): complete phase execution 2026-04-05 12:32:44 +02:00
4109f9fd78 docs(17-03): complete client image URL migration and migration script plan 2026-04-05 12:29:23 +02:00
6f40f94551 feat(17-03): create image migration script for uploads/ to MinIO
- Reads all image files from uploads/ directory
- Uploads each to S3 bucket preserving original filenames as object keys
- Handles errors per-file without aborting entire migration
- Preserves original files (manual deletion after verification)
2026-04-05 12:28:10 +02:00
8c64bf9fbf feat(17-03): update client components to use imageUrl from API responses
- Replace all /uploads/ path construction with imageUrl presigned URLs
- Add imageUrl prop to ItemCard, CandidateCard, CandidateListItem, ComparisonTable
- Update ImageUpload to use presigned URLs + local preview for new uploads
- Pass imageUrl through from parent components (CollectionView, forms, routes)
2026-04-05 12:27:34 +02:00
2d31680072 docs(17-02): complete server-side storage integration plan
- SUMMARY.md with 2 task commits documented
- STATE.md updated with progress and decision
- ROADMAP.md updated with plan progress
- REQUIREMENTS.md updated (IMG-01, IMG-03 complete)
2026-04-05 12:24:17 +02:00
f5d79072f2 feat(17-02): wire storage service into all routes and MCP tools, remove static /uploads/*
- Replace unlink() with deleteImage() in items and threads routes
- Add withImageUrl/withImageUrls to item, thread, setup GET responses
- Enrich MCP tool responses with presigned image URLs
- Remove /uploads/* static file serving from server index
- Update MCP image tool description (local -> storage)
2026-04-05 12:22:41 +02:00
5ce3f92a78 feat(17-02): refactor image service and routes to use S3 storage service
- Replace Bun.write/mkdir with uploadImage() from storage.service
- Remove uploadsDir parameter from fetchImageFromUrl
- Update tests to mock storage service instead of checking filesystem
2026-04-05 12:20:31 +02:00
544dd5bcd9 Merge branch 'worktree-agent-a402d11d' into Develop
# Conflicts:
#	.env.example
#	.planning/STATE.md
#	bun.lock
#	docker-compose.dev.yml
#	docker-compose.yml
#	package.json
2026-04-05 12:17:35 +02:00
5545d691c2 docs(17-01): complete S3 storage service and MinIO infrastructure plan
- Add 17-01-SUMMARY.md with execution results
- Update STATE.md with decisions and session info
- Mark IMG-01 and IMG-04 requirements complete
2026-04-05 12:17:19 +02:00
88f988c28d chore(17-01): add MinIO to Docker Compose and S3 env config
- Add MinIO + mc init container to docker-compose.dev.yml (fixed creds, console on :9001)
- Add MinIO + mc init container to docker-compose.yml (env var creds, no console)
- Add S3 env vars to app service in production compose
- Remove uploads volume from production compose (replaced by MinIO)
- Add S3 configuration section to .env.example
2026-04-05 12:16:16 +02:00
f845f878fe feat(17-01): add S3 storage service with upload, delete, and presigned URL support
- Create storage.service.ts wrapping @aws-sdk/client-s3 with forcePathStyle for MinIO
- Export uploadImage, deleteImage, getImageUrl, withImageUrl, withImageUrls
- Add unit tests with mocked S3Client (8 tests passing)
- Install @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner
2026-04-05 12:15:09 +02:00
cc87c79753 docs(17): fix 17-03 dependency on 17-02, move to wave 3 2026-04-05 12:12:53 +02:00
542fbae686 docs(17): create phase plan for object storage migration 2026-04-05 12:09:48 +02:00
a36c178f80 docs(phase-17): add validation strategy 2026-04-05 12:04:28 +02:00
e9581490de docs(17): research phase domain 2026-04-05 12:03:14 +02:00
0e65470667 docs(state): record phase 17 context session 2026-04-05 11:55:13 +02:00
9ac8410239 docs(17): capture phase context 2026-04-05 11:55:05 +02:00
634cce8a7a docs(phase-16): complete phase execution 2026-04-05 11:52:53 +02:00
5ae3836d64 fix(16): add async/await to createTestDb in route and MCP tests
Route and MCP test files were calling createTestDb() without await,
causing db to be a Promise object instead of a Drizzle instance.
Also rewrote auth route tests for OIDC-based auth (merge picked old version).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 11:52:38 +02:00
c4a7a6c76f fix(16): restore OIDC-based oauth tests with userId support
Merge conflict resolution picked the old password-based oauth tests.
Restored the OIDC session mock version with proper userId destructuring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 11:34:10 +02:00
98aed09d11 Merge branch 'worktree-agent-ad8081f0' into Develop
# Conflicts:
#	.planning/REQUIREMENTS.md
#	.planning/STATE.md
#	tests/mcp/tools.test.ts
#	tests/routes/auth.test.ts
#	tests/routes/categories.test.ts
#	tests/routes/items.test.ts
#	tests/routes/oauth.test.ts
#	tests/routes/params.test.ts
#	tests/routes/setups.test.ts
#	tests/routes/threads.test.ts
2026-04-05 11:33:13 +02:00
f3ac9d1327 docs(16-04): complete test suite multi-user update plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 11:32:52 +02:00
5085d8e3f7 feat(16-04): update route tests and MCP tests for multi-user userId
- All 8 route test files destructure { db, userId } from createTestDb()
- All route test middleware sets c.set("userId", userId)
- MCP tools.test.ts passes userId to all registerXTools(db, userId) calls
- MCP tools.test.ts passes userId to getCollectionSummary(db, userId)
- Added 4 cross-user isolation tests for MCP tools (items, item by ID, threads, collection summary)
- OAuth test db type annotation updated for new createTestDb return shape
- Images test now uses createTestDb with userId context

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 11:31:05 +02:00