Reviewed application code under src/ for stubs, shallow paths, hardcoded assumptions, and missing error handling.
-
Cart UX behaved like a prototype rather than a real flow — demo cart items and non-persistent add-to-cart interactions.
- Priority: P0
- Files:
src/app/cart/page.tsx,src/components/product-purchase.tsx,src/components/cart-bundle-button.tsx,src/app/api/cart/route.ts - Fix implemented: cart now reads/writes real API data, accepts slug/id inputs, supports increment vs replace, and handles auth/error states.
-
Subscription management controls were visual stubs — pause/cancel/resume actions were not actionable.
- Priority: P1
- Files:
src/app/subscriptions/page.tsx,src/components/subscription-actions.tsx,src/app/api/subscriptions/route.ts - Fix implemented: added real PATCH-backed controls with optimistic refresh and toast feedback.
-
Auth registration allowed producer self-elevation in payload semantics.
- Priority: P0
- Files:
src/app/api/auth/register/route.ts,src/app/auth/register/page.tsx - Fix implemented: server always creates
consumer; UI now treats producer as a follow-up application flow.
-
JSON parsing/error handling was inconsistent on critical endpoints.
- Priority: P1
- Files:
src/lib/http.ts,src/app/api/auth/{login,register}/route.ts,src/app/api/{cart,checkout,products,subscriptions}/route.ts,src/app/api/producer/onboarding/route.ts - Fix implemented: added shared
parseJsonBody()and standardized validation/error responses on touched routes.
-
Checkout validation was shallow across client and server.
- Priority: P1
- Files:
src/app/checkout/page.tsx,src/app/api/checkout/route.ts - Fix implemented: required delivery slot/CAP/address validation, better coupon feedback, and safer stock-update error reporting.
-
Product creation endpoint lacked ownership/auth guards.
- Priority: P1
- Files:
src/app/api/products/route.ts - Fix implemented: producer/admin authorization plus ownership enforcement for producer-created catalog items.
-
Webhook helper accepted any mock signature.
- Priority: P2
- Files:
src/lib/stripe.ts - Fix implemented: removed unconditional success fallback from
verifyWebhookSignature().
src/lib/validation.ts— reusable runtime validation helpers remain solid and are now used more consistently.src/lib/auth.ts— session creation and cookie handling continue to support the main auth flow correctly.src/components/skeleton.tsx— a good base for reusable loading states; now used across route loaders.src/lib/data.ts/ seeded marketplace content — good source for rich marketing/catalog views; now better connected to live cart flows.
- P0: remove producer role self-elevation semantics, replace stub cart behavior.
- P1: harden JSON parsing, product auth, checkout validation, subscription actions.
- P2: tighten webhook helper behavior.
- P3: no additional P3 items retained after fixes in this pass.
All 🔴 and 🟡 findings listed above were fixed in this pass.
Validation completed with:
npm run lint(passes with pre-existing warnings)npm run buildnpm run test -- --run