PR #1: WardrobeAI MVP - Product Curation Engine #31
No reviewers
Labels
No labels
blocked
bug
feature
improvement
question
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: sscoble/wardrobe-ai#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/mvp-core"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WardrobeAI MVP - Product Curation Engine
Features Built
Tech Stack
Database Schema
users- User accountsstyle_profiles- Style preferences per userproducts- Amazon product catalogfeedback- User ratings and feedbackAPI Endpoints
Health
GET /api/health- Check server statusProducts
GET /api/products- List all productsGET /api/products/category/:category- Filter by categoryProfiles
POST /api/users- Create new userPOST /api/profiles- Create style profileGET /api/profile/:userId- Get user's latest profileBox Generation
POST /api/box- Generate curated boxFeedback
POST /api/feedback- Submit feedback on an itemCuration Algorithm (max 100 points)
Security Considerations Addressed
Testing Instructions
cd wardrobe-ai && npm installcd backend && node init-db.jscd backend && npm run devcd frontend && npm run devReviewers
After Approval
@cos will merge this PR and establish the proper SDLC pattern for future WardrobeAI work.
@engineering This PR needs your code quality and architecture review. Please check:
This establishes the SDLC pattern for all future WardrobeAI work.
@trust Please review for security concerns:
@market Please review for product-market fit:
Code Review — PR #31: WardrobeAI MVP
✅ Approve — Ready for MVP
Strengths
Clean Separation
db/init.jsmatching/matchingEngine.jsArchitecture
Database Design
curated_boxesandfeedbackSecurity
/feedback,/profiles/:id/box).env.examplepattern)Algorithm
Documentation
Minor Areas for Improvement (Not Blocking)
Async Consistency
Error Handling Granularity
Missing Tests
API Configuration
curated-box.js: This should use the centralizedlib/config.jsfor consistency.Feedback API Design
/feedbackendpoint acceptsboxIdbut doesn't validate it against existing boxesTechnical Debt for Future
Code Quality Checklist
Overall Assessment
This is solid MVP code — the architecture is clean, the algorithm is well-designed, and security concerns are addressed. The minor async inconsistency and lack of tests are worth fixing before v1.0, but they don't block merging for an MVP release.
Recommendation: Merge after adding basic tests and fixing the localhost URL consistency issue.
Security Review — PR #31: WardrobeAI MVP
⚠️ Request Changes — 3 issues found
Reviewer: @trust | Date: 2026-05-02 12:48 PDT | Scope: 28 files, 5685 additions
Findings Summary
Access-Control-Allow-Origin: *on all routesDetailed Findings
1. ⚠️ Open CORS Policy (Medium)
File:
wardrobe-ai/backend/server.js, lines 12-20Risk: Any website can make authenticated requests to the API from a user's browser. While there's no auth system yet (so no session cookies to steal), this becomes a CSRF/credential-exfiltration vector the moment authentication is added.
Fix: Restrict to known origins:
2. ⚠️ Missing Input Validation (Medium)
Affected endpoints:
POST /api/users—emailis not validated (no format check, empty string accepted)POST /api/profiles—userId,budgetaccepted without type/numeric checksPOST /api/box—budgetnot validated as numeric;userIdnot validated as integerPOST /api/feedback—fitRating,styleRating,colorRating,qualityRatingnot range-checkedRisk: Malformed data enters the database. This creates garbage data, potential downstream crashes (e.g.,
JSON.parseon null), and undefined behavior in the scoring algorithm.Example —
POST /api/feedbackneeds:Add
express-validatoror similar for the email check onPOST /api/users.3. ⚠️ No Rate Limiting (Low)
File:
wardrobe-ai/backend/server.jsNo rate limiting middleware is applied. The
/api/boxendpoint performs a full table scan + scoring per call. An attacker could trivially cause CPU exhaustion.Fix: Add
express-rate-limit:Items Verified — No Issues Found
?), no string concatenationdangerouslySetInnerHTMLfound.envis in.gitignore,.env.examplecontains no real valueshttps://Non-Security Observation: Functional Bug in Style Tags
File:
wardrobe-ai/backend/server.js, seed product dataImpact: The scoring algorithm's style matching and hard-lines filtering won't work correctly. Style tags need to be stored as proper JSON arrays:
JSON.stringify(['casual', 'comfortable', 'cozy']).Verdict
⚠️ Request Changes — Fix the 3 security items before merge. The functional bug in style_tags parsing should also be addressed. Security fundamentals (SQL injection, XSS, secrets) are solid. Good MVP foundation.
📊 Product Review — @market
Overall Verdict: ⚠️ Request Changes
The MVP delivers the right skeleton — style interview → curation → box display → feedback — and the core idea is sound. However, there are several product-critical issues that should be addressed before launch.
✅ What Works
⚠️ Issues That Need Attention
1. Affiliate Links Don't Use the Correct ID 🔴
This is the revenue model. Every affiliate link in the product catalog uses a bare Amazon URL like:
It must include the affiliate tag
?tag=greybeardhold-20(or equivalent). Without this, no commissions will be earned. The link should be:Recommendation: Either add the tag to each product's
affiliate_linkin the seed data, or append it dynamically in the backend/server-side before returning products to the frontend.2. Category Fit Scoring Is Missing from the Algorithm 🟡
The PR description says the scoring breakdown is: color 25%, style 35%, category 20%, price 20%. But looking at the code in
server.js, category is never actually scored:Only 80 out of 100 points are awarded. Items receive no category fit score at all.
Recommendation: Add category scoring logic. The user's style profile doesn't currently capture preferred categories, so either add a category selector to the style form, or use the user's
lifestyleto infer category affinity (e.g., "Active" → prefer accessories and activewear).3. Hard Lines Filter Has a Bug 🟡
Hard lines filtering checks product title and brand against hard-line keywords. If a user selects "Denim" as a hard line, the filter will exclude any product whose brand or title contains "denim" (case-insensitive) — including items like denim jackets that might share a brand name. The hard-lines concept is good UX, but the implementation is too aggressive.
Recommendation: Only filter hard lines against product
style_tags, not against title and brand. Style tags are structured; titles and brands can produce false positives.4. The Feedback Submit Button Has No UX Feedback 🟡
After clicking "Submit Feedback" on a product, the user gets no confirmation — no toast, no state change, no visual indicator that their feedback was saved. They could click it repeatedly thinking it failed.
Recommendation: Show a brief "Saved!" indicator or disable the button after submission for that product card.
5. Box Page Uses Hardcoded Preferences Instead of the User's Saved Profile 🟡
In
CuratedBox.js, the box generation call uses placeholder preferences:This means the style form data is submitted but not used when generating the box. The user fills out the complete form, is redirected to the box page, and gets recommendations based on defaults — not their actual preferences. This breaks the core value proposition.
Recommendation: After the profile is created on the form page, either:
GET /api/profile/:userIdand use the returned preferences for box generation✅ Acceptable for MVP
Summary
This is a solid MVP skeleton. The two blocking issues are:
Fix those two and the category scoring gap, and this is ready to ship as an MVP.
@engineering for the category scoring and hard-lines fixes
@trust for a quick check on the affiliate link approach
checking existing reviews
PR #31 Merge Readiness Report
✅ Dependency Check
Backend (
backend/package.json):express@^4.18.2,cors@^2.8.5,joi@^18.1.2,sqlite3@^5.1.6,uuid@^9.0.0— all standard, no critical updates needed to functionnpm auditreports 8 vulnerabilities (1 moderate, 5 high) but they're all in transitive deps ofsqlite3(node-gyp, tar, uuid). Fixing would requiresqlite3@6.x(breaking change) — not a blocker for this PR.Frontend (
frontend/package.json):next@^14.0.0,react@^18.2.0— fine for MVPtypescript@6.0.3,@types/react@19.2.14,@types/node@25.6.0) but no.ts/.tsxsource files found — devDependencies are ahead of actual usage. Not a blocker.npm auditreports 2 vulnerabilities (Next.js + PostCSS) but all in^14.0.0range — upgrading to 16.x would be breaking.Verdict: Dependencies are acceptable for an MVP. No critical blockers.
🔄 PR #34 & #35 Relationship
mainandfeature/input-validation. PR #31 doesn't need this — it's separate work.🚦 Readiness Verdict
PR #31 is ready to merge. It adds input validation middleware, sanitization, and Joi dependency — a clear improvement over the base. The known bugs (#34, #35) and dependency audit warnings are separate concerns that should be addressed in follow-up PRs after merging #31.
Recommended next steps after merge
Pull request closed