ECommerce-Mern
eCommerce
JavaScript
ECommerce-Mern
Lessons
- Creat React App
- Create Git Repository
-
List Products
- create products arry
- add product images
- render products
- style products
-
Add routing
- npm i react-router-dom
- create router for home screen
- create router for product screen
-
Create Node.JS Server
- run npm init in root folder
- Update package.json set type: module
- Add .js to imports
- npm install express
- create server.js
- add start command as node backend/server.js
- require express
- create route for / return backend is ready.
- move products.js from frontend to backend
- create rotue for /api/products
- return products
- run npm start
-
Fetch Products from Backend
- set proxy in package.json
- npm install axios
- use state hook
- use effect hook
- use reducer hook
-
Manage State By Reducer Hook
- define reducer
- upadate fetch data
- get state from useReducer
-
Add bootstrap UI Framwork
- npm install react-bootstrap bootstrap
- update App.js
-
Create Product and Rating Component
- create Rating component
- Create Product component
- Use Rating Component in Product component
-
Create Product Detail Screen
- fetch Product Detail Screen
- create 3 columns for image, info and action
-
Creat Loading and Message Component
- create loading component
- use spinner component
- create message component
- create utils .js to define getError function
-
Implement Add To Cart
- Create React Context
- define reducer
- create store provider
- implement add to cart button click hnadler
-
Complete Add To cart
- check exist item in the cart
- check count in stock in backend
-
Create Cart Screen
- create 2 columns
- display items list
- create action column
-
Complete Cart Screen
- click handler for inc/dec item
- click handler for remove item
- click handler for checkout
-
Create Signin Screen
- creat sign in form
- add email and password
- add signin button
-
Connect To MongoDB Database
- create atlas mongodb database
- install local mongodb database
- npm install mongoose
- connect to mongodb database
-
Seed Sample Data
- create Product Model
- create User Model
- create seed Route
- use route in server.js
- seed sample product
-
Seed Sample Users
- create user model
- seed sample users
- create user routes
-
Creat Signin Backend API
- create signin api
- npm install jsonwebtoken
- define generateToken
-
Complete Signin Screen
- handle submit action
- save token in store and local storage
- show user name in header
-
Create Shipping Screen
- create form inputs
- handle save shipping address
- add checkout wizard bar
-
Create Sign Up Screen
- create input forms
- handle submit
- create backend api
-
Implement Select Payment Method Screen
- create input forms
- handle submit
-
Create Place Order Screen
- show cart items, payment and address
- handle place order action
- create order create api
-
Implement Place Order Action
- handle place order action
- create order create api
-
Create Order Screen
- create backend api for order/:id
- fetch order api in frontend
- show order information in 2 cloumns
-
Pay Order By PayPal
- generate paypa client id
- create api to return client id
- install react-paypal-js
- use PayPalScriptProvider in index.js
- use usePayPalScriptReducer in Order Screen
- implement loadPaypalScript function
- render paypal button
- implement on Approve payment function
- create pay order api in backend