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
This commit is contained in:
@@ -41,17 +41,17 @@ Requirements for this milestone. Each maps to roadmap phases.
|
|||||||
|
|
||||||
### Global Item Database
|
### Global Item Database
|
||||||
|
|
||||||
- [ ] **GLOB-01**: A global item catalog exists with brand, model, category, manufacturer specs, and image
|
- [x] **GLOB-01**: A global item catalog exists with brand, model, category, manufacturer specs, and image
|
||||||
- [ ] **GLOB-02**: Global catalog is seeded with initial items from manufacturer data
|
- [x] **GLOB-02**: Global catalog is seeded with initial items from manufacturer data
|
||||||
- [ ] **GLOB-03**: User can search the global catalog by name or brand
|
- [ ] **GLOB-03**: User can search the global catalog by name or brand
|
||||||
- [ ] **GLOB-04**: User can link a personal collection item to a global catalog entry
|
- [ ] **GLOB-04**: User can link a personal collection item to a global catalog entry
|
||||||
- [ ] **GLOB-05**: Global item pages show basic info and owner count
|
- [ ] **GLOB-05**: Global item pages show basic info and owner count
|
||||||
|
|
||||||
### User Profiles & Sharing
|
### User Profiles & Sharing
|
||||||
|
|
||||||
- [ ] **PROF-01**: User has a profile with display name, avatar, and bio
|
- [x] **PROF-01**: User has a profile with display name, avatar, and bio
|
||||||
- [ ] **PROF-02**: User can view their own public profile page
|
- [ ] **PROF-02**: User can view their own public profile page
|
||||||
- [ ] **PROF-03**: User can set a setup as public or private
|
- [x] **PROF-03**: User can set a setup as public or private
|
||||||
- [ ] **PROF-04**: Public setups are viewable by anyone without authentication
|
- [ ] **PROF-04**: Public setups are viewable by anyone without authentication
|
||||||
- [ ] **PROF-05**: Public profile page lists the user's public setups
|
- [ ] **PROF-05**: Public profile page lists the user's public setups
|
||||||
|
|
||||||
@@ -136,14 +136,14 @@ Which phases cover which requirements. Updated during roadmap creation.
|
|||||||
| IMG-02 | Phase 17 | Complete |
|
| IMG-02 | Phase 17 | Complete |
|
||||||
| IMG-03 | Phase 17 | Complete |
|
| IMG-03 | Phase 17 | Complete |
|
||||||
| IMG-04 | Phase 17 | Complete |
|
| IMG-04 | Phase 17 | Complete |
|
||||||
| GLOB-01 | Phase 18 | Pending |
|
| GLOB-01 | Phase 18 | Complete |
|
||||||
| GLOB-02 | Phase 18 | Pending |
|
| GLOB-02 | Phase 18 | Complete |
|
||||||
| GLOB-03 | Phase 18 | Pending |
|
| GLOB-03 | Phase 18 | Pending |
|
||||||
| GLOB-04 | Phase 18 | Pending |
|
| GLOB-04 | Phase 18 | Pending |
|
||||||
| GLOB-05 | Phase 18 | Pending |
|
| GLOB-05 | Phase 18 | Pending |
|
||||||
| PROF-01 | Phase 18 | Pending |
|
| PROF-01 | Phase 18 | Complete |
|
||||||
| PROF-02 | Phase 18 | Pending |
|
| PROF-02 | Phase 18 | Pending |
|
||||||
| PROF-03 | Phase 18 | Pending |
|
| PROF-03 | Phase 18 | Complete |
|
||||||
| PROF-04 | Phase 18 | Pending |
|
| PROF-04 | Phase 18 | Pending |
|
||||||
| PROF-05 | Phase 18 | Pending |
|
| PROF-05 | Phase 18 | Pending |
|
||||||
|
|
||||||
|
|||||||
@@ -177,9 +177,9 @@ Plans:
|
|||||||
3. A global item page shows basic info and how many users own it
|
3. A global item page shows basic info and how many users own it
|
||||||
4. User can edit their profile (display name, avatar, bio) and view their own public profile page
|
4. User can edit their profile (display name, avatar, bio) and view their own public profile page
|
||||||
5. User can toggle a setup between public and private; public setups are viewable by anyone without logging in and appear on the owner's public profile
|
5. User can toggle a setup between public and private; public setups are viewable by anyone without logging in and appear on the owner's public profile
|
||||||
**Plans:** 5 plans
|
**Plans:** 1/5 plans executed
|
||||||
Plans:
|
Plans:
|
||||||
- [ ] 18-01-PLAN.md — Schema foundation: globalItems, itemGlobalLinks, user profile columns, setup isPublic, Zod schemas, types, seed data
|
- [x] 18-01-PLAN.md — Schema foundation: globalItems, itemGlobalLinks, user profile columns, setup isPublic, Zod schemas, types, seed data
|
||||||
- [ ] 18-02-PLAN.md — Global item backend: service (search, owner count, link/unlink), routes, seed script, tests
|
- [ ] 18-02-PLAN.md — Global item backend: service (search, owner count, link/unlink), routes, seed script, tests
|
||||||
- [ ] 18-03-PLAN.md — Profile and sharing backend: profile service, public profile/setup routes, auth middleware updates, tests
|
- [ ] 18-03-PLAN.md — Profile and sharing backend: profile service, public profile/setup routes, auth middleware updates, tests
|
||||||
- [ ] 18-04-PLAN.md — Global item client: catalog browse/search page, detail page, link-to-global-item UI
|
- [ ] 18-04-PLAN.md — Global item client: catalog browse/search page, detail page, link-to-global-item UI
|
||||||
@@ -207,4 +207,4 @@ Plans:
|
|||||||
| 15. External Authentication | 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 |
|
| 16. Multi-User Data Model | v2.0 | 2/4 | Complete | 2026-04-05 |
|
||||||
| 17. Object Storage | v2.0 | 3/3 | Complete | 2026-04-05 |
|
| 17. Object Storage | v2.0 | 3/3 | Complete | 2026-04-05 |
|
||||||
| 18. Global Items & Public Profiles | v2.0 | 0/5 | Not started | - |
|
| 18. Global Items & Public Profiles | v2.0 | 1/5 | In Progress| |
|
||||||
|
|||||||
@@ -21,24 +21,28 @@ progress:
|
|||||||
See: .planning/PROJECT.md (updated 2026-04-03)
|
See: .planning/PROJECT.md (updated 2026-04-03)
|
||||||
|
|
||||||
**Core value:** Help people make better gear decisions — discover what others use, compare real-world data, and see how a potential buy affects your setup before committing.
|
**Core value:** Help people make better gear decisions — discover what others use, compare real-world data, and see how a potential buy affects your setup before committing.
|
||||||
**Current focus:** v2.0 Platform Foundation — Phase 14 (PostgreSQL Migration)
|
**Current focus:** v2.0 Platform Foundation — Phase 18 (Global Items & Public Profiles)
|
||||||
|
|
||||||
## Current Position
|
## Current Position
|
||||||
|
|
||||||
Phase: 17 of 18 (PostgreSQL Migration)
|
Phase: 18 of 18 (Global Items & Public Profiles)
|
||||||
Plan: Not started
|
Plan: 1 of 5 in current phase
|
||||||
Status: Ready to plan
|
Status: Executing
|
||||||
Last activity: 2026-04-05
|
Last activity: 2026-04-05 — Completed 18-01 schema foundations
|
||||||
|
|
||||||
Progress: [----------] 0% (v2.0 milestone)
|
Progress: [==========] 100% (phases) | Plan 1/5 in Phase 18
|
||||||
|
|
||||||
## Performance Metrics
|
## Performance Metrics
|
||||||
|
|
||||||
**Velocity:**
|
**Velocity:**
|
||||||
|
|
||||||
- Total plans completed: 0 (v2.0 milestone)
|
- Total plans completed: 1 (v2.0 milestone)
|
||||||
- Average duration: --
|
- Average duration: 3min
|
||||||
- Total execution time: --
|
- Total execution time: 3min
|
||||||
|
|
||||||
|
| Phase | Plan | Duration | Tasks | Files |
|
||||||
|
|-------|------|----------|-------|-------|
|
||||||
|
| 18 | 01 | 3min | 2 | 5 |
|
||||||
|
|
||||||
*Updated after each plan completion*
|
*Updated after each plan completion*
|
||||||
|
|
||||||
@@ -57,6 +61,9 @@ Key decisions made during v2.0 planning:
|
|||||||
- [Phase 17]: Private S3 bucket with presigned URLs (1h default), MinIO pinned to quay.io RELEASE.2025-09-07
|
- [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]: 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
|
- [Phase 17]: Use createObjectURL for immediate upload preview, presigned URLs for existing images
|
||||||
|
- [Phase 18]: Global items category as text field (not FK) for hobby-agnostic flexibility
|
||||||
|
- [Phase 18]: itemGlobalLinks unique on itemId (one global item per user item)
|
||||||
|
- [Phase 18]: Seed data uses real bikepacking product names and approximate specs
|
||||||
|
|
||||||
### Pending Todos
|
### Pending Todos
|
||||||
|
|
||||||
@@ -69,6 +76,6 @@ None active.
|
|||||||
|
|
||||||
## Session Continuity
|
## Session Continuity
|
||||||
|
|
||||||
Last session: 2026-04-05T10:34:23.342Z
|
Last session: 2026-04-05T10:59:44Z
|
||||||
Stopped at: Phase 18 context gathered
|
Stopped at: Completed 18-01-PLAN.md (schema foundations)
|
||||||
Resume file: .planning/phases/18-global-items-public-profiles/18-CONTEXT.md
|
Resume file: .planning/phases/18-global-items-public-profiles/18-01-SUMMARY.md
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
---
|
||||||
|
phase: 18-global-items-public-profiles
|
||||||
|
plan: 01
|
||||||
|
subsystem: database
|
||||||
|
tags: [drizzle, postgres, zod, schema, global-items, profiles]
|
||||||
|
|
||||||
|
requires:
|
||||||
|
- phase: 17-object-storage
|
||||||
|
provides: "S3 storage service, pgTable schema with userId columns"
|
||||||
|
provides:
|
||||||
|
- "globalItems table for crowd-sourced gear database"
|
||||||
|
- "itemGlobalLinks junction table linking user items to global catalog"
|
||||||
|
- "User profile fields (displayName, avatarUrl, bio) on users table"
|
||||||
|
- "Setup visibility (isPublic) on setups table"
|
||||||
|
- "Zod schemas for global item search, item linking, profile update"
|
||||||
|
- "TypeScript types inferred from Drizzle and Zod"
|
||||||
|
- "Bikepacking gear seed data (18 items, 7 categories)"
|
||||||
|
affects: [18-02, 18-03, 18-04, 18-05]
|
||||||
|
|
||||||
|
tech-stack:
|
||||||
|
added: []
|
||||||
|
patterns: ["Global items as separate table from user items, linked via junction table"]
|
||||||
|
|
||||||
|
key-files:
|
||||||
|
created:
|
||||||
|
- "src/db/global-items-seed.json"
|
||||||
|
- "drizzle-pg/0001_tough_boomerang.sql"
|
||||||
|
modified:
|
||||||
|
- "src/db/schema.ts"
|
||||||
|
- "src/shared/schemas.ts"
|
||||||
|
- "src/shared/types.ts"
|
||||||
|
|
||||||
|
key-decisions:
|
||||||
|
- "Global items table uses text category field (not FK) for flexibility with crowd-sourced data"
|
||||||
|
- "itemGlobalLinks has unique constraint on itemId (one global item per user item)"
|
||||||
|
- "Seed data covers 7 categories with 18 real bikepacking products"
|
||||||
|
|
||||||
|
patterns-established:
|
||||||
|
- "Junction table pattern for linking user-owned entities to global catalog"
|
||||||
|
- "isPublic boolean with default false for gradual visibility opt-in"
|
||||||
|
|
||||||
|
requirements-completed: [GLOB-01, GLOB-02, PROF-01, PROF-03]
|
||||||
|
|
||||||
|
duration: 3min
|
||||||
|
completed: 2026-04-05
|
||||||
|
---
|
||||||
|
|
||||||
|
# Phase 18 Plan 01: Schema Foundations Summary
|
||||||
|
|
||||||
|
**Global items table, item-global links, user profile columns, setup visibility, Zod schemas, and 18-item bikepacking seed catalog**
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
- **Duration:** 3 min
|
||||||
|
- **Started:** 2026-04-05T10:57:03Z
|
||||||
|
- **Completed:** 2026-04-05T10:59:44Z
|
||||||
|
- **Tasks:** 2
|
||||||
|
- **Files modified:** 5
|
||||||
|
|
||||||
|
## Accomplishments
|
||||||
|
- Added globalItems and itemGlobalLinks tables to Postgres schema with proper FK constraints
|
||||||
|
- Extended users table with displayName, avatarUrl, bio profile fields
|
||||||
|
- Extended setups table with isPublic boolean for public sharing
|
||||||
|
- Created Zod validation schemas and TypeScript types for all new entities
|
||||||
|
- Built 18-item bikepacking gear seed catalog with real product data
|
||||||
|
|
||||||
|
## Task Commits
|
||||||
|
|
||||||
|
Each task was committed atomically:
|
||||||
|
|
||||||
|
1. **Task 1: Schema tables and column additions** - `8265703` (feat)
|
||||||
|
2. **Task 2: Zod schemas, types, and seed data** - `81b70a7` (feat)
|
||||||
|
|
||||||
|
## Files Created/Modified
|
||||||
|
- `src/db/schema.ts` - Added boolean import, globalItems table, itemGlobalLinks table, users profile columns, setups isPublic
|
||||||
|
- `src/shared/schemas.ts` - Added searchGlobalItemsSchema, linkItemSchema, updateProfileSchema; updated setup schemas with isPublic
|
||||||
|
- `src/shared/types.ts` - Added GlobalItem, ItemGlobalLink, SearchGlobalItems, LinkItem, UpdateProfile types
|
||||||
|
- `src/db/global-items-seed.json` - 18 bikepacking gear items across bags, shelters, sleep systems, cooking, hydration, lighting, racks, accessories
|
||||||
|
- `drizzle-pg/0001_tough_boomerang.sql` - Migration for all schema changes
|
||||||
|
|
||||||
|
## Decisions Made
|
||||||
|
- Global items category stored as text (not FK to categories) since global items are hobby-agnostic and not user-scoped
|
||||||
|
- itemGlobalLinks uses unique constraint on itemId ensuring one-to-one mapping from user item to global item
|
||||||
|
- Seed data uses real product names and approximate specs for realistic development/testing
|
||||||
|
|
||||||
|
## Deviations from Plan
|
||||||
|
|
||||||
|
None - plan executed exactly as written.
|
||||||
|
|
||||||
|
## Issues Encountered
|
||||||
|
None.
|
||||||
|
|
||||||
|
## User Setup Required
|
||||||
|
None - no external service configuration required.
|
||||||
|
|
||||||
|
## Next Phase Readiness
|
||||||
|
- Schema foundation complete for all Phase 18 plans
|
||||||
|
- Plan 18-02 (global items service/routes) can proceed with globalItems table and search schema
|
||||||
|
- Plan 18-03 (profiles/visibility) can proceed with user profile columns and updateProfileSchema
|
||||||
|
- Migration file ready for deployment
|
||||||
|
|
||||||
|
---
|
||||||
|
*Phase: 18-global-items-public-profiles*
|
||||||
|
*Completed: 2026-04-05*
|
||||||
Reference in New Issue
Block a user