• Stars
    star
    211
  • Rank 186,867 (Top 4 %)
  • Language
    JavaScript
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React Redux Tutorial - Build ECommerce Shopping Cart In 5 Hours

Build ECommerce Shopping Cart by React & Redux 2020 Edition

Demo: https://reactredux-shoppingcart.herokuapp.com/

Get 90% Discount On This Course At Udemy

What you’ll learn

  • Design Shopping Cart Using HTML and CSS
  • Implement React Components For Product List, Filter, Cart
  • Managing Component State using Redux, React-Redux and - Redux-Thunk
  • Creating Animations Using React-Reveal and Add Routes using React-Routers
  • Build Backend using Node, Express, MongoDB and Mongoose
  • Publish Project on the Heroku and MongoDB Atlas

Are there any course requirements or prerequisites?

  • Basic HTML and CSS
  • Basic JavaScript

Who this course is for:

  • Javascript developers
  • Web Developers
  • Freelancers
  • Programming Students

Table Of Content

  1. Introduction

    1. Introduction
      1. Fully-Functional Shopping Cart
      2. Instant Feedback
      3. Animated and Intuitive Design
      4. List Products
      5. Sort Products By Price High or Low
      6. Filter Products by Size
      7. Open Modal By Click on Product
      8. Add Product To Cart using Animation
      9. Handle Multiple Click By Adding More Items
      10. Remove Product
      11. Show Checkout Form
      12. Create Order with user friendly id
      13. Admin Section to see list of products
      14. Using postman to add or remove products and orders
    2. Tools and Technologies
      1. JavaScript (arrow functions, array functions, spread Operators, ...)
      2. React (react-touter-dom, react-reveal, react-modal)
      3. Redux (react-redux, redux-thunk)
      4. Node (express, body-parser, Environment Variables, nodemon)
      5. MongoDB ( mongoose, shortid)
      6. VS Code (ES6 Snippets, ES7 React Extension, ESLint Extension,CSS Peek)
      7. Chrome ( React Developer Tools, Redux Developer Tools)
      8. Git (create repo, commit, remote, create and push branch)
      9. Github (create repo, connect to local repo, pull request and merge)
      10. Postman ( send get, post, put and delete requests to apis)
      11. Deployment ( Heroku, MongoDB Atlas Cloud)
    3. Create React App
      1. Open VS Code and open terminal
      2. cd Desktop
      3. npx create-react-app react-shopping-cart
      4. Remove unused files
      5. Convert App.js Class Component
      6. Add header, main and footer
      7. Update index.css to add grid
    4. Project Development Workflow
      1. Create Google Spreadsheet
      2. Add columns Feature, Description, State, and Duration
      3. Enter Products Component, Show list of products, Open, 2
      4. Add Time ? Hours, Rate 30 USD/Hours, Cost ? USD
      5. Add All Features
      6. Create Github account
      7. Create new repository
      8. Add it as remote repository in VS Code
      9. Commit changes
      10. Push changes on github
      11. Start => create new feature Feature 1 in google spreadsheet
      12. Create a new branch feature-1 for test the workflow
      13. Add "// branch feature 1" in App.js Line 1
      14. Commit with message "feature 1"
      15. Click publish changes
      16. Open repository page on github
      17. Create pull request
      18. Merge pull request
      19. In VS Code switch to master and Sync changes
      20. End => Loop from step 11 for next feature
  2. React

    1. Products Component
      1. Create data.json {products:[{_id, title, ...}]
      2. Update App.js to import data.json
      3. div.content {flex, wrap}
      4. div.main {flex: 3 60rem}
      5. div.sidebar {flex: 1 20rem;}
      6. Create components/Products.js component
      7. Add it to div.main in App.js and set products props
      8. ul.products {flex,center, center,warp, p:0,m:0, style:none}
      9. this.props.products.map(p => li.key={p._id} {flex, p:1, m:1, none,h:47}
      10. div.product { flex, column, space-between, h:100%}
      11. a href="#" > img {max-width, max-height:37} + p {p.title}
      12. div.product-price > div.product.price + button.button.primary Add to cart
      13. product-price {flex, space-between, center}
      14. div {p.price} flex: 1; align: center; size: 2rem
      15. button.button.primary Add To Cart
    2. Filter Component
      1. Create components/Filter.js
      2. Add it above Products component in App.js
      3. Update Filter.js render
      4. div.filter {flex, wrap, p,m:1rem, border-bottom: .1rem}
      5. filter-result {this.props.filteredProducts.length}
      6. filter-sort {flex:1}
      7. label Order select value=this.props.sort
      8. onChange= this.props.sortProducts(e.t.value)
      9. option lowestprice Lowest, ...
      10. filter-size {flex:1}
      11. label Filter select value=this.props.size
      12. onChange= this.props.filterProducts(e.t.value)
      13. option "" ALL, XS, S, M, L, XL, XXL
      14. App.js
      15. Add Filter Component
    3. Cart Component
      1. Set Active Task Management Spreadsheet
      2. Create branch cart-component
      3. Product.js
      4. Handle "Add To Cart" to this.props.addToCart(product)
      5. App.js
      6. Add cartItems to state as []
      7. Create addToCart(product)
      8. Slice, Check product existance, add to cartitems
      9. Cart.js
      10. Define cartItems from this.props
      11. Check cartItems.length and show message
      12. List cartItems {cartItems.length > 0 && (}
      13. index.css
      14. Style cart, cart-header, cart-items (img, li),
      15. Publish changes
      16. Pull request, merge, change to master
      17. Task Management Spreadsheet set it done
    4. Checkout Form
      1. Set Active Task Management Spreadsheet
      2. Create branch checkout-form
      3. Cart.js
      4. Make cart items persistent
      5. Use LocalStorage on App constructor to load cart items (JSON.parse)
      6. Use LocalStorage on addToCart to save cart items (JSON.stringify)
      7. Handle Click on Proceed
      8. Update showCheckout state to true on click
      9. Conditional rendering Checkout Form
      10. Get Email, Name and Address required input
      11. Define handleInput function
      12. Add Checkout Button
      13. Handle onSubmit Form Event by this.createOrder
      14. Create order object and pass to parent to handle it
      15. Commit and Publish changes
      16. Pull request, merge, change to master
      17. Task Management Spreadsheet set it done
    5. Add Modal and Animation
      1. Set Active Task Management Spreadsheet
      2. Create branch animation-modal
      3. Show Animation
      4. Install react-reveal
      5. Create fade effect from bottom for products
      6. Create fade left for add to cart
      7. Create fade right for show checkout form
      8. Open Modal by click on product image
      9. Install react-modal
      10. Products.js
      11. Import Modal
      12. Set state for product to null
      13. Define openModal and closeModal
      14. Show Modal if product exist
      15. Create Modal
      16. Create zoom effect for modal
      17. index.css
      18. Style Product Details
      19. Commit and Publish changes
      20. Pull request, merge, change to master
      21. Task Management Spreadsheet set it done
  3. Node.JS

    1. Create Products Backend
      1. Install nodemon globally
      2. Add server.js
      3. Install express body-parser mongoose shortid
      4. Install MongoDB
      5. app = express()
      6. app.use(bodyParser.json())
      7. mongoose.connect()
      8. create Product model
      9. app.post("/api.products")
      10. Postman send post request
      11. route.get("/api/products")
      12. route.delete("/api/products/:id")
  4. Redux

    1. Add Redux
      1. what is redux (diagram)
      2. update task on spreadsheet
      3. create branch add-redux-products
      4. npm install redux react-redux redux-thunk
      5. create types
      6. types.js
      7. define FETCH_PRODUCTS
      8. actions/productActions.js
      9. declare fetchProducts
      10. create reducers
      11. reducers/productReducers.js
      12. define case FETCH_PRODUCTS
      13. create store
      14. store.js
      15. import redux
      16. set initial state
      17. define initialState
      18. create store
      19. import productReducers
      20. combine reducers
      21. Use store
      22. App.js
      23. import store
      24. wrap all in Provider
      25. connect products
      26. components/Products.js
      27. connect to store
      28. import fetchProducts
      29. fetch products on did mount
      30. package.json
      31. set proxy to http://127.0.0.1:5000
      32. npm run server
      33. check products list
      34. commit and publish
      35. send pull request and merge
      36. update spreadsheet
    2. Add Redux To Filter
      1. Updte task and branch
      2. types.js
      3. create FILTER_PRODUCTS_BY_SIZE
      4. create ORDER_PRODUCTS_BY_PRICE
      5. actions/productActions.js
      6. create filterProducts
      7. move app.js filterProducts logic here
      8. create sortProducts
      9. move app.js filterProducts logic here
      10. reducers/productReducers.js
      11. case FILTER_PRODUCTS_BY_SIZE
      12. case ORDER_PRODUCTS_BY_PRICE
      13. Filter.js
      14. connect props: size, sort, items and filteredItems
      15. connect actions: filterProducts and sortProducts
      16. show loading if no filteredProducts
      17. App.js
      18. remove Filter props
      19. check result
      20. update task and branch
    3. Add Redux To Cart
      1. Updte task and branch
      2. types.js
      3. create ADD_TO_CART
      4. create REMOVE_FROM_CART
      5. actions/cartActions.js
      6. create addToCart
      7. create removeFromCart
      8. reducers/cartReducers.js
      9. case ADD_TO_CART
      10. case REMOVE_FROM_CART
      11. Cart.js
      12. connect props: cartItems
      13. connect actions: removeFromCart
      14. Product.js
      15. add action addToCart
      16. App.js
      17. remove Cart props
      18. store.js
      19. set initial cartItems to localStorage
      20. check result
      21. update task and branch
  5. Advanced Topics

    1. Create Order
      1. Backend
      2. server.js
      3. create order modal
      4. get /api/orders
      5. post /api/orders
      6. delete /api/orders/:id
      7. Frontend
      8. create types
      9. types.js
      10. CLEAR_ORDER, CLEAR_CART, CREATE_ORDER
      11. create actions
      12. actions/orderActions.js
      13. createOrder(order)
      14. clearOrder()
      15. create reducers
      16. reducers/orderReducers.js
      17. case CREATE_ORDER
      18. case CLEAR_ORDER
      19. Update Cart Component
      20. components/Cart.js
      21. connect order, createOrder, clearOrder
      22. form onSubmit={this.createOrder}
      23. createOrder() this.props.createOrder(order)
      24. closeModal() this.props.clearOrder()
      25. render()
      26. const { cartItems, order } = this.props;
      27. {order && (}
    2. Manage Orders
      1. Add new page
      2. Install react-router-dom
      3. App.js
      4. Import BrowserRouter, Route, Link
      5. render()
      6. BrowserRouter
      7. Route path="/admin" component={AdminScreen}
      8. Route path="/" exact={true} component={HomeScreen}
      9. HomeScreen.js
      10. AdminScreen.js
      11. components/Orders.js
      12. render()
        Orders
      13. Backend
      14. server.js
      15. app.get("/api/orders")
      16. app.delete("/api/orders/:id")
      17. Frontend
      18. types.js
      19. FETCH_ORDERS
      20. actions/orderActions.js
      21. fetchOrders()
      22. reducers/orderReducers.js
      23. case FETCH_ORDERS {orders: action.payload}
      24. components/Orders.js
      25. connect orders, fetchOrders
      26. componentDidMount() fetchOrders
      27. render()
      28. !orders
        Loading...
      29. table orders
      30. index.css
      31. style orders
  6. Deploy Website

    1. Create MongoDB Cloud Database
    2. Login to https://www.mongodb.com/cloud
    3. Add database user
    4. Left sidebar> Select Security > Database Access
    5. Select Add New User button
    6. Enter user name and password and click Add User
    7. Add IP whitelist
    8. Left sidebar > Select Security > Network Access
    9. Select Add IP Address
    10. Enter 0.0.0.0/0 in Whitelist Entry and click Confirm
    11. Get connection string
    12. Left sidebar > Select Altas > Cluster
    13. Click Connect
    14. Click Connect to your application
    15. Click Copy button
    16. Step 2: Deploy On Heroku
    17. Create git repository in amazona folder using git init
    18. Create Heroku Account at heroku.com
    19. Heroku
    20. Create Heroku account on heroku.com
    21. Install Heroku cli https://devcenter.heroku.com/articles/heroku-cli
    22. Open Terminal
    23. heroku login
    24. heroku apps:create react-shopping-cart-best
    25. Edit package.json
    26. "engines": { "node": "12.4.0", "npm": "6.9.0"}
    27. Create Procfile
    28. web: node server.js
    29. Set MongoDB connection string in Heroku
    30. Open Heroku apps https://dashboard.heroku.com/apps/
    31. Select your apps, open Setting Tab and click Reveal Config Vars
    32. Add key MONGODB_URL
    33. Enter copied connection string from the previous step
    34. Update database name and username and password
    35. Add key NODE_MODULES_CACHE and value false
    36. app.use("/", express.static(__dirname + "/build"));
    37. app.get("/", (req, res) => res.sendFile(__dirname + "/build/index.html"));
    38. git add . && git commit -m "publish"
    39. git push heroku

More Repositories

1

node-react-ecommerce

Build ECommerce Website Like Amazon By React & Node & MongoDB
JavaScript
1,674
star
2

amazona

Build Ecommerce Like Amazon By MERN Stack
JavaScript
597
star
3

mern-amazona

Build Ecommerce Like Amazon By MERN Stack
JavaScript
327
star
4

next-amazona

JavaScript
289
star
5

next-tailwind-amazona

Build Ecommerce Like Amazon By NEXT JS
JavaScript
234
star
6

node-javascript-ecommerce

Build ECommece Like Amazon Using Vanilla JS
JavaScript
214
star
7

ecommerce-shopping-cart

Learn React & Redux From 0 to 100 in this course
JavaScript
140
star
8

react-course-final

JavaScript
68
star
9

next-amazona-v2

TypeScript
67
star
10

next-pg-shadcn-ecommerce

TypeScript
63
star
11

sanity-amazona

JavaScript
57
star
12

ts-mern-amazona

TypeScript
54
star
13

react-google-login

JavaScript
26
star
14

self-order-kiosk-final

JavaScript
20
star
15

nextjs-shopping-cart-like-amazon

JavaScript
19
star
16

tic-tac-toe

React.js Tic Tac Toe Game in 30 Minutes
JavaScript
18
star
17

next-15-admin-dashboard

TypeScript
17
star
18

support-desk-app

JavaScript
15
star
19

ts-mern-amazona-final

TypeScript
15
star
20

angular-amazona-final

TypeScript
14
star
21

coolshop

JavaScript
13
star
22

google-one-tap-login-app

JavaScript
12
star
23

next-amazona-2

JavaScript
10
star
24

coolshop-final

JavaScript
10
star
25

amazona-final

JavaScript
10
star
26

node-react-ecommerce-final

An ECommerce Website Like Amazon
JavaScript
8
star
27

nextjs-amazona-final

JavaScript
8
star
28

new-amazona-final

JavaScript
7
star
29

react-awesome-blog-final

JavaScript
7
star
30

basir.github.io

Basir Jafarzadeh Portfolio Website
HTML
7
star
31

mern-marketplace-final

JavaScript
6
star
32

react-advanced-app

JavaScript
6
star
33

react-basic-app

JavaScript
6
star
34

ssr-shopping-cart

JavaScript
6
star
35

razorpay-app

JavaScript
6
star
36

node-javascript-ecommerce-final

JavaScript
6
star
37

nextjs-ecommerce-final

JavaScript
6
star
38

react-shopping-cart-final

Get 90% Discount on this udemy course
JavaScript
6
star
39

sanity-next-amazona-final

JavaScript
5
star
40

vue-food-delivery-final

Vue
5
star
41

react-tic-tac-toe

Learn React basics and reducer hooks by creating a game
JavaScript
5
star
42

react-18-shopping-cart

JavaScript
5
star
43

self-order-kiosk

JavaScript
5
star
44

next-admin-products-netlify

TypeScript
5
star
45

angular-amazona

TypeScript
4
star
46

mern-marketplace

JavaScript
4
star
47

react-table-app

react-table in action
JavaScript
4
star
48

food-delivery-app-final

Vue
4
star
49

small-shopping-cart

JavaScript
4
star
50

amazona-app

JavaScript
4
star
51

react-awesome-blog

JavaScript
4
star
52

react-todo-app

JavaScript
3
star
53

react-google-login-app-final

JavaScript
3
star
54

nextjs-tailwind-amazona-final

JavaScript
3
star
55

basir-portfolio

HTML
3
star
56

ecommerce-tools

3
star
57

shopping-cart-next-rtk-query

JavaScript
3
star
58

support-desk-react-socket-io-final

JavaScript
3
star
59

amazona-in

JavaScript
2
star
60

sonnet-18

JavaScript
2
star
61

next-netlify-starter

JavaScript
2
star
62

my-app

JavaScript
1
star
63

react-node-send-email

JavaScript
1
star
64

the-modern-javascript-course

JavaScript
1
star
65

next-amazona-app

1
star
66

next-server-actions-admin-products

TypeScript
1
star