-
Design Website Template
- Create amazona folder
- Create template folder
- Create index.html
- add default HTML code
- link to style.css
- create header, main and footer
- style elements
-
Display Products
- create products div
- add product attributes
- add link, image, name and price
-
Create React App
- npx create-react-app frontend
- npm start
- Remove unused files
- copy index.html content to App.js
- copy style.css content to index.css
- replace class with className
-
Share Code On Github
-
Create Rating and Product Component
- create components/Rating.js
- create div.rating
- style div.rating, span and last span
- create Product component
- use Rating component
-
Build Product Screen
- Install react-router-dom
- Use BrowserRouter and Route for Home Screen
- Create HomeScreen.js
- Add product list code there
- Create ProductScreen.js
- Add new Route from product details to App.js
- Create 3 columns for product image, info and action
-
Create Node.Js Server
- run npm init in root folder
- update package.json set type: module
- Add .js to imports
- npm i 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 route for /api/products
- return products
- run npm start
-
Load Product From Backend
- edit HomeScreen.js
- define products, loading and error
- create useEffect
- define async fetchData and call it
- install axios
- get data from /api/products
- show them in the list
- create Loading Component
- create Message Box Component
- use them in HomeScreen
-
Install ESLint
- install VSCode eslint extension
- npm i -D eslint
- run ./node_modules/.bin/eslint --init
- create ./frontend/.env
- add SKIP_PREFLIGHT_CHECK=true
-
Add Redux To Home Screen
- npm install redux react-redux
- create store.js
- initState = { product: [] }
- reducer = (state, action) => switch LOAD_PRODUCTS: {products: action.payload}
- export default createStore(reducer, initState)
- edit HomeScreen.js
- shopName = useSelector(state => state.products)
- const dispatch = useDispatch()
- useEffect(() => dispatch({type: LOAD_PRODUCTS, payload: data}))
- add store to index.js
- Add Redux To Product Screen
- create product details constants, actions and reducers
- add reducer to store.js
- use action in ProductScreen.js
- add /api/product/:id to backend api
- Handle Add To Cart Button
- Handle Add to Cart in ProductScreen.js
- create CartScreen.js
- Implement Add To Cart
- create addToCart constants, actions and reducers
- add reducer to store.js
- use action in CartScreen.js
- render cartItems.length
- Build Cart Screen
- create 2 columns for cart items and cart action
- cartItems.length === 0 ? cart is empty
- show item image, name, qty and price
- proceed to checkout button
- implement remove from cart action
- Implement Remove From Cart
- create removeFromCart constants, actions and reducers
- add reducer to store.js
- use action in CartScreen.js
- Create Sample Users In MongoDB
- npm i mongoose
- connect to mongodb
- create config.js
- npm i dotenv
- export MONNGODB_URL
- create models/userModel.js
- create userSchema and userModel
- create models/productModel.js
- create productShcema and productModel
- create userRoute
- seed sample data
- Create Sample Products In MongoDB
- create models/productModels.js
- create productSchema and productModel
- create productRoute
- Seed sample data
- Create Signin Backend
- create /signin api
- check email and password
- generate token
- install json web token
- install dotenv
- return token and data
- test it using postman
- Design Signin Screen
- create SigninScreen
- render email and password fields
- create signin constants, actions and reducers
- update Header based on user login
- Implement Signin Action
- create signin constants, actions, and reducers
- add reducer to store.js
- use action in SigninScreen.js
- Create Register Screen
- create API for /api/users/register
- insert new user to database
- return user info and token
- create RegisterScreen
- add fields
- style fields
- add screen to App.js
- Create Shipping Screen
- create CheckoutSteps.js component
- create shipping fields
- implement shipping constant, actions, and reducers
- Create Payment Screen
- create payment fields
- implement shipping constantm actions and reducers
- Design Place Order Screen
- design order summary fields
- design order action
- Create Place Order API
- createOrder api
- create orderModel
- create orderRouter
- create post order route
- Implement Place Order Action
- handle place order button click
- create place order constants, action and reducer
- Create Order Screen
- build order api for /api/orders/:id
- create OrderScreen.js
- dispatch order details action in useEffect
- load data with useSelector
- show data like place order screen
- create order details constants, action and reducer
- Add PayPal button
- get client id from paypal
- set it in .env file
- create route form /api/paypal/clientId
- create getPaypalClientID in api.js
- add paypal checkout script in OrderScreen.js
- show paypal button
- Implement Order Payment
- Display Order History
- Display User Profile
- Update User Profile
- Creat Admin View