├── .gitignore ├── client ├── public │ ├── robots.txt │ ├── images │ │ ├── banner.jpg │ │ ├── img-signin-bkg.jpg │ │ └── img-signup-bkg.jpg │ └── index.html ├── src │ ├── redux │ │ ├── constants │ │ │ ├── filterConstants.js │ │ │ ├── loadingConstants.js │ │ │ ├── categoryConstants.js │ │ │ ├── cartConstants.js │ │ │ ├── orderConstants.js │ │ │ ├── messageConstants.js │ │ │ └── productConstants.js │ │ ├── actions │ │ │ ├── messageActions.js │ │ │ ├── orderActions.js │ │ │ ├── cartActions.js │ │ │ ├── filterActions.js │ │ │ ├── categoryActions.js │ │ │ └── productActions.js │ │ ├── reducers │ │ │ ├── filterReducers.js │ │ │ ├── loadingReducers.js │ │ │ ├── categoryReducers.js │ │ │ ├── messageReducers.js │ │ │ ├── cartReducers.js │ │ │ ├── productReducers.js │ │ │ └── orderReducers.js │ │ └── store.js │ ├── components │ │ ├── NotFound.js │ │ ├── UserDashboard.js │ │ ├── UserRoute.js │ │ ├── AdminRoute.js │ │ ├── AdminHeader.js │ │ ├── App.css │ │ ├── AdminBody.js │ │ ├── AdminDashboard.js │ │ ├── AdminActionBtns.js │ │ ├── CheckoutForm.js │ │ ├── PlaceOrder.js │ │ ├── ProgressBar.js │ │ ├── App.js │ │ ├── Product.js │ │ ├── Payment.js │ │ ├── Card.js │ │ ├── Home.js │ │ ├── AdminCategoryModal.js │ │ ├── Shop.js │ │ ├── Shipping.js │ │ ├── Header.js │ │ ├── Signin.js │ │ ├── Cart.js │ │ ├── Signup.js │ │ ├── AdminProductModal.js │ │ └── AdminEditProduct.js │ ├── api │ │ ├── product.js │ │ ├── category.js │ │ └── auth.js │ ├── helpers │ │ ├── cookies.js │ │ ├── message.js │ │ ├── localStorage.js │ │ ├── auth.js │ │ └── loading.js │ ├── index.js │ ├── data │ │ └── usaStates.js │ └── serviceWorker.js ├── .gitignore ├── package.json ├── README.md └── .eslintcache ├── uploads ├── 1608677405799.jpg ├── 1616620605480.jpg ├── 1629832518493.jpg ├── 1629832554601.jpg ├── 1629832588006.jpg ├── 1629832620039.jpg ├── 1633705481294.jpg └── 1633706637575.jpg ├── config ├── keys.js └── prod.js ├── routes ├── filter.js ├── category.js ├── payment.js ├── auth.js └── product.js ├── middleware ├── multer.js ├── authenticator.js └── validator.js ├── models ├── Category.js ├── User.js └── Product.js ├── controllers ├── payment.js ├── category.js ├── filter.js ├── auth.js └── product.js ├── database └── db.js ├── server.js ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | dev.js 3 | 4 | -------------------------------------------------------------------------------- /client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /client/src/redux/constants/filterConstants.js: -------------------------------------------------------------------------------- 1 | export const GET_NEW_ARRIVALS = 'GET_NEW_ARRIVALS'; 2 | -------------------------------------------------------------------------------- /uploads/1608677405799.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1608677405799.jpg -------------------------------------------------------------------------------- /uploads/1616620605480.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1616620605480.jpg -------------------------------------------------------------------------------- /uploads/1629832518493.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1629832518493.jpg -------------------------------------------------------------------------------- /uploads/1629832554601.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1629832554601.jpg -------------------------------------------------------------------------------- /uploads/1629832588006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1629832588006.jpg -------------------------------------------------------------------------------- /uploads/1629832620039.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1629832620039.jpg -------------------------------------------------------------------------------- /uploads/1633705481294.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1633705481294.jpg -------------------------------------------------------------------------------- /uploads/1633706637575.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/uploads/1633706637575.jpg -------------------------------------------------------------------------------- /client/public/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/client/public/images/banner.jpg -------------------------------------------------------------------------------- /client/public/images/img-signin-bkg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/client/public/images/img-signin-bkg.jpg -------------------------------------------------------------------------------- /client/public/images/img-signup-bkg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jalvaradoas39/restaurant-tutorial/HEAD/client/public/images/img-signup-bkg.jpg -------------------------------------------------------------------------------- /client/src/redux/constants/loadingConstants.js: -------------------------------------------------------------------------------- 1 | export const START_LOADING = 'START_LOADING'; 2 | export const STOP_LOADING = 'STOP_LOADING'; 3 | -------------------------------------------------------------------------------- /client/src/redux/constants/categoryConstants.js: -------------------------------------------------------------------------------- 1 | export const GET_CATEGORIES = 'GET_CATEGORIES'; 2 | export const CREATE_CATEGORY = 'CREATE_CATEGORY'; 3 | -------------------------------------------------------------------------------- /config/keys.js: -------------------------------------------------------------------------------- 1 | if (process.env.NODE_ENV === 'production') { 2 | module.exports = require('./prod.js'); 3 | } else { 4 | module.exports = require('./dev.js'); 5 | } 6 | -------------------------------------------------------------------------------- /client/src/components/NotFound.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const NotFound = () => { 4 | return
Inside NotFound component
; 5 | }; 6 | 7 | export default NotFound; 8 | -------------------------------------------------------------------------------- /client/src/redux/constants/cartConstants.js: -------------------------------------------------------------------------------- 1 | export const ADD_TO_CART = 'ADD_TO_CART'; 2 | export const DELETE_FROM_CART = 'DELETE_FROM_CART'; 3 | export const CLEAR_CART = 'CLEAR_CART'; 4 | -------------------------------------------------------------------------------- /client/src/components/UserDashboard.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const UserDashboard = () => { 4 | return48 | Price:{' '} 49 | {product.productPrice.toLocaleString('en-US', { 50 | style: 'currency', 51 | currency: 'USD', 52 | })} 53 |
54 |55 | Status:{' '} 56 | {product.productQty <= 0 57 | ? 'Out of Stock' 58 | : 'In Stock'} 59 |
60 |61 | Description: {product.productDesc} 62 |
63 | 70 |38 | {product.productQty <= 0 ? 'Out of Stock' : 'In Stock'} 39 |
40 |41 | {product.productDesc.length > 60 42 | ? product.productDesc.substring(0, 60) + '...' 43 | : product.productDesc.substring(0, 60)} 44 |
45 | {adminPage && ( 46 | <> 47 | 52 | 53 | Edit 54 | 55 | 65 | > 66 | )} 67 | 68 | {homePage && ( 69 | <> 70 | 75 | View Product 76 | 77 | 85 | > 86 | )} 87 || 70 | | Product | 71 |Price | 72 |Quantity | 73 |Remove | 74 |
|---|---|---|---|---|
|
80 | {' '}
81 | |
90 | 91 | {' '} 92 | 95 | {product.productName} 96 | 97 | | 98 |99 | {' '} 100 | {product.productPrice.toLocaleString( 101 | 'en-US', 102 | { 103 | style: 'currency', 104 | currency: 'USD', 105 | } 106 | )} 107 | | 108 |109 | 115 | handleQtyChange( 116 | e, 117 | product 118 | ) 119 | } 120 | /> 121 | | 122 |123 | {' '} 124 | 137 | | 138 |
146 | {cart.length === 1 147 | ? '(1) Item' 148 | : `(${cart.length}) Items`} 149 |
150 |151 | Total: $ 152 | {cart 153 | .reduce( 154 | (currentSum, currentCartItem) => 155 | currentSum + 156 | currentCartItem.count * 157 | currentCartItem.productPrice, 158 | 0 159 | ) 160 | .toFixed(2)} 161 |
162 | 168 |{JSON.stringify(formData)}
*/} 209 |