Implement server-side user model with wishlist persistence#8
Draft
Implement server-side user model with wishlist persistence#8
Conversation
…data Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
…mponents Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
Co-authored-by: thomasiverson <12767513+thomasiverson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add full user model with wishlist feature
Implement server-side user model with wishlist persistence
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements user management with server-side wishlist storage. Users register/login via API, wishlist operations use userId for data isolation.
Backend
User Model (
api/src/models/user.ts)API Endpoints (
api/src/routes/user.ts)POST /api/users- Registration with email/password validationGET /api/users/:email- Fetch user by emailPUT /api/users/id/:userId- Update userGET /api/users/:userId/wishlist- Returns full product detailsPOST /api/users/:userId/wishlist- Add productDELETE /api/users/:userId/wishlist/:productId- Remove productTests - 25 test cases covering CRUD, validation, and wishlist operations
Seed Data - 3 users with pre-populated wishlists (alice@example.com, bob@github.com, charlie@example.com)
Frontend
AuthContext Rewrite (
frontend/src/context/AuthContext.tsx)WishlistContext (
frontend/src/context/WishlistContext.tsx)New Components
Register.tsx- Registration form with password confirmationWishlist.tsx- Product grid with remove functionalityUpdated Components
Products.tsx- Heart icon toggles on product cards (authenticated only)Navigation.tsx- Wishlist link with count badge, user name displayLogin.tsx- Register link, improved error messagesRoutes
/register→ Registration form/wishlist→ Wishlist pageArchitecture
Screenshots
Registration Page

Login Page

Products Page with Heart Icons

Original prompt
This section details on the original issue you should resolve
<issue_title>Add Full User Model with Wishlist Feature (Variation 3)</issue_title>
<issue_description>## Variation 3: Enhanced User Model with Wishlist
Overview
Implement a comprehensive user management system with proper user models and authentication. The wishlist becomes a property of the User entity, creating the most complete and scalable solution.
Implementation Details
Backend (API):
api/src/models/user.tsCreate
api/src/routes/user.tswith full CRUD operationsPOST /api/users- Register new userGET /api/users/:email- Get user by email (for login)PUT /api/users/:userId- Update user detailsGET /api/users/:userId/wishlist- Get user's wishlist with full product detailsPOST /api/users/:userId/wishlist- Add product to user's wishlistDELETE /api/users/:userId/wishlist/:productId- Remove from wishlistresetUsers()function for testsCreate
api/src/routes/user.test.tsAdd user seed data to
api/src/seedData.tsusersarrayUpdate
api/src/index.ts/api/usersFrontend:
Complete rewrite of
frontend/src/context/AuthContext.tsxCreate
frontend/src/components/Register.tsxPOST /api/usersendpointCreate
frontend/src/context/WishlistContext.tsxGET /api/users/:userId/wishlistUpdate
frontend/src/components/entity/product/Products.tsxPOST /api/users/:userId/wishlistCreate
frontend/src/components/Wishlist.tsxpageGET /api/users/:userId/wishlistUpdate
frontend/src/components/Login.tsxUpdate
frontend/src/components/Navigation.tsxUpdate
frontend/src/App.tsx/wishlist→<Wishlist />/register→<Register />Update
frontend/src/api/config.tsusers: '/api/users'Authentication Flow:
Advanced Features:
Testing
API Tests:
Manual Frontend Tests:
Files to Create/Modify:
API:
api/src/models/user.tsapi/src/routes/user.tsapi/src/routes/user.test.tsapi/src/seedData.tsapi/src/index.tsFrontend:
frontend/src/components/Register.tsxfrontend/src/context/WishlistContext.tsxfrontend/src/components/Wishlist.tsxfrontend/src/context/AuthContext.tsx(major rewrite)frontend/src/components/Login.tsx💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.