Episode 2: Product Model & MongoDB Setup
Define the Product model using Mongoose and implement RESTful API endpoints for managing products.
Define the Product model using Mongoose and implement RESTful API endpoints for managing products.
Set up a basic Express.js project using Express Generator, configure environment, folder structure, and enable CORS for cross-origin requests.
An online marketplace where users can register, browse products, add items to their cart, and complete purchases. Admins can manage products, orders, and users. OAuth (Google) login support and sec...
Add loading/error states, empty cart state, optional deploy (Vercel/etc.)
Auto login persists between page loads, and set up auto logout after a period of inactivity.
Quantity Update and Remove Items from Cart – you will upgrade your cart page with 2 new features: </br>- Increase/decrease product quantity </br>- Remove products from cart
Protect the Cart page so that only logged in users can access it. If they are not logged in, they will be redirected to the Login page.
Build Login functionality with simple authentication (based on email/password in db.json) and use LocalStorage to save login state
Build Cart page, "Add to Cart" button, save cart to JSON-Server
In this episode, we'll set up a **mock backend** using [JSON-Server](https://github.com/typicode/json-server). This allows us to simulate a REST API for products, users, and cart items.