
Introduce building a full stack MERN e-commerce app for a beauty store. Learn to implement product search, cart, login, banner management, and Stripe checkout, plus admin analytics and automated emails.
Set up a complete MERN e-commerce project by outlining front end, back end, admin, and background services, and initialize the backend with a new folder using Node.js and VSCode.
Install nodemon globally and configure dotenv to manage the port, then enable express.json and establish a MongoDB Atlas connection via env variables for the full stack app.
Initialize git and a GitHub repo, configure gitignore, push backend code, create and switch to a backend branch, and continue modeling MongoDB data.
Create a user model with mongoose by defining a user schema, exporting it by default, with fields like name, email, password, address, role default user, and status default 0.
Create a banner model by defining a banner schema with title, subtitle, and image fields using mongoose, mark them as required, enable timestamps, and export the banner model.
Create a Mongoose order schema with name, userId, products, total, address, phone, email, and a default zero status with timestamps; export the model and note progression from zero to three.
Create a product model with a mongoose schema, defining fields such as title, description, image, price, in stock, and ratings for a mern e-commerce app.
Create a custom error handler in express with middleware for not found and mongo cast errors, and export it for centralized backend error handling, with development debugging support.
Generate a jwt for user id, sign with an env secret, set expiration, and store token in a cookie with httpOnly, secure, sameSite strict, and max age via cookie parser.
Design a public login controller for a MERN app: post to /api/v1/oauth/login, verify email and password with matchPassword, generate a token, and return user data or a generic error.
Create a register function in the authentication controller that checks for existing users, hashes the password, saves the user, generates a token stored in a cookie, and returns user details.
Learn to implement a logout controller in a MERN app by clearing the JWT cookie, setting httpOnly options, and exposing a post route with proper routing.
Test backend authentication using Postman by registering and logging in users, inspecting responses, cookies, and jwt tokens, and validating custom error handling in development.
Develop a comprehensive product controller in Node.js, implementing create, update, delete, and get operations, plus get all products and rating features with async handler support.
Create a comprehensive user controller with create, update, get, and delete functions, implement password encryption with bcrypt, and configure express routes for all user operations.
Create and wire the order controller and routes for a MERN app, including create, update, delete, and get orders, plus get user orders, with async handler integration and MongoDB persistence.
Create and export an auth middleware that verifies a JWT from cookies to protect routes, attach the user to the request, and selectively protect orders while leaving products accessible.
Build a reusable send mail function with node mailer and dotenv, configure a Gmail transporter, verify the connection, and send messages using robust options and error handling.
Explore email templates in the MERN e-commerce app, using EJS-enabled HTML templates, passing data like products and logos, and integrating with background services and sendmail functions.
Create a background email service that templates and sends welcome emails using EJS, dot env, and a reusable send mail function, updating users from status zero to sent.
Develop a pending order email service that fetches orders with status zero and sends a pending order notification using the pending order template, then updates to status one.
learns to implement background services that send delivered order emails using a delivered order template and a status workflow moving orders from 0 to 1 to 2 and 3.
Create a promotion email service that runs on a schedule to send promotional emails to all users by sampling five products and rendering a promotional EJS template.
Set up the frontend by installing React with Vite and configuring Tailwind CSS, then initialize and run the front-end project for the MERN app.
Create a multipage react application with react router dom, building home, cart, and my account pages, and a shared layout with navbar, footer, and outlet.
Create an announcement component across pages and animate it with a react simple typewriter, showcasing promo messages. Style with tailwind and follow a basic git workflow to commit and push.
Build a navbar for the front end of the ecommerce app, featuring a logo, search bar, cart with badge, and login status, styled with tailwind css and icons.
Create a banner component with a background image, dark overlay, and text plus two buttons for shop now and call number to enhance the home page.
Create a category component for the home page, styling three horizontally aligned categories with background images, overlay shading, and centered white text using a flex layout.
Create a product component to display image, title, price, and a star rating using react-star-rating, and style with flex wrap for a responsive MERN e-commerce grid.
Create a footer component for a MERN e-commerce app, including logo, tagline, quick links, contact details, and social media icons. Implement a gray upper section with a pink divider.
Adjust the products component to swap product images via props, apply a 30px margin for even spacing, and prepare prop validation for the upcoming product detail and add-to-cart features.
Build a product detail page in a MERN app by routing to fetch a product by id and presenting a layout with image, details, add-to-cart, quantity controls, and reviews.
Build a dynamic cart page with React Router Dom links, display cart items, and show an order summary with subtotal, shipping, total, and a proceed to checkout button.
Create a front-end product list page with filters for price, concerns, popular brands, and skin type, plus a price sort option, using JSX components.
Register and build the order page in the front end, connect it as my orders, and implement a checkout flow with authentication and stripe payment.
Create a left side menu with icons and text, using a flex column layout, 350px width, 100vh height, gray background, and hover effects for navigation items.
Build a responsive dashboard by creating stats cards and arranging left and right panels, using Material UI to render charts, graphs, and key metrics like products, orders, users, and revenue.
Create a latest transactions table with customer, amount, and status in a styled white card. Add a right-side panel with color-coded status, total revenue, total losses, and a graph.
Finish the admin home page by creating a revenue card with a gray background, padding, shadow, and rounded corners, and integrate a line chart with Material UI charts.
Set up and align admin dashboard pages in a MERN app, create product, orders, users, and banners pages, and implement navigation with react router dom links.
Replicate the product page to build an admin users page, importing a data grid and dummy user data, configuring columns with icons, and displaying id, name, email, and phone.
Create the orders page for the MERN app by wiring a data grid with dummy data, define columns, import react icons, and render status for pending and delivered orders.
Learn how to push code to GitHub from the admin branch, commit changes for the users and products pages, and manage banners and orders in a MERN full-stack project.
Create a banners page in the master MERN project, combining a left pane of active banners with a right pane for uploading new banners by title, subtitle, and image.
Create and wire up new product and detailed product pages, add nested routes for the admin dashboard, and enable product creation, editing, and updating in a MERN app.
Create a new product page in the admin dashboard using a responsive, two-column form. Include inputs for product image, name, description, pricing (original, discounted, wholesale), brand, and category selects.
Create a detailed product page in the admin dashboard, using a three parts layout, a product form, image upload, and a card showing pricing and stock.
Embark on an exciting journey to build a fully functional e-commerce platform from scratch using the powerful MERN stack (MongoDB, Express.js, React, Node.js)! This comprehensive series is designed for developers of all levels who want to master full-stack development while creating a feature-rich application.
Our series is divided into four engaging parts, each covering a crucial aspect of building an e-commerce platform:
1. Frontend Development
Bring your platform to life with a sleek and responsive user interface using React. Learn to:
Design captivating pages with modern UI techniques.
Use React Router DOM for seamless navigation.
Create dynamic product listings, detailed pages, and interactive features.
2. Backend Development
Build a powerful and secure backend using Node.js and Express.js. Dive into:
Structuring APIs for efficient communication.
Implementing authentication and user management.
Managing data storage with MongoDB.
3. Background Services
Go beyond the basics and automate essential operations with scalable services:
Schedule email notifications for promotions and orders.
Implement background jobs for reminders and system updates.
Build reusable helpers to simplify complex tasks.
4. Admin Dashboard
Take control of your platform with an intuitive admin interface:
Manage products, users, and orders with ease.
Leverage DataGrid for advanced data management.
Visualize key analytics with real-time charts and insights.