Client State Management
- •
Shopping Cart:
- •Use React Context API (
CartContext.tsx) or Zustand for the shopping cart. - •Persist cart to
localStorageso data isn't lost on refresh. - •The Cart should NOT write to the database until the "Checkout" button is pressed.
- •Use React Context API (
- •
URL State:
- •For filtering (Search, Category selection), use URL Search Params (
?category=dairy&sort=price). - •This makes the app shareable and bookmarkable.
- •For filtering (Search, Category selection), use URL Search Params (