- 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
-
React
-
Products Component
- Create data.json {products:[{_id, title, ...}]
- Update App.js to import data.json
- Create components/Products.js component
-
Filter Component
- Create components/Filter.js
- Add it above Products component in App.js
- Update Filter.js render
- App.js
- Add Filter Component
-
Cart Component
- Set Active Task Management Spreadsheet
- Product.js
- App.js
- Create addToCart(product)
- Slice, Check product existance, add to cartitems
- Cart.js
- index.css
-
Add Modal and Animation
- Set Active Task Management Spreadsheet
- Create branch animation-modal
- Show Animation
- Install react-reveal
- Create fade effect from bottom for products
- Create fade left for add to cart
- Create fade right for show checkout form
- Open Modal by click on product image
- Install react-modal
- Products.js
- Import Modal
- Set state for product to null
- Define openModal and closeModal
- Show Modal if product exist
- Create Modal
- Create zoom effect for modal
- index.css
- Style Product Details
-
-
Node.JS
- Create Products Backend
- Install nodemon globally
- Add server.js
- Install express body-parser mongoose shortid
- Install MongoDB
- app = express()
- app.use(bodyParser.json())
- mongoose.connect()
- create Product model
- app.post("/api.products")
- route.get("/api/products")
- route.delete("/api/products/:id")
- Create Products Backend
-
Redux
-
Add Redux
- npm install redux react-redux redux-thunk
- create types
- types.js
- actions/productActions.js
- create reducers
- reducers/productReducers.js
- create store
- store.js
- import redux
- combine reducers
- Use store
- App.js
- import store
- wrap all in Provider
- connect products
- components/Products.js
- connect to store
- import fetchProducts
- fetch products on did mount
- package.json
- set proxy to http://127.0.0.1:5000
- npm run server
- check products list
-
Add Redux To Filter
- actions/productActions.js
- create filterProducts
- create sortProducts
- reducers/productReducers.js
- Filter.js
- App.js
- remove Filter props
-
Add Redux To Cart
- actions/cartActions.js
- create addToCart
- create removeFromCart
- reducers/cartReducers.js
- Cart.js
- Product.js
- App.js
- remove Cart props
- store.js
- set initial cartItems to localStorage
-
-
Advanced Topics
-
Create Order
- Backend
- server.js
- create order modal
- get /api/orders
- post /api/orders
- delete /api/orders/:id
- Frontend
- create types
- types.js
- actions/orderActions.js
- create reducers
- reducers/orderReducers.js
- Update Cart Component
- components/Cart.js
-
Manage Orders
-
Add new page
-
Install react-router-dom
-
App.js
-
Import BrowserRouter, Route, Link
-
Route path="/admin" component={AdminScreen}
-
Route path="/" exact={true} component={HomeScreen}
-
HomeScreen.js
-
-
AdminScreen.js
-
components/Orders.js
-
Backend
-
server.js
-
app.get("/api/orders")
-
app.delete("/api/orders/:id")
-
Frontend
-
types.js
-
actions/orderActions.js
-
fetchOrders()
-
reducers/orderReducers.js
-
components/Orders.js
-
table orders
-
index.css
-
-