Cooking while shopping
This example demonstrates a simple e-commerce workflow with a product list and a shopping cart. Cart data is stored in a browser cookie instead of a database, each entry contains only the product ID and quantity needed to reconstruct the cart.
(cookie structure) 👉
{
'pl-1': 4,
'pl-2': 1,
'pl-3': 2,
...
}
The application provides controls for adding products to the cart, updating item quantities, and removing products, while keeping the cart state persistent across page reloads and future visits.
What I've learned?
- Next.js Cookies 🍪
- cookie-next
- Improving TailwindCSS
- Array.reduce() (used for sum total in cart)


