
Arash Olby introduces a step-by-step course to build an amazon clone with nodejs and mongodb, coding live and explaining concepts, with downloadable source code and email support.
Learn to build an Amazon-like ecommerce web app with product listings, search, categories, cart, sign in, sign up, Facebook login, and Stripe payments.
Explore the technology stack for a web app, including Node.js, Express, MongoDB, Elasticsearch, jQuery, and Stripe, and learn how these components enable server-side JavaScript, rendering, document storage, search, and payments.
Install Noojee, choose a text editor such as Tom or Sublime, set up git and a repository via source forge, and install Mongul to run on localhost using the terminal.
Master the basics of git: install and verify, initialize a repo, check status, stage changes with git add, commit with a message, view history, and push to a remote repository.
Master the basics of http, including get and post, and how api calls differ from server-rendered pages. See how Node.js, Express, and MongoDB power the backend and frontend.
Install nodemon to automatically restart your server as you edit files, avoiding manual restarts; install globally with sudo npm install -g nodemon for your nodejs projects.
Learn to scaffold a Node.js e-commerce app by creating a project folder, initializing npm, installing dependencies, and building a simple Express server that listens on a port.
Define your first home route using express get, and learn how requests and responses work. Test it in the browser while exploring port setup, routing, and post versus get concepts.
Implement a request logging setup by integrating the Morgan middleware in an Express app, wire routes to log every hit, and observe terminal logs for successful and 404 requests.
Create a mongoose-based user schema as a blueprint, defining email, password, profile fields, and address, then implement pre-save hashing with salt and a custom compare-password method.
Configure the database on MongoLab, set up the mongoose model, install dependencies, create and connect a database and user, and verify the connection to test the user schema.
Configure Mongoose to connect to MongoDB and create a route for the user schema. Use Postman and body-parser to send requests, then verify the user data is saved in MongoDB.
Spotlight a subtle validation mistake that caused duplicate emails to save without errors, and show fixing the missing return and reviewing the password hashing process in the Amazon clone course.
Learn to render data with the ejs templating engine, set up the views folder and home.ejs, and configure a route to serve the home page on localhost 2000.
Discover how to reduce redundancy in multi-page apps by using a templating engine and a boilerplate layout, enabling reusable navigation and shared page structure across routes.
Organize ejs files by creating a partials folder for shared components, add a nav bar partial, and include it across pages like home and about using the include directive.
Learn to style a web page with Bootstrap, pick a boilerplate, and serve Bootstrap assets via Express—locally from a public folder or through the Bootstrap CDN.
Learn how to scaffold routes and build a bootstrap-styled signup flow with express, router, and a mongoose user model, including email validation and user creation.
Create a signup page rendered in a Bootstrap layout, using a signup folder, Bootstrap form controls, a nav bar, and CSS, then redirect to Procopio after signup.
Build a sign-up flow using express session, express flash, and cookie-parser to show validation errors and success messages, handle duplicates, and redirect users.
Explore how cookies and sessions manage user state in web apps. Use a cookie to store a session id on the browser while the server keeps the session data.
Create a config folder with separate files to store port numbers, database info, and secret keys, export them, and integrate the passport library for sessions.
Implement a login feature using express-session with a mongo store and cookie handling, configure passport local strategy, and serialize sessions to manage user authentication.
Master user authentication in a Node.js and MongoDB app by implementing passport local login, sessions, and flash messages, with routes for login and profile and redirects upon success or failure.
Fix navigation bar and authentication flow with a passport-based login, add a global user middleware, and implement sign up, log in, and logout routes.
Clean up the home page and enforce a consistent layout, remove boilerplate, and refine navigation; implement Gravatar-based profile pictures and a profile page, with signup redirecting to the profile.
Add the edit profile feature with get and post routes, load the current user, update name and address, validate the address input, flash messages, and redirect to the profile page.
Lay down mongoose-based category and product models, defining category name fields and product fields with an object id reference to category, enabling population and testing with fake data.
Add admin routes to create product categories by rendering an add category page and posting new category data to the database, with flash messages and error handling.
Create and test a category page with ejs, set up and export the router, and manage categories in the database with an admin-only security layer.
Add a middleware that loads all categories from the category model and stores them in res.locals.categories to render a dynamic navbar in the Node.js MongoDB app.
Explore asynchronous control flow in Node.js using the async library to orchestrate dependent MongoDB queries with callbacks, implementing a waterfall pattern for reliable, predictable data handling.
Learn to build a product data API using faker to seed a MongoDB database, create routes, and wire an Express server for an Amazon clone.
Create a new products route to render fake product data from MongoDB, use route parameters and object id based queries, and populate category details for display on the category page.
Build a category page with EJS, loop through products to display items by category, update the navbar with category links, and verify routes using postman.
Create a single product page by adding a route that queries MongoDB for a product by id and renders its name, price, and images.
install elasticsearch on mac using xcode and homebrew, an open source search engine that relies on ruby; start the server and prepare to add a search feature to the website.
Add the Mongoosastic library to the product schema to bridge MongoDB with Elasticsearch. Configure a localhost Elasticsearch server on port 9200, create mappings, and synchronize product data.
Learn to implement a search feature in a Node.js MongoDB app by building a get route, handling queries, and rendering a dynamic search results page with a top search box.
Implement a login-protected products page with a nine-item-per-page pagination, using skip and limit in mongoose, and count total documents to render page navigation.
Develop an instant search feature for products by building a search api powered by MongoDB, add a live search input, and prepare results for ajax integration in future steps.
Drive live search with ajax by typing in a designated input field, sending the search term to a server API, and updating the page with results without a full reload.
Learn to implement instant search by typing triggers ajax post requests to an api, parse json results, and dynamically render and clean up search results in the e-commerce interface.
Define and implement the cart schema by creating a cart model with user and product references, a default total of 0, and an items array detailing quantity and price.
Modify the signup route to create and attach a cart to every new user, linking the cart to the user id during signup.
Create a cart quantity middleware and cart model, update the nav bar to show the cart item count, and compute totals by looping items with mongoose FindOne to identify owner.
Create a node.js post route to add a product to a user's cart, parse request body price, update items and total, save to database, and redirect to the cart page.
Learn to modify the product.ejs page to add a functional add-to-cart flow with plus/minus quantity controls, passing product id, quantity, and price to the server, with login validation.
Learn to implement plus and minus buttons that mutate quantity and price, parse and format the price, and validate minimum quantity for a cart flow.
Create and wire a cart route in the node.js app, including a router and post/get handlers, populating items from product IDs and returning the cart data.
Create a cart page by iterating the cart object, displaying each item with image, name, and quantity, and showing the total price.
Add a remove feature to the cart to let users delete items, update the total, and show a success message after removal.
Set up Stripe payments in the Amazon clone, configure API keys, install the Stripe library, create a payment route, obtain a client-side token, and charge the user in USD.
Continue building the Amazon clone by integrating a Stripe payment button, modal dialogs, and form inputs with Bootstrap components in the Node.js and MongoDB stack.
Build a complete Stripe payment flow by creating a custom Stripe form, handling tokens and errors, and wiring server-side processing to charge customers and update cart and payment history.
Modify the payment route to push purchased items to the user history, update the cart and total, and clear the cart after a successful Stripe payment.
Add a loading spinner to the payment form to show processing during checkout. The next video introduces a history feature to display past purchases from the database.
Modify the profile route to populate the user's history items, protect the profile with a passport middleware, and redirect unauthenticated users to login, preparing the profile page to display history.
Modify the user profile to add a history page that displays purchased items, their names and prices in a dynamic table from the user history.
Configure Facebook login for a Node.js app by creating a Facebook app, obtaining the app ID and app secret, and setting the website platform to localhost:3000.
Configure facebook login on the node side with a secret object for app id and app secret. Use process.env, set localhost callback, and fetch email and display name via middleware.
Learn to add a Facebook login middleware with Passport by configuring the Facebook strategy, handling tokens and profile data, and saving or finding users in the database.
Set up routes to initiate and handle Facebook login with Passport, configure scope for email and profile, implement the callback, and redirect to profile or login on success or failure.
Integrate Facebook login by adding Bootstrap social buttons and Font Awesome CDN, wire up the login route to redirect to profile or failure, and test the sign-in flow.
Modify the passport facebook middleware to create a new user and a linked car, using a two-callback waterfall to pass the user id to mongodb.
Have you ever wondering on how to build your next Revolutionary Ecommerce Web application?
This course will teach you step by step on how to clone an Amazon website with the latest cutting edge technology and that is Node.js
You will use Javascript on both the backend and frontend of the web application.
Live is too short to depend on someone else, if you are still waiting for that one amazing technical co-founder to help you on building your web app, then I suggest you instead of waiting , its better for you to do it yourself.
Every code that will be written by me, will be explained in details. So you do not need to worry about not understanding certain algorithm.
If you are ready to embark on this journey on building an Ecommerce web application, then what are you waiting for? Lets get into it!