chore: archive v2.2 User Experience Polish milestone
Phases 28-31 archived to milestones/v2.2-phases/ Requirements and roadmap snapshots archived to milestones/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,68 @@
|
||||
# Milestones
|
||||
|
||||
## v2.2 User Experience Polish (Shipped: 2026-04-13)
|
||||
|
||||
**Phases completed:** 36 phases, 68 plans, 120 tasks
|
||||
|
||||
**Key accomplishments:**
|
||||
|
||||
- Parameterized formatWeight with g/oz/lb/kg conversion and useWeightUnit settings hook, backed by 21 TDD tests
|
||||
- Segmented g/oz/lb/kg toggle in TotalsBar with all 8 weight display call sites wired to user-selected unit
|
||||
- Candidate status tracking (researching/ordered/arrived) with schema migration, service/Zod updates, 5 TDD tests, and clickable StatusBadge popup on CandidateCard
|
||||
- Sticky search/filter toolbar on gear tab with text+category filtering, and shared icon-aware CategoryFilterDropdown on both gear and planning tabs
|
||||
- Per-setup item classification (base/worn/consumable) with click-to-cycle badge, classification-preserving sync, and full test coverage
|
||||
- Recharts donut chart with category/classification toggle, weight subtotals card, and hover tooltips inside setup detail page
|
||||
- Nullable pros/cons TEXT columns added to thread_candidates from SQLite schema through Drizzle migration, service layer, Zod validation, React form inputs, and CandidateCard visual badge
|
||||
- sortOrder REAL column, reorderCandidates transaction service, and PATCH /api/threads/:id/candidates/reorder endpoint with active-thread guard
|
||||
- 1. [Rule 2 - Missing] Added pros/cons fields to CandidateWithCategory in useThreads.ts
|
||||
- Side-by-side candidate comparison table with sticky labels, weight/price delta highlighting, and resolved-thread winner marking via a new "compare" candidateViewMode
|
||||
- PostgreSQL schema with 13 pgTable definitions, postgres.js connection, PGlite test infrastructure, and initial migration
|
||||
- PostgreSQL 16 Docker Compose for dev and production, lean Dockerfile without native SQLite build dependencies
|
||||
- All 9 service files (30 functions) converted from synchronous SQLite to async PostgreSQL operations with PGlite smoke test validation
|
||||
- All 9 route files and auth middleware converted to properly await async service/DB calls, preventing Promise-as-JSON responses
|
||||
- One-time data migration script converting all 13 tables from SQLite to PostgreSQL with timestamp/boolean type conversions and serial sequence reset
|
||||
- All 18 test files converted to async PGlite with 161 tests passing across service, route, and MCP layers
|
||||
- Logto OIDC provider added to Docker Compose with Postgres init script, users/sessions tables removed from schema
|
||||
- Three-way auth middleware with @hono/oidc-auth for browser sessions, API keys for programmatic access, and MCP OAuth consent flow
|
||||
- OIDC login redirect page, cleaned auth hooks (string user id, no credential forms), API-key E2E seed, and three-way auth test coverage
|
||||
- pgTable schema with users table, userId FK on 6 entity tables, composite constraints, and auth middleware resolving userId for all auth methods
|
||||
- All 7 service files accept userId parameter with and(eq) isolation on every query — no unscoped reads or writes remain
|
||||
- Complete userId propagation chain from auth middleware through routes and MCP tools to service layer
|
||||
- Route tests, MCP tests, and cross-user isolation tests updated with userId context for multi-user data model
|
||||
- S3 storage abstraction with uploadImage/deleteImage/getImageUrl using @aws-sdk/client-s3, plus MinIO in Docker Compose with automatic bucket creation
|
||||
- Replaced all local filesystem image operations with S3 storage service calls across routes, services, and MCP tools
|
||||
- Replaced all client /uploads/ path references with presigned S3 URLs and created one-time image migration script
|
||||
- Global items table, item-global links, user profile columns, setup visibility, Zod schemas, and 18-item bikepacking seed catalog
|
||||
- Global item catalog backend with LIKE search, owner count aggregation, item linking, idempotent seeding, and full test coverage
|
||||
- Profile service with CRUD and public profile data, public setup viewing, setup visibility toggle, and auth middleware bypass for public endpoints
|
||||
- Global catalog browse/search page, item detail with owner count, and link-to-catalog component using TanStack Router and Query
|
||||
- Profile edit UI in settings with avatar upload, public profile page with setup listing, and setup visibility toggle with globe icon
|
||||
- Database schema updated with direct globalItemId FK on items/candidates, tags system tables, and data migration from itemGlobalLinks
|
||||
- COALESCE merge pattern in item/thread services for transparent reference item data, branched thread resolution, and link/unlink endpoint removal
|
||||
- Tag-filtered global item search with AND logic, owner count via direct FK, and COALESCE merge propagated to setup/totals/profile/CSV services
|
||||
- Tags endpoint with alphabetical ordering, global-items route registration, UIStore FAB/catalog-search state, and tag-aware useGlobalItems hook
|
||||
- Global FAB with animated mini menu and full-screen catalog search overlay with debounced search, tag chip AND-filtering, and result card grid
|
||||
- Private item detail page with edit mode toggle at /items/:id, and enhanced catalog detail page with Add to Collection stub button
|
||||
- Candidate detail page with edit mode toggle at /threads/:threadId/candidates/:candidateId, thread route directory restructured for nested routes, add-candidate modal replacing slide-out panel
|
||||
- All card components rewired from slide-out panels to detail page navigation, panels removed from root layout, UIStore cleaned of panel state
|
||||
- AddToCollectionModal with category/notes/price fields, sonner toasts, and wired catalog search + detail page entry points
|
||||
- AddToThreadModal with existing thread picker, new thread + candidate creation, and session thread memory for catalog search flow
|
||||
- ManualEntryForm component with CategoryPicker, ImageUpload, and cents conversion wired into CatalogSearchOverlay as inline mode with entry points, success card, and context-sensitive navigation
|
||||
- createRateLimit(max, windowMs) factory with browse (120/min) and detail (60/min) tiers applied to all public GET endpoints before auth middleware
|
||||
- globalItems attribution columns (sourceUrl, imageCredit, imageSourceUrl) with unique(brand, model) constraint, upsertGlobalItem/bulkUpsertGlobalItems service functions, and Zod schemas — 21 tests passing
|
||||
- POST /api/global-items, POST /api/global-items/bulk, upsert_catalog_item and bulk_upsert_catalog MCP tools, and catalog detail page attribution display — 61 tests passing, lint clean, build succeeds
|
||||
- One-liner:
|
||||
- One-liner:
|
||||
- Discovery landing page replacing personal dashboard — hero search trigger, popular setups feed, recent catalog items, trending categories, with auth-conditional CTA and PublicSetupCard enhanced with item counts and creator names
|
||||
- 1. [Rule 1 - Bug] Used 'house' icon instead of plan-specified 'home'
|
||||
- One-liner:
|
||||
- TopNav replaces TotalsBar across all pages, BottomTabBar wired for mobile, hero removed from landing page, and /setups added as a public route
|
||||
- Shared hobby config, popular-items-by-tags endpoint with owner count ordering, and batch onboarding completion service with auto-category creation
|
||||
- 5-step catalog-driven onboarding with hobby cards, selectable item grid, review list, and CSS step transitions following UI-SPEC design contract
|
||||
- Replaced old OnboardingWizard with new OnboardingFlow in root route, deleted old component, verified build and no stale references
|
||||
|
||||
---
|
||||
|
||||
## v2.0 Platform Foundation (Shipped: 2026-04-08)
|
||||
|
||||
**Phases completed:** 10 phases, 32 plans
|
||||
|
||||
@@ -60,19 +60,21 @@ Help people make better gear decisions — discover what others use, compare rea
|
||||
- ✓ MCP catalog tools (upsert_catalog_item, bulk_upsert_catalog) for agent seeding — v2.1
|
||||
- ✓ Discovery landing page with catalog search, popular setups feed, recent items, trending categories — v2.1
|
||||
|
||||
- ✓ Profile page with Logto-powered account management (display name, bio, avatar, email, password, delete) — v2.2
|
||||
- ✓ Image fit-within framing with dominant color background fill and crop editor — v2.2
|
||||
- ✓ Catalog-driven onboarding flow with hobby picker, category-grouped item browser, and batch collection creation — v2.2
|
||||
- ✓ Mobile icon-based action buttons on detail pages — v2.2
|
||||
|
||||
### Active
|
||||
|
||||
## Current Milestone: v2.2 User Experience Polish
|
||||
## Current Milestone: v2.3 Global & Social Ready
|
||||
|
||||
**Goal:** Fix broken user-facing features and polish the experience for real users — working profiles, better image handling, refreshed onboarding, and mobile refinements.
|
||||
**Goal:** Make GearBox work for a global audience with setup sharing, multi-currency support, and localization infrastructure.
|
||||
|
||||
**Target features:**
|
||||
- Profile page with Logto integration for account management, branded login screens, email verification
|
||||
- Image fit-within framing (letterbox/pillarbox) instead of hard crops
|
||||
- Catalog-driven onboarding flow with visual refresh
|
||||
- Mobile UX improvements (icon actions, touch refinements)
|
||||
|
||||
**Next milestone:** v2.3 Global & Social Ready — setup sharing system, multi-currency, i18n
|
||||
- Setup sharing system with visibility toggle (private/link/public)
|
||||
- Multi-currency support (USD/EUR/GBP) with user preference
|
||||
- i18n foundation with translation framework and locale-aware formatting
|
||||
|
||||
### Future
|
||||
|
||||
@@ -96,19 +98,19 @@ Help people make better gear decisions — discover what others use, compare rea
|
||||
|
||||
## Context
|
||||
|
||||
Shipped through v2.0 with 23,970 LOC TypeScript across 210+ files. All milestones v1.0-v2.0 complete.
|
||||
Shipped through v2.2 with 31 phases across 6 milestones. All milestones v1.0-v2.2 complete.
|
||||
Tech stack: React 19, Hono, Drizzle ORM, PostgreSQL, TanStack Router/Query, Tailwind CSS v4, Lucide React, Recharts, framer-motion, all on Bun.
|
||||
Primary use case is bikepacking gear but data model is hobby-agnostic.
|
||||
Auth: External OIDC via Logto (browser sessions) + API keys (programmatic) + MCP OAuth (Claude).
|
||||
Infrastructure: PostgreSQL, MinIO (S3-compatible image storage), Docker Compose for dev/prod.
|
||||
Features: MCP server (21 tools), global item catalog with attribution and bulk import, user profiles, public setup sharing, catalog-driven gear flow, item/candidate detail pages, candidate ranking/comparison/impact preview. Public discovery landing page with catalog search, popular setups feed, recent items, and trending categories.
|
||||
Features: MCP server (21 tools), global item catalog with attribution and bulk import, user profiles with Logto account management, public setup sharing, catalog-driven onboarding, fit-within image framing with crop editor, item/candidate detail pages, candidate ranking/comparison/impact preview. Public discovery landing page with catalog search, popular setups feed, recent items, and trending categories. Top nav + mobile bottom tab bar.
|
||||
20+ test files (service-level, route-level integration, MCP). E2E tests pending rewrite for OIDC auth (backlog 999.1).
|
||||
|
||||
## Constraints
|
||||
|
||||
- **Runtime**: Bun — used as package manager and runtime
|
||||
- **Design**: Light, airy, minimalist — white/light backgrounds, lots of whitespace, no visual clutter
|
||||
- **Navigation**: Dashboard-based home page, not sidebar or top-nav tabs
|
||||
- **Navigation**: Top nav bar (desktop) + bottom tab bar (mobile), discovery landing page for unauthenticated users
|
||||
- **Auth**: External self-hosted provider — no in-house auth maintenance
|
||||
- **Database**: PostgreSQL with Drizzle ORM
|
||||
- **UGC**: Structured input only (ratings, predefined fields) — no freeform text until moderation exists
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
- ✅ **v1.3 Research & Decision Tools** — Phases 10-13 (shipped 2026-04-08)
|
||||
- ✅ **v2.0 Platform Foundation** — Phases 14-23 (shipped 2026-04-08)
|
||||
- ✅ **v2.1 Public Discovery** — Phases 24-27 (shipped 2026-04-12)
|
||||
- 🚧 **v2.2 User Experience Polish** — Phases 28-31 (in progress)
|
||||
- 📋 **v2.3 Global & Social Ready** — Phases 32-34 (planned)
|
||||
- ✅ **v2.2 User Experience Polish** — Phases 28-31 (shipped 2026-04-13)
|
||||
- 🚧 **v2.3 Global & Social Ready** — Phases 32-34 (planned)
|
||||
|
||||
## Phases
|
||||
|
||||
@@ -76,14 +76,15 @@
|
||||
|
||||
</details>
|
||||
|
||||
### v2.2 User Experience Polish (In Progress)
|
||||
<details>
|
||||
<summary>✅ v2.2 User Experience Polish (Phases 28-31) — SHIPPED 2026-04-13</summary>
|
||||
|
||||
**Milestone Goal:** Fix broken user-facing features and polish the experience for real users — working profiles, better image handling, refreshed onboarding, and mobile refinements.
|
||||
- [x] Phase 28: Profile & Logto Integration (3/3 plans) — completed 2026-04-12
|
||||
- [x] Phase 29: Image Presentation (5/5 plans) — completed 2026-04-12
|
||||
- [x] Phase 30: Onboarding Redesign (3/3 plans) — completed 2026-04-12
|
||||
- [x] Phase 31: Mobile Polish (2/2 plans) — completed 2026-04-12
|
||||
|
||||
- [x] **Phase 28: Profile & Logto Integration** — Fix profile page, integrate Logto for profile management, customize login branding, configure email verification (completed 2026-04-12)
|
||||
- [x] **Phase 29: Image Presentation** — Fit-within framing with letterbox/pillarbox instead of hard crops, optional crop positioning (completed 2026-04-12)
|
||||
- [x] **Phase 30: Onboarding Redesign** — Catalog-driven onboarding replacing manual entry, visual refresh to match current UI (promotes 999.2) (completed 2026-04-12)
|
||||
- [x] **Phase 31: Mobile Polish** — Icon-based action buttons on item views, small UX improvements (completed 2026-04-12)
|
||||
</details>
|
||||
|
||||
### v2.3 Global & Social Ready (Planned)
|
||||
|
||||
@@ -166,40 +167,6 @@ Plans:
|
||||
- [x] 27-03-PLAN.md — Root layout wiring, hero removal, and visual verification
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 28: Profile & Logto Integration
|
||||
**Goal**: Users have a working profile page with account management powered by Logto, branded login screens, and email verification
|
||||
**Depends on**: Phase 27 (v2.1 complete)
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
|
||||
### Phase 29: Image Presentation
|
||||
**Goal**: Images display within the fixed aspect ratio using fit-within framing (letterbox/pillarbox) instead of hard crops, preserving the full image
|
||||
**Depends on**: Phase 28
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
|
||||
### Phase 30: Onboarding Redesign
|
||||
**Goal**: New users experience a polished, catalog-driven onboarding flow that matches the current UI style and guides them through their first setup
|
||||
**Depends on**: Phase 28
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 31: Mobile Polish
|
||||
**Goal**: Mobile item views use icon-based action buttons instead of text labels, with small UX refinements across touch interactions
|
||||
**Depends on**: None
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 32: Setup Sharing System
|
||||
**Goal**: Setup owners can toggle visibility between private, link-shared, and public, with schema designed for future likes, friends, and collaborative editing
|
||||
**Depends on**: Phase 28 (profiles working)
|
||||
|
||||
@@ -4,13 +4,13 @@ milestone: v2.2
|
||||
milestone_name: User Experience Polish
|
||||
status: executing
|
||||
stopped_at: Phase 31 context gathered
|
||||
last_updated: "2026-04-12T18:50:04.872Z"
|
||||
last_activity: 2026-04-12
|
||||
last_updated: "2026-04-13T13:55:33.612Z"
|
||||
last_activity: 2026-04-13
|
||||
progress:
|
||||
total_phases: 36
|
||||
completed_phases: 24
|
||||
total_plans: 67
|
||||
completed_plans: 65
|
||||
total_plans: 68
|
||||
completed_plans: 66
|
||||
percent: 97
|
||||
---
|
||||
|
||||
@@ -28,7 +28,7 @@ See: .planning/PROJECT.md (updated 2026-04-09)
|
||||
Phase: 31
|
||||
Plan: Not started
|
||||
Status: Executing Phase 30
|
||||
Last activity: 2026-04-12
|
||||
Last activity: 2026-04-13
|
||||
|
||||
Progress: [░░░░░░░░░░] 0%
|
||||
|
||||
|
||||
156
.planning/milestones/v2.2-REQUIREMENTS.md
Normal file
156
.planning/milestones/v2.2-REQUIREMENTS.md
Normal file
@@ -0,0 +1,156 @@
|
||||
# Requirements Archive: v2.2 User Experience Polish
|
||||
|
||||
**Archived:** 2026-04-13
|
||||
**Status:** SHIPPED
|
||||
|
||||
For current requirements, see `.planning/REQUIREMENTS.md`.
|
||||
|
||||
---
|
||||
|
||||
# Requirements: GearBox v2.1 Public Discovery
|
||||
|
||||
**Defined:** 2026-04-09
|
||||
**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.
|
||||
|
||||
## v2.1 Requirements
|
||||
|
||||
Requirements for Public Discovery milestone. Each maps to roadmap phases.
|
||||
|
||||
### Public Access
|
||||
|
||||
- [x] **PUBL-01**: User can browse the global item catalog without logging in
|
||||
- [x] **PUBL-02**: User can view public setups without logging in
|
||||
- [x] **PUBL-03**: User can view user profiles without logging in
|
||||
- [x] **PUBL-04**: Anonymous visitors see the landing page without auth spinner or redirect
|
||||
- [x] **PUBL-05**: Login is only required when user attempts to create/edit/delete their own data
|
||||
|
||||
### Discovery
|
||||
|
||||
- [x] **DISC-01**: Landing page displays an always-visible catalog search bar at the top
|
||||
- [x] **DISC-02**: Landing page shows a feed of popular setups below the search
|
||||
- [x] **DISC-03**: Landing page shows recently added catalog items
|
||||
- [x] **DISC-04**: Landing page shows trending categories
|
||||
- [x] **DISC-05**: Authenticated users see a "Go to Collection" entry point from the landing page
|
||||
|
||||
### Catalog Enrichment
|
||||
|
||||
- [x] **CATL-01**: Global items have attribution fields (sourceUrl, manufacturer, imageCredit, imageSourceUrl)
|
||||
- [x] **CATL-02**: Global items have a unique constraint on (brand, model) preventing duplicates
|
||||
- [x] **CATL-03**: Catalog detail pages display image attribution with credit and source link
|
||||
- [x] **CATL-04**: Bulk import API endpoint accepts multiple catalog items in one request
|
||||
- [x] **CATL-05**: Bulk import uses upsert semantics (ON CONFLICT update, not fail)
|
||||
|
||||
### Agent Seeding Tools
|
||||
|
||||
- [x] **SEED-01**: MCP server has a dedicated `upsert_catalog_item` tool that writes to globalItems (not user-scoped)
|
||||
- [x] **SEED-02**: MCP server has a `bulk_upsert_catalog` tool for batch catalog population
|
||||
- [x] **SEED-03**: Catalog MCP tools include attribution fields (sourceUrl, manufacturer, imageCredit) as parameters
|
||||
|
||||
### Infrastructure
|
||||
|
||||
- [x] **INFR-01**: Public API endpoints are rate-limited to prevent abuse
|
||||
- [x] **INFR-02**: Discovery feed endpoint uses cursor pagination for scalability
|
||||
|
||||
## Future Requirements
|
||||
|
||||
Deferred to future milestones. Tracked but not in current roadmap.
|
||||
|
||||
### Personalization
|
||||
|
||||
- **PERS-01**: Logged-in users see a feed tuned to their collection categories
|
||||
- **PERS-02**: Feed algorithm recommends content based on user's hobby interests
|
||||
|
||||
### Reviews & Content
|
||||
|
||||
- **REVW-01**: Users can write structured reviews on catalog items
|
||||
- **REVW-02**: Reviews appear in the discovery feed
|
||||
- **REVW-03**: Curated/linked external reviews surface in feed
|
||||
|
||||
### SEO
|
||||
|
||||
- **SEO-01**: Catalog pages are crawlable by search engine bots
|
||||
- **SEO-02**: Catalog pages have proper meta tags and structured data
|
||||
|
||||
### Catalog Seeding
|
||||
|
||||
- **SEED-04**: Initial seeding run populates 100+ items across key categories via agent swarm
|
||||
|
||||
### Reviews & Ratings (from v2.0)
|
||||
|
||||
- **REV-01**: User can rate a global item with an overall star rating
|
||||
- **REV-02**: User can rate a global item on predefined dimensions (durability, value, etc.)
|
||||
- **REV-03**: Item detail pages show average ratings from all reviewers
|
||||
|
||||
### Aggregation (from v2.0)
|
||||
|
||||
- **AGG-01**: Item detail pages show crowd-verified specs (manufacturer vs community-measured weight)
|
||||
- **AGG-02**: Item detail pages show which setups include this item
|
||||
- **AGG-03**: Setup composition insights ("commonly paired with")
|
||||
|
||||
### Social (from v2.0)
|
||||
|
||||
- **SOCL-01**: User can fork/copy a public setup as a template
|
||||
- **SOCL-02**: Planning thread candidates can link to global items for auto-populated specs
|
||||
- **SOCL-03**: User can follow other users
|
||||
- **SOCL-04**: User can view an activity feed of followed users' content
|
||||
|
||||
### Content Moderation (from v2.0)
|
||||
|
||||
- **MOD-01**: User can submit freeform text reviews
|
||||
- **MOD-02**: User can report inappropriate content
|
||||
- **MOD-03**: Admin can review and act on reported content
|
||||
|
||||
## Out of Scope
|
||||
|
||||
Explicitly excluded. Documented to prevent scope creep.
|
||||
|
||||
| Feature | Reason |
|
||||
|---------|--------|
|
||||
| Personalized feed algorithm | Requires usage data and collection analysis — build simple feed first |
|
||||
| SSR / static prerendering for SEO | Needs dedicated research on approach for TanStack Router — defer to v2.2+ |
|
||||
| Freeform reviews / comments | No moderation infrastructure yet — structured UGC only |
|
||||
| Admin role / permission system | Current auth model has no role distinction — API key sufficient for v2.1 |
|
||||
| Image scraping automation | Legal gray area — agent seeding uses manufacturer-provided images with attribution |
|
||||
| User-to-user messaging | High moderation burden, not core to discovery |
|
||||
| Wiki-style open item editing | Quality control risk; structured contributions only |
|
||||
| Marketplace / buy-sell | Payment processing, fraud, legal liability |
|
||||
| AI gear recommendations | Training data requirements, hallucination risk |
|
||||
| Gamification (badges, points) | Incentivizes quantity over quality |
|
||||
| Price tracking / deal alerts | Requires scraping, fragile, legal gray area |
|
||||
| Mobile native app | Web-first, responsive design sufficient |
|
||||
|
||||
## Traceability
|
||||
|
||||
Which phases cover which requirements. Updated during roadmap creation.
|
||||
|
||||
| Requirement | Phase | Status |
|
||||
|-------------|-------|--------|
|
||||
| PUBL-01 | Phase 24 | Complete |
|
||||
| PUBL-02 | Phase 24 | Complete |
|
||||
| PUBL-03 | Phase 24 | Complete |
|
||||
| PUBL-04 | Phase 24 | Complete |
|
||||
| PUBL-05 | Phase 24 | Complete |
|
||||
| INFR-01 | Phase 24 | Complete |
|
||||
| CATL-01 | Phase 25 | Complete |
|
||||
| CATL-02 | Phase 25 | Complete |
|
||||
| CATL-03 | Phase 25 | Complete |
|
||||
| CATL-04 | Phase 25 | Complete |
|
||||
| CATL-05 | Phase 25 | Complete |
|
||||
| SEED-01 | Phase 25 | Complete |
|
||||
| SEED-02 | Phase 25 | Complete |
|
||||
| SEED-03 | Phase 25 | Complete |
|
||||
| DISC-01 | Phase 26 | Complete |
|
||||
| DISC-02 | Phase 26 | Complete |
|
||||
| DISC-03 | Phase 26 | Complete |
|
||||
| DISC-04 | Phase 26 | Complete |
|
||||
| DISC-05 | Phase 26 | Complete |
|
||||
| INFR-02 | Phase 26 | Complete |
|
||||
|
||||
**Coverage:**
|
||||
- v2.1 requirements: 20 total
|
||||
- Mapped to phases: 20
|
||||
- Unmapped: 0
|
||||
|
||||
---
|
||||
*Requirements defined: 2026-04-09*
|
||||
*Last updated: 2026-04-09 after roadmap creation*
|
||||
340
.planning/milestones/v2.2-ROADMAP.md
Normal file
340
.planning/milestones/v2.2-ROADMAP.md
Normal file
@@ -0,0 +1,340 @@
|
||||
# Roadmap: GearBox
|
||||
|
||||
## Milestones
|
||||
|
||||
- ✅ **v1.0 MVP** — Phases 1-3 (shipped 2026-03-15)
|
||||
- ✅ **v1.1 Fixes & Polish** — Phases 4-6 (shipped 2026-03-15)
|
||||
- ✅ **v1.2 Collection Power-Ups** — Phases 7-9 (shipped 2026-03-16)
|
||||
- ✅ **v1.3 Research & Decision Tools** — Phases 10-13 (shipped 2026-04-08)
|
||||
- ✅ **v2.0 Platform Foundation** — Phases 14-23 (shipped 2026-04-08)
|
||||
- ✅ **v2.1 Public Discovery** — Phases 24-27 (shipped 2026-04-12)
|
||||
- 🚧 **v2.2 User Experience Polish** — Phases 28-31 (in progress)
|
||||
- 📋 **v2.3 Global & Social Ready** — Phases 32-34 (planned)
|
||||
|
||||
## Phases
|
||||
|
||||
<details>
|
||||
<summary>✅ v1.0 MVP (Phases 1-3) — SHIPPED 2026-03-15</summary>
|
||||
|
||||
- [x] Phase 1: Foundation and Collection (4/4 plans) — completed 2026-03-14
|
||||
- [x] Phase 2: Planning Threads (3/3 plans) — completed 2026-03-15
|
||||
- [x] Phase 3: Setups and Dashboard (3/3 plans) — completed 2026-03-15
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>✅ v1.1 Fixes & Polish (Phases 4-6) — SHIPPED 2026-03-15</summary>
|
||||
|
||||
- [x] Phase 4: Database & Planning Fixes (2/2 plans) — completed 2026-03-15
|
||||
- [x] Phase 5: Image Handling (2/2 plans) — completed 2026-03-15
|
||||
- [x] Phase 6: Category Icons (3/3 plans) — completed 2026-03-15
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>✅ v1.2 Collection Power-Ups (Phases 7-9) — SHIPPED 2026-03-16</summary>
|
||||
|
||||
- [x] Phase 7: Weight Unit Selection (2/2 plans) — completed 2026-03-16
|
||||
- [x] Phase 8: Search, Filter, and Candidate Status (2/2 plans) — completed 2026-03-16
|
||||
- [x] Phase 9: Weight Classification and Visualization (2/2 plans) — completed 2026-03-16
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>✅ v1.3 Research & Decision Tools (Phases 10-13) — SHIPPED 2026-04-08</summary>
|
||||
|
||||
- [x] Phase 10: Schema Foundation + Pros/Cons Fields (1/1 plans) — completed 2026-03-16
|
||||
- [x] Phase 11: Candidate Ranking (2/2 plans) — completed 2026-03-16
|
||||
- [x] Phase 12: Comparison View (1/1 plans) — completed 2026-03-17
|
||||
- [x] Phase 13: Setup Impact Preview (2/2 plans) — completed 2026-04-08
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>✅ v2.0 Platform Foundation (Phases 14-23) — SHIPPED 2026-04-08</summary>
|
||||
|
||||
- [x] Phase 14: PostgreSQL Migration (6/6 plans) — completed 2026-04-05
|
||||
- [x] Phase 15: External Authentication (3/3 plans) — completed 2026-04-05
|
||||
- [x] Phase 16: Multi-User Data Model (4/4 plans) — completed 2026-04-05
|
||||
- [x] Phase 17: Object Storage (3/3 plans) — completed 2026-04-05
|
||||
- [x] Phase 18: Global Items & Public Profiles (5/5 plans) — completed 2026-04-05
|
||||
- [x] Phase 19: Reference Item Model & Tags Schema (3/3 plans) — completed 2026-04-05
|
||||
- [x] Phase 20: FAB & Full-Screen Catalog Search (2/2 plans) — completed 2026-04-06
|
||||
- [x] Phase 21: Item & Catalog Detail Pages (3/3 plans) — completed 2026-04-06
|
||||
- [x] Phase 22: Add-from-Catalog & Thread Integration (2/2 plans) — completed 2026-04-06
|
||||
- [x] Phase 23: Manual Entry Fallback (1/1 plans) — completed 2026-04-06
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>✅ v2.1 Public Discovery (Phases 24-27) — SHIPPED 2026-04-12</summary>
|
||||
|
||||
- [x] Phase 24: Public Access & Infrastructure (2/2 plans) — completed 2026-04-10
|
||||
- [x] Phase 25: Catalog Enrichment & Agent Tools (2/2 plans) — completed 2026-04-10
|
||||
- [x] Phase 26: Discovery Landing Page (3/3 plans) — completed 2026-04-10
|
||||
- [x] Phase 27: Top Nav Restructure & Search Bar Rethink (4/4 plans) — completed 2026-04-12
|
||||
|
||||
</details>
|
||||
|
||||
### v2.2 User Experience Polish (In Progress)
|
||||
|
||||
**Milestone Goal:** Fix broken user-facing features and polish the experience for real users — working profiles, better image handling, refreshed onboarding, and mobile refinements.
|
||||
|
||||
- [x] **Phase 28: Profile & Logto Integration** — Fix profile page, integrate Logto for profile management, customize login branding, configure email verification (completed 2026-04-12)
|
||||
- [x] **Phase 29: Image Presentation** — Fit-within framing with letterbox/pillarbox instead of hard crops, optional crop positioning (completed 2026-04-12)
|
||||
- [x] **Phase 30: Onboarding Redesign** — Catalog-driven onboarding replacing manual entry, visual refresh to match current UI (promotes 999.2) (completed 2026-04-12)
|
||||
- [x] **Phase 31: Mobile Polish** — Icon-based action buttons on item views, small UX improvements (completed 2026-04-12)
|
||||
|
||||
### v2.3 Global & Social Ready (Planned)
|
||||
|
||||
**Milestone Goal:** Make GearBox work for a global audience with setup sharing, multi-currency support, and localization infrastructure.
|
||||
|
||||
- [ ] **Phase 32: Setup Sharing System** — Visibility toggle (private/link/public), link sharing, schema future-proofed for likes, friends, and collaborative editing
|
||||
- [ ] **Phase 33: Currency System** — Multi-currency support (USD/EUR/GBP), price display per user preference
|
||||
- [ ] **Phase 34: i18n Foundation** — Translation framework, string extraction, locale-aware formatting
|
||||
|
||||
## Phase Details
|
||||
|
||||
### Phase 24: Public Access & Infrastructure
|
||||
**Goal**: Anyone can browse the catalog, public setups, and user profiles without logging in
|
||||
**Depends on**: Phase 23 (v2.0 complete)
|
||||
**Requirements**: PUBL-01, PUBL-02, PUBL-03, PUBL-04, PUBL-05, INFR-01
|
||||
**Success Criteria** (what must be TRUE):
|
||||
1. Visiting the app without a session shows the app content immediately — no auth spinner, no redirect to login
|
||||
2. An unauthenticated visitor can browse the global item catalog and open a catalog detail page
|
||||
3. An unauthenticated visitor can view a public setup and see its items and totals
|
||||
4. An unauthenticated visitor can view a user's public profile page
|
||||
5. Attempting to create, edit, or delete any item/setup/thread while unauthenticated redirects to login
|
||||
**Plans**: 2 plans
|
||||
|
||||
Plans:
|
||||
- [x] 24-01-PLAN.md — Rate limit factory and tiered public endpoint protection
|
||||
- [x] 24-02-PLAN.md — Client-side public access (render-first root, auth prompt, setup/catalog guards)
|
||||
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 25: Catalog Enrichment & Agent Tools
|
||||
**Goal**: Global items carry attribution metadata and can be bulk-populated by an MCP agent swarm
|
||||
**Depends on**: Phase 24
|
||||
**Requirements**: CATL-01, CATL-02, CATL-03, CATL-04, CATL-05, SEED-01, SEED-02, SEED-03
|
||||
**Success Criteria** (what must be TRUE):
|
||||
1. A catalog item detail page displays image credit and a link to the image source
|
||||
2. Attempting to import two items with the same brand and model updates the existing record rather than creating a duplicate
|
||||
3. A single API call with an array of items imports them all, upserting on (brand, model) conflict
|
||||
4. An MCP agent can call `upsert_catalog_item` with attribution fields and the item appears in the catalog
|
||||
5. An MCP agent can call `bulk_upsert_catalog` with a batch of items and all are persisted with attribution
|
||||
**Plans**: 2 plans
|
||||
|
||||
Plans:
|
||||
- [x] 25-01-PLAN.md — Schema migration (attribution columns + unique constraint) and upsert service layer
|
||||
- [ ] 25-02-PLAN.md — HTTP upsert routes, MCP catalog tools, and client attribution display
|
||||
|
||||
### Phase 26: Discovery Landing Page
|
||||
**Goal**: The app opens to a public discovery feed with prominent catalog search, not a personal dashboard
|
||||
**Depends on**: Phase 25
|
||||
**Requirements**: DISC-01, DISC-02, DISC-03, DISC-04, DISC-05, INFR-02
|
||||
**Success Criteria** (what must be TRUE):
|
||||
1. The root URL shows a landing page with a catalog search bar at the top, visible without logging in
|
||||
2. Below the search bar, a feed of popular public setups is visible with titles, creator names, and item counts
|
||||
3. The landing page shows a section of recently added catalog items
|
||||
4. The landing page shows a section of trending categories
|
||||
5. A logged-in user sees a "Go to Collection" link or button on the landing page that navigates to their personal collection
|
||||
**Plans**: 3 plans
|
||||
|
||||
Plans:
|
||||
- [x] 26-01-PLAN.md — Discovery service layer with cursor pagination (TDD)
|
||||
- [x] 26-02-PLAN.md — Discovery routes, server registration, and client hooks
|
||||
- [x] 26-03-PLAN.md — Landing page UI and PublicSetupCard enhancement
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 27: Top Nav Restructure & Search Bar Rethink
|
||||
**Goal**: Replace the minimal TotalsBar with a persistent top navigation bar (logo, section links, catalog search, user avatar) and move mobile navigation to a bottom tab bar — elevating Setups to top-level and removing the landing page hero
|
||||
**Depends on**: Phase 26
|
||||
**Requirements**: NAV-01, NAV-02, NAV-03, NAV-04, NAV-05
|
||||
**Success Criteria** (what must be TRUE):
|
||||
1. A persistent top nav bar shows logo, Home/Collection/Setups links, catalog search, and user avatar on desktop
|
||||
2. Clicking Collection or Setups while anonymous triggers AuthPromptModal instead of navigating
|
||||
3. On mobile, navigation appears as a fixed bottom tab bar with Home, Collection, Setups, and Search icons
|
||||
4. The landing page no longer has a hero section — content starts with Popular Setups
|
||||
5. Setups has its own top-level route accessible from the nav bar, not nested in Collection tabs
|
||||
**Plans**: 4 plans
|
||||
|
||||
Plans:
|
||||
- [x] 27-00-PLAN.md — Wave 0: E2E test scaffolding for nav restructure
|
||||
- [x] 27-01-PLAN.md — TopNav and BottomTabBar components
|
||||
- [x] 27-02-PLAN.md — Setups top-level route and Collection tab simplification
|
||||
- [x] 27-03-PLAN.md — Root layout wiring, hero removal, and visual verification
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 28: Profile & Logto Integration
|
||||
**Goal**: Users have a working profile page with account management powered by Logto, branded login screens, and email verification
|
||||
**Depends on**: Phase 27 (v2.1 complete)
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
|
||||
### Phase 29: Image Presentation
|
||||
**Goal**: Images display within the fixed aspect ratio using fit-within framing (letterbox/pillarbox) instead of hard crops, preserving the full image
|
||||
**Depends on**: Phase 28
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
|
||||
### Phase 30: Onboarding Redesign
|
||||
**Goal**: New users experience a polished, catalog-driven onboarding flow that matches the current UI style and guides them through their first setup
|
||||
**Depends on**: Phase 28
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 31: Mobile Polish
|
||||
**Goal**: Mobile item views use icon-based action buttons instead of text labels, with small UX refinements across touch interactions
|
||||
**Depends on**: None
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 32: Setup Sharing System
|
||||
**Goal**: Setup owners can toggle visibility between private, link-shared, and public, with schema designed for future likes, friends, and collaborative editing
|
||||
**Depends on**: Phase 28 (profiles working)
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
**UI hint**: yes
|
||||
|
||||
### Phase 33: Currency System
|
||||
**Goal**: Users can select their preferred currency (USD/EUR/GBP) and all prices display accordingly
|
||||
**Depends on**: Phase 32
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
|
||||
### Phase 34: i18n Foundation
|
||||
**Goal**: Translation framework in place with string extraction, locale-aware formatting, and at least English + one additional language
|
||||
**Depends on**: Phase 33
|
||||
**Requirements**: TBD (discuss phase)
|
||||
**Success Criteria** (what must be TRUE):
|
||||
TBD (discuss phase)
|
||||
**Plans**: TBD
|
||||
|
||||
## Progress
|
||||
|
||||
| Phase | Milestone | Plans Complete | Status | Completed |
|
||||
|-------|-----------|----------------|--------|-----------|
|
||||
| 1. Foundation and Collection | v1.0 | 4/4 | Complete | 2026-03-14 |
|
||||
| 2. Planning Threads | v1.0 | 3/3 | Complete | 2026-03-15 |
|
||||
| 3. Setups and Dashboard | v1.0 | 3/3 | Complete | 2026-03-15 |
|
||||
| 4. Database & Planning Fixes | v1.1 | 2/2 | Complete | 2026-03-15 |
|
||||
| 5. Image Handling | v1.1 | 2/2 | Complete | 2026-03-15 |
|
||||
| 6. Category Icons | v1.1 | 3/3 | Complete | 2026-03-15 |
|
||||
| 7. Weight Unit Selection | v1.2 | 2/2 | Complete | 2026-03-16 |
|
||||
| 8. Search, Filter, and Candidate Status | v1.2 | 2/2 | Complete | 2026-03-16 |
|
||||
| 9. Weight Classification and Visualization | v1.2 | 2/2 | Complete | 2026-03-16 |
|
||||
| 10. Schema Foundation + Pros/Cons Fields | v1.3 | 1/1 | Complete | 2026-03-16 |
|
||||
| 11. Candidate Ranking | v1.3 | 2/2 | Complete | 2026-03-16 |
|
||||
| 12. Comparison View | v1.3 | 1/1 | Complete | 2026-03-17 |
|
||||
| 13. Setup Impact Preview | v1.3 | 2/2 | Complete | 2026-04-08 |
|
||||
| 14. PostgreSQL Migration | v2.0 | 6/6 | Complete | 2026-04-05 |
|
||||
| 15. External Authentication | v2.0 | 3/3 | Complete | 2026-04-05 |
|
||||
| 16. Multi-User Data Model | v2.0 | 4/4 | Complete | 2026-04-05 |
|
||||
| 17. Object Storage | v2.0 | 3/3 | Complete | 2026-04-05 |
|
||||
| 18. Global Items & Public Profiles | v2.0 | 5/5 | Complete | 2026-04-05 |
|
||||
| 19. Reference Item Model & Tags Schema | v2.0 | 3/3 | Complete | 2026-04-05 |
|
||||
| 20. FAB & Full-Screen Catalog Search | v2.0 | 2/2 | Complete | 2026-04-06 |
|
||||
| 21. Item & Catalog Detail Pages | v2.0 | 3/3 | Complete | 2026-04-06 |
|
||||
| 22. Add-from-Catalog & Thread Integration | v2.0 | 2/2 | Complete | 2026-04-06 |
|
||||
| 23. Manual Entry Fallback | v2.0 | 1/1 | Complete | 2026-04-06 |
|
||||
| 24. Public Access & Infrastructure | v2.1 | 2/2 | Complete | 2026-04-10 |
|
||||
| 25. Catalog Enrichment & Agent Tools | v2.1 | 2/2 | Complete | 2026-04-10 |
|
||||
| 26. Discovery Landing Page | v2.1 | 3/3 | Complete | 2026-04-10 |
|
||||
| 27. Top Nav Restructure & Search Bar Rethink | v2.1 | 4/4 | Complete | 2026-04-12 |
|
||||
| 28. Profile & Logto Integration | v2.2 | 3/3 | Complete | 2026-04-12 |
|
||||
| 29. Image Presentation | v2.2 | 5/5 | Complete | 2026-04-13 |
|
||||
| 30. Onboarding Redesign | v2.2 | 3/3 | Complete | 2026-04-12 |
|
||||
| 31. Mobile Polish | v2.2 | 2/2 | Complete | 2026-04-12 |
|
||||
| 32. Setup Sharing System | v2.3 | TBD | Pending | — |
|
||||
| 33. Currency System | v2.3 | TBD | Pending | — |
|
||||
| 34. i18n Foundation | v2.3 | TBD | Pending | — |
|
||||
|
||||
## Backlog
|
||||
|
||||
### Phase 999.1: Rewrite E2E Tests for OIDC Auth (BACKLOG)
|
||||
**Goal**: E2E tests currently expect local username/password login but auth moved to external OIDC (Logto). Rewrite with mock OIDC provider or API-key-based auth bypass. Seed migration to Postgres is already done.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.2: Revamp Onboarding Flow (BACKLOG)
|
||||
**Goal**: Redesign the onboarding experience to match the current app style and flow. Replace the manual item edit form with the catalog search function. Visual refresh to align with the newer UI patterns.
|
||||
**Status**: Promoted to Phase 30 (v2.2)
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.5: Legal Pages — ToS, Privacy Policy, and Compliance (BACKLOG)
|
||||
**Goal**: Create Terms of Service, Privacy Policy, and any other required legal/compliance pages for a public-facing platform. Essential before opening to real users.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.6: Admin Panel (BACKLOG)
|
||||
**Goal**: Build an admin panel for reviewing user-submitted items (catalog submissions), managing global/reference items, and general platform administration. Includes approval workflows for community contributions.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.7: User Feedback System (BACKLOG)
|
||||
**Goal**: Add an in-app feedback collection mechanism so users can report bugs, suggest features, and share general feedback. Could be a simple form, widget, or integration with an external tool.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.8: Analytics Integration (BACKLOG)
|
||||
**Goal**: Integrate privacy-respecting analytics (PostHog, Umami, or similar) to understand usage patterns, popular categories, search behavior, and feature adoption. Self-hosted preferred to align with independent ethos.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.9: Mobile App (BACKLOG)
|
||||
**Goal**: Bring GearBox to mobile. Start with a PWA for quick wins (offline support, home screen install), then evaluate dedicated native apps (React Native / Flutter) for richer experience — camera for weight verification, barcode scanning, etc.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.10: Monetization Strategy (BACKLOG)
|
||||
**Goal**: Define how GearBox sustains itself financially. Options to explore: sponsored/promoted items (brand X promotes product Y), premium features, affiliate links. Critical tension: revenue vs. independent credibility — GearBox's value is unbiased gear data, so monetization must not compromise trust. Needs deep discussion before implementation.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
|
||||
### Phase 999.11: Marketing Website (BACKLOG)
|
||||
**Goal**: Build a separate marketing/brand website (www.gearbox.de) distinct from the app (app.gearbox.de). Hero section with search bar, value proposition, feature highlights, how-it-works, social proof, and sign-up CTA. This is the public-facing front door — the first thing people see before they enter the app. The current discovery page is the in-app experience; this is the standalone website around it.
|
||||
**Requirements**: TBD
|
||||
**Plans**: TBD
|
||||
|
||||
Plans:
|
||||
- [ ] TBD (promote with /gsd:review-backlog when ready)
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Nuke dev seed user and re-seed. Run inside the container:
|
||||
# docker exec -it <container> bash scripts/nuke-and-reseed.sh
|
||||
# Delete after use.
|
||||
|
||||
set -e
|
||||
|
||||
echo "Deleting dev seed user..."
|
||||
bun -e "
|
||||
import { eq } from 'drizzle-orm';
|
||||
import { db } from './src/db/index.ts';
|
||||
import { apiKeys, categories, items, sessions, settings, setupItems, setups, threadCandidates, threads, users } from './src/db/schema.ts';
|
||||
|
||||
const [user] = await db.select().from(users).where(eq(users.logtoSub, 'dev-user-seed')).limit(1);
|
||||
if (!user) { console.log('No dev user found'); process.exit(0); }
|
||||
const uid = user.id;
|
||||
|
||||
const userSetups = await db.select().from(setups).where(eq(setups.userId, uid));
|
||||
for (const s of userSetups) await db.delete(setupItems).where(eq(setupItems.setupId, s.id));
|
||||
await db.delete(setups).where(eq(setups.userId, uid));
|
||||
|
||||
const userThreads = await db.select().from(threads).where(eq(threads.userId, uid));
|
||||
for (const t of userThreads) await db.delete(threadCandidates).where(eq(threadCandidates.threadId, t.id));
|
||||
await db.delete(threads).where(eq(threads.userId, uid));
|
||||
|
||||
await db.delete(items).where(eq(items.userId, uid));
|
||||
await db.delete(settings).where(eq(settings.userId, uid));
|
||||
await db.delete(apiKeys).where(eq(apiKeys.userId, uid));
|
||||
await db.delete(sessions).where(eq(sessions.userId, uid));
|
||||
await db.delete(categories).where(eq(categories.userId, uid));
|
||||
await db.delete(users).where(eq(users.id, uid));
|
||||
console.log('Dev user deleted');
|
||||
"
|
||||
|
||||
echo "Re-seeding..."
|
||||
bun run db:seed:dev
|
||||
|
||||
echo "Done!"
|
||||
Reference in New Issue
Block a user