This will be used for simple assessments and sample projects.
The frontend is almost complete, with just one missing function. Your task is to implement the "Add to Cart" functionality on the product details page (product-details.component.ts). When the "Add to Cart" button is clicked, the selected product should be added to the cart array.
Also you should build a simple "Show My Cart" page to display the items in your cart similar to the list of products.
The backend is partially completed. You need to implement the following API endpoints:
GET /api/getProducts: Retrieve a list of mocked products. GET /api/products/:id: Retrieve details of a specific product based on the provided ID. GET /api/getCart: Retrieve a list of items in the cart. GET /api/addToCart/:id: Add item to the cart and get a count of items.
The backend provides mocked data for products. The data is stored in backend/data/products.js.
Implement the missing "Add to Cart" functionality and "Show My Cart" in the frontend. Implement the backend API endpoints as specified above.
Please create a zip archive of your completed project (including the code and updated README) and send it to us.