
Build a complete MERN e-commerce backend API with node.js and mongoDB in two phases: with ai and without ai, using Cursor AI and ChatGPT for roadmap, features, and Postman testing.
Clarify the project scope and tech stack for a node.js, express, MongoDB, and mongoose MERN backend. Generate models and features, arrange MVC folder structure, and prepare prompts for cursor AI.
Explore Cursor I, a VS Code-based code editor with built-in AI, learn how to customize with extensions, enable composer to generate files, and use chat to reference code and docs.
Generate the e-commerce backend api using mongoose and express by scaffolding folders and files with the kci composer feature, including a node script to create the folder structure.
Implement user authentication for a MERN backend by building the user model, auth controller, and auth routes with JWT-based login and MongoDB integration.
Obtain the MongoDB Atlas connection string by creating a free project, then configure your environment with the mongo url and test the database connection.
Test the register and login endpoints using Postman, configure an API version one endpoint structure, and verify token generation for authentication in the MERN e-commerce backend.
Implement and wire the user profile update in the MERN backend by updating the user model and controller, wiring routes and app.js, and adding authentication middleware.
Test and validate the MERN e-commerce backend's user endpoints, including profile get and patch, plus address create, update, and delete, with token-based authentication.
Learn to implement product logic in a MERN e-commerce backend by building the product model and controllers, with routes and search support, plus Cloudinary file uploads.
Test product API endpoints with postman: create, get all, details, update, delete, and stock; enforce admin authorization and handle form data and image uploads.
Configure Postman environments to boost API testing efficiency by defining a dev environment with base URL and token as variables, reuse them in requests, and test categories and brands endpoints.
Test the brands and categories routes with postman, covering create and list. Ensure token-based admin authorization via middleware and validate category payloads and brand logo uploads.
Implement backend cart management by building an embedded cart model, calculating total items and amount, and exposing get, add, update, delete, and clear endpoints mounted in app.js.
Implement shipping methods in the MERN backend by building the shipping method model, controller, and routes, organizing docs, and preparing a complete shipping methods API endpoint for testing.
Test shipping methods endpoints by creating and updating methods, retrieving regions, and calculating costs, using postman with sample json and validating data structures.
Learn to place orders by integrating Stripe payment in a MERN backend, creating orders from cart items with shipping methods, handling payments and status updates.
Develop a payment history model and controller to track transactions with amount, currency, status, and method, enabling separation of concern, pagination, and date filtering for admin review.
Implement wishlist logic by wiring endpoints to add, view, delete, and move items to cart using product ids and authorization tokens. Expose routes like /wishlist and /wishlist/:id/move-to-cart with sample json.
Define a review model in the MERN backend with user, product ID, rating, comment, and status; prevent duplicates and compute the average rating through the review controller and routes.
Explore the customers' demo workflow in a MERN e-commerce backend, showcasing dynamic categories, product filtering, cart management, coupon application, checkout with stripe, and a customer dashboard.
Explore admin functionalities in the MERN e-commerce backend API, including logging in as admin, viewing customers, managing orders and payments, and adding products, stock, coupons, categories, colors, brands, and reviews.
Explore building a complete MERN e-commerce backend API with Node.js, Express, MongoDB, and Mongoose, including payment integration with webhooks, stock management, categories, coupons, product filtering, pagination, and authentication.
Explore the two-part course structure, focusing on API development with MongoDB and Node.js, and separate front-end paths using React and Redux for flexible MERN e-commerce backend development.
Outline the node.js e commerce api folder structure—app, config, controllers, middleware, models—and initialize with npm, install express and mongoose, and set up server.js for dev and prod.
Identify the prerequisites for the MERN e-commerce backend API course, covering Express basics, GPRS, MongoDB data modeling, authentication and authorization, a RESTful API with Node.js, and MVC design patterns.
Set up a MERN backend server by wiring Express with the Node.js http core module, using ES module imports, exporting an app, and running on port 7000.
Model the MERN e-commerce backend by defining admin, product, customer, order, review, and wishlist collections, and establish admin-to-product one-to-many, product-to-review one-to-many, and customer-to-review one-to-one relationships.
Define the user data model in a MERN backend with mongoose, including full name, email, password, admin flag, shipping address, and references to orders and wish lists via object ID.
Create a db connect function using mongoose in the config folder to establish a MongoDB connection, export it, and wire it into the app with error handling.
Connect your app to MongoDB using a connection string stored in a .env file and loaded with dotenv. Ensure the connection is established and hide credentials from public access.
Learn to visualize and connect to a MongoDB database in VSCode using Compass or the MongoDB extension, set up a connection string, and view default collections.
Explore authentication and authorization by building a user registration flow using the mvc design pattern, with a user model, controllers, and the api version 1 users/register endpoint.
Hash user passwords with bcryptjs by generating a salt with bcrypt.genSalt(10) and saving the hashed password to the database in the controller.
Implement login functionality for the MERN e-commerce backend API by validating email and comparing the provided password to the stored hash, exposing a login route and controller with error handling.
Learn to implement robust error handling in a MERN backend by using express-async-handler, building a global error handler, throwing errors, and standardizing 404 and 500 responses.
Create a not found route handler to return meaningful errors for endpoints that don't exist, and connect it to a global error handler for centralized error handling in MERN backend.
Explain authentication and authorization with token-based authentication using JSON Web Token, showing how admin and customer roles access rights. Discuss stateless servers and token validation in requests.
Prevent a Mongoose warning by adjusting code order and using force before connecting to Mongoose, ensuring MongoDB connects, and then continue with the authorization process.
Generate a login token with JSON web token by signing a payload including user id, using a secret key and a 3-day expiry, then decode and verify to confirm authenticity.
Extract a bearer token from the header in a MERN backend by parsing the authorization header to obtain the token and prepare for JSON web token verification.
Verify tokens with json web token using the verify method and the jwt key from environment variables, then protect routes such as the user profile.
Implement the isLogin middleware that extracts and verifies a token from the header, decodes the user, stores the user id on the request, and protects routes.
Define the product data model with mongoose, including name, description, brand, category, and multiple sizes and colors. Include images, price, total quantity, total sold, reviews, creator references, and auto-generated timestamps.
Create a private API v1 product creation endpoint by implementing an admin-only product controller that validates input, checks for existing products, and saves new product data linked to a category.
Create a get all products controller using mongoose find to fetch records and return them with res.json, and plan future filtering, pagination, and API versioning.
Master Postman environments to manage base urls and tokens across api versions, using dev environment variables for base url and bearer token in the authorization header for seamless requests.
Learn to filter products by name in a mern stack e-commerce backend api using mongoose queries and query strings, with case-insensitive regex search.
Filter products by brand, category, colors, and sizes in a MERN backend API, using request properties and operators to build multi-criteria queries.
Learn to filter products by a price range in MERN backend by parsing a dash-separated query and using MongoDB gte and lte to return results within min and max prices.
Implement product pagination by defining page and limit, computing start index and end index, and skipping records to return a page with the total count of documents.
Implement pagination in the MERN e-commerce backend API, adding a pagination object with next and previous pages, tracking end index, total records, and a product fetched message.
Build a MERN backend controller to fetch a single product using the id from request params, handle not-found errors, and return the product.
Learn to update a product in the MERN backend by implementing an update product controller, using findByIdAndUpdate, and protecting the route with admin only authorization via token.
Implement delete product functionality in the MERN backend by updating the product controller, creating a delete by id API, and validating with Postman using token authorization, returning product deleted.
Define a category model with name, user, image, and products, then implement an admin-protected create category flow that checks for duplicates and returns a category created successfully.
Develop a simple MERN backend categories controller with create, fetch all, get single, update, and delete operations, wired via routes—without pagination for this video.
Associate a product to a category by validating the category, linking the product via its ID, and updating the category’s products array; store category names in lowercase.
Develop a brands CRUD controller in the MERN ecommerce backend by duplicating the category pattern to implement endpoints for creating, fetching, updating, and deleting brands; test with Postman.
Learn to associate created products with existing brand categories in a MERN backend by validating brand existence, using references, and updating the brand with new products.
Builds a colors controller for the MERN e-commerce backend, enabling color creation and management. Implements a full colors CRUD with routes for creating, listing, updating, and deleting colors.
Modify the color model in the MERN e-commerce backend to avoid maintaining multiple color entries; remove the color field and keep the rest unchanged for better product discovery.
Define a mongoose review model referencing a user and a product, with a 1–5 rating and message, stored in the product's reviews array to support total, average, and review count.
Create a reviews controller that handles submitting product reviews by authenticating the user, validating the product, and saving the review with message and rating to the product.
Prevent duplicate reviews in a MERN e-commerce backend by checking if a user already reviewed a product, using populate to resolve review data.
Learn to compute total reviews and the average rating for a product in a MERN e-commerce backend API by using virtual properties on the product model and aggregating review ratings.
Learn the end-to-end order placement flow in a MERN e-commerce backend, from product selection and cart to Stripe payment, web hook, and updating order status.
Create a mongoose order model with user reference, order items, and shipping address; include an auto-generated order number, currency, payment status, and a status enum (pending, processing, shipped, delivered).
Create an order controller and an orders router in the MERN backend, wire the order model with an async handler, and test the protected route with a token using Postman.
Explore order placement in a MERN e-commerce backend: build the payload with user, shipping address, and order items; process Stripe payment; update product quantities and handle the payment web hook.
Explore order placement in a MERN e-commerce backend API, part 2. Update total sold and introduce a virtual quantity left to track stock and support best-seller insights during checkout.
Update the user shipping address via a private API, including first name, last name, address, city, postal code, province, and phone number, then set has shipping address to true.
This course is designed to provide students with a comprehensive understanding of building and deploying full-featured APIs, including leveraging AI tools like Cursor AI. Students will learn how to build APIs using AI-driven approaches while mastering backend development with the MERN stack, MongoDB/Mongoose, and integrating advanced features.
Throughout the course, students will learn to integrate Stripe for payment processing, implement pagination and filtering techniques, analyze order statistics, manage orders through an admin panel, and handle categories and product management. Additionally, the course will guide students on database design and connection, as well as implementing user authentication and authorization.
The course starts with an introduction to Node.js and the fundamentals of API development, including setting up a development environment, creating and testing API endpoints, and connecting to databases. As students progress, they will explore integrating Stripe for payments, handling webhooks, implementing advanced querying techniques, and building robust analytics systems.
What sets this course apart is the integration of AI-powered coding techniques using Cursor AI, enabling students to build efficient, scalable APIs faster. Students will also work on real-world projects to gain hands-on experience with tools and workflows that enhance their productivity and understanding of modern API development.
Topics include:
Building and testing APIs with AI-driven tools like Cursor AI
Integrating Stripe for payment processing and webhooks
Designing pagination, filtering, and order analytics
Implementing admin processes for orders, product management, and categories
Ensuring API security, performance, and scalability
By the end of the course, students will have a strong foundation in API development, the skills to deploy APIs in real-world environments, and practical experience with AI tools that enhance coding efficiency.