Hosted at https://my-amazona-app.herokuapp.com/
- Introduction to this course
- what you will build
- what you will learn
- who are audiences
- Install Tools
- Code Editor
- Web Browser
- VS Code Extension
- 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
- Initialize git repository
- Commit changes
- Create github account
- Create repo on github
- connect local repo to github repo
- push changes to 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 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 route for /api/products
- return products
- run npm start
- Load Products 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 For Code Linting
- install VSCode eslint extension
- npm install -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= {products:[]}
- 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