├── .gitignore ├── README.md ├── client ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── images │ │ ├── IndianTandooriChickenTikka.jpg │ │ ├── cheesepepperoni.jpg │ │ ├── chicken_golden_delight.jpg │ │ ├── farmhouse.jpg │ │ ├── logo.png │ │ ├── margherita.jpg │ │ └── veggie_paradise.jpg │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt ├── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── actions │ │ ├── cartAction.js │ │ ├── orderAction.js │ │ ├── pizzaAction.js │ │ └── userAction.js │ ├── components │ │ ├── About.jsx │ │ ├── Admin │ │ │ ├── AddNewPizza.jsx │ │ │ ├── EditPizza.jsx │ │ │ ├── OrderList.jsx │ │ │ ├── Pizzaslist.jsx │ │ │ └── Userlist.jsx │ │ ├── Checkout.jsx │ │ ├── Contact.jsx │ │ ├── Error.jsx │ │ ├── Filters.jsx │ │ ├── Loader.jsx │ │ ├── NavBar.jsx │ │ ├── Pizza.jsx │ │ ├── Policy.jsx │ │ ├── Success.jsx │ │ └── TopBar.jsx │ ├── index.css │ ├── index.js │ ├── pizza-data.js │ ├── reducers │ │ ├── cartReducer.js │ │ ├── orderReducer.js │ │ ├── pizzaReducer.js │ │ └── userReducer.js │ ├── screens │ │ ├── AdminScreen.jsx │ │ ├── CartScreen.jsx │ │ ├── HomeScreen.jsx │ │ ├── Login.jsx │ │ ├── OrderScreen.jsx │ │ └── Registe.jsx │ └── store.js └── yarn.lock ├── config └── config.js ├── data └── pizza-data.js ├── models ├── orderModel.js ├── pizzaModel.js └── userModel.js ├── package-lock.json ├── package.json ├── routes ├── orderRoute.js ├── pizzaRoute.js └── userRoutes.js ├── seeder.js └── server.js /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | client/node_modules 6 | /.pnp 7 | .pnp.js 8 | 9 | # testing 10 | /coverage 11 | 12 | # production 13 | /build 14 | 15 | # misc 16 | .DS_Store 17 | .env 18 | .env.local 19 | .env.development.local 20 | .env.test.local 21 | .env.production.local 22 | 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pizza-shop-mern-stack-app 2 | #complete Project Code 3 | #watch Videos on 4 | https://www.youtube.com/techinfoyt 5 | 6 | -watch complete videos to build and deloye 7 | -also if you want to learn somthing 8 | -else fork download and use it 9 | -dont forget give credit 10 | -you can add youtube channel name or link 11 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `yarn test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `yarn build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `yarn eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | 48 | ### Code Splitting 49 | 50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) 51 | 52 | ### Analyzing the Bundle Size 53 | 54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) 55 | 56 | ### Making a Progressive Web App 57 | 58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) 59 | 60 | ### Advanced Configuration 61 | 62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) 63 | 64 | ### Deployment 65 | 66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) 67 | 68 | ### `yarn build` fails to minify 69 | 70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) 71 | -------------------------------------------------------------------------------- /client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "proxy": "http://localhost:8080", 4 | "version": "0.1.0", 5 | "private": true, 6 | "dependencies": { 7 | "@testing-library/jest-dom": "^5.11.4", 8 | "@testing-library/react": "^11.1.0", 9 | "@testing-library/user-event": "^12.1.10", 10 | "axios": "^0.21.1", 11 | "bootstrap": "^5.0.2", 12 | "react": "^17.0.2", 13 | "react-bootstrap": "^1.6.1", 14 | "react-dom": "^17.0.2", 15 | "react-icons": "^4.2.0", 16 | "react-redux": "^7.2.4", 17 | "react-router-bootstrap": "^0.25.0", 18 | "react-router-dom": "^5.2.0", 19 | "react-scripts": "4.0.3", 20 | "react-stripe-checkout": "^2.6.3", 21 | "redux": "^4.1.1", 22 | "redux-devtools-extension": "^2.13.9", 23 | "redux-thunk": "^2.3.0", 24 | "sweetalert": "^2.1.2", 25 | "web-vitals": "^1.0.1" 26 | }, 27 | "scripts": { 28 | "start": "react-scripts start", 29 | "build": "react-scripts build", 30 | "test": "react-scripts test", 31 | "eject": "react-scripts eject" 32 | }, 33 | "eslintConfig": { 34 | "extends": [ 35 | "react-app", 36 | "react-app/jest" 37 | ] 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.2%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 1 chrome version", 47 | "last 1 firefox version", 48 | "last 1 safari version" 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /client/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/apple-touch-icon.png -------------------------------------------------------------------------------- /client/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/favicon-16x16.png -------------------------------------------------------------------------------- /client/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/favicon-32x32.png -------------------------------------------------------------------------------- /client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/favicon.ico -------------------------------------------------------------------------------- /client/public/images/IndianTandooriChickenTikka.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/IndianTandooriChickenTikka.jpg -------------------------------------------------------------------------------- /client/public/images/cheesepepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/cheesepepperoni.jpg -------------------------------------------------------------------------------- /client/public/images/chicken_golden_delight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/chicken_golden_delight.jpg -------------------------------------------------------------------------------- /client/public/images/farmhouse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/farmhouse.jpg -------------------------------------------------------------------------------- /client/public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/logo.png -------------------------------------------------------------------------------- /client/public/images/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/margherita.jpg -------------------------------------------------------------------------------- /client/public/images/veggie_paradise.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/images/veggie_paradise.jpg -------------------------------------------------------------------------------- /client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 28 | Techinfoyt- Online Pizza Shop 29 | 30 | 31 | 32 |
33 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/logo192.png -------------------------------------------------------------------------------- /client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/public/logo512.png -------------------------------------------------------------------------------- /client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /client/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techinfo-youtube/pizza-shop-mern-stack-app-cmplete-code/58c90a4c45e58d50ce9ede647e4f62c413646feb/client/src/App.css -------------------------------------------------------------------------------- /client/src/App.js: -------------------------------------------------------------------------------- 1 | import "./App.css"; 2 | import { BrowserRouter, Route, Switch } from "react-router-dom"; 3 | import TopBar from "./components/TopBar"; 4 | import About from "./components/About"; 5 | import Contact from "./components/Contact"; 6 | import Policy from "./components/Policy"; 7 | import NavBar from "./components/NavBar"; 8 | import HomeScreen from "./screens/HomeScreen"; 9 | import CartScreen from "./screens/CartScreen"; 10 | import Registe from "./screens/Registe"; 11 | import Login from "./screens/Login"; 12 | import OrderScreen from "./screens/OrderScreen"; 13 | import AdminScreen from "./screens/AdminScreen"; 14 | 15 | function App() { 16 | return ( 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ); 33 | } 34 | 35 | export default App; 36 | -------------------------------------------------------------------------------- /client/src/App.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import App from './App'; 3 | 4 | test('renders learn react link', () => { 5 | render(); 6 | const linkElement = screen.getByText(/learn react/i); 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | -------------------------------------------------------------------------------- /client/src/actions/cartAction.js: -------------------------------------------------------------------------------- 1 | export const addToCart = (pizza, quantity, varient) => (dispatch, getState) => { 2 | var cartItem = { 3 | name: pizza.name, 4 | _id: pizza._id, 5 | image: pizza.image, 6 | varient: varient, 7 | quantity: Number(quantity), 8 | prices: pizza.prices, 9 | price: pizza.prices[0][varient] * quantity, 10 | }; 11 | if (cartItem.quantity > 10) { 12 | alert("you Can only add 10 pizzas"); 13 | } else { 14 | if (cartItem.quantity < 1) { 15 | dispatch({ type: "DELETE_FROM_CART", payload: pizza }); 16 | } else { 17 | dispatch({ type: "ADD_TO_CART", payload: cartItem }); 18 | localStorage.setItem( 19 | "cartItems", 20 | JSON.stringify(getState().cartReducer.cartItems) 21 | ); 22 | } 23 | } 24 | }; 25 | 26 | export const deleteFromCart = (pizza) => (dispatch, getState) => { 27 | dispatch({ type: "DELETE_FROM_CART", payload: pizza }); 28 | const cartItems = getState().cartReducer.cartitems; 29 | localStorage.setItem("cartItems", JSON.stringify(cartItems)); 30 | }; 31 | -------------------------------------------------------------------------------- /client/src/actions/orderAction.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | export const placeOrder = (token, subTotal) => async (dispatch, getState) => { 4 | dispatch({ type: "PLACE_ORDER_REQUEST" }); 5 | const currentUser = getState().loginUserReducer.currentUser; 6 | const cartItems = getState().cartReducer.cartItems; 7 | try { 8 | await axios.post("/api/orders/placeorder", { 9 | token, 10 | subTotal, 11 | currentUser, 12 | cartItems, 13 | }); 14 | dispatch({ type: "PLACE_ORDER_SUCCESS" }); 15 | // console.log(res); 16 | } catch (error) { 17 | dispatch({ type: "PLACE_ORDER_FAIL" }); 18 | console.log(error); 19 | } 20 | }; 21 | 22 | export const getUserOrders = () => async (dispatch, getState) => { 23 | const currentUser = getState().loginUserReducer.currentUser; 24 | dispatch({ 25 | type: "USER_ORDER_REQUEST", 26 | }); 27 | try { 28 | const response = await axios.post("/api/orders/getuserorder", { 29 | userid: currentUser._id, 30 | }); 31 | // console.log(response); 32 | dispatch({ type: "USER_ORDER_SUCCESS", payload: response.data }); 33 | } catch (error) { 34 | dispatch({ type: "USER_ORDER_FAIL", payload: error }); 35 | } 36 | }; 37 | export const getAllOrders = () => async (dispatch, getState) => { 38 | // const currentUser = getState().loginUserReducer.currentUser; 39 | dispatch({ 40 | type: "ALL_ORDER_REQUEST", 41 | }); 42 | try { 43 | const response = await axios.get("/api/orders/alluserorder"); 44 | dispatch({ type: "ALL_ORDER_SUCCESS", payload: response.data }); 45 | } catch (error) { 46 | dispatch({ type: "ALL_ORDER_FAIL", payload: error }); 47 | } 48 | }; 49 | 50 | export const deliverOrder = (orderid) => async (dispatch, getState) => { 51 | // const currentUser = getState().loginUserReducer.currentUser; 52 | dispatch({ 53 | type: "GET_ALL_ORDER_REQUEST", 54 | }); 55 | try { 56 | await axios.post("/api/orders/deliverorder", { orderid }); 57 | alert("Deliverd Success"); 58 | const orders = await axios.get("/api/orders/alluserorder"); 59 | dispatch({ type: "GET_ALL_ORDER_SUCCESS", payload: orders.data }); 60 | window.location.href = "/admin/orderlist"; 61 | } catch (error) { 62 | dispatch({ type: "GET_ALL_ORDER_FAIL", payload: error }); 63 | } 64 | }; 65 | -------------------------------------------------------------------------------- /client/src/actions/pizzaAction.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import swal from "sweetalert"; 3 | export const getAllPizzas = () => async (dispatch) => { 4 | dispatch({ type: "GET_PIZZAS_REQUEST" }); 5 | try { 6 | const response = await axios.get("/api/pizzas/getAllPizzas"); 7 | // console.log(response.data); 8 | dispatch({ type: "GET_PIZZAS_SUCCESS", payload: response.data }); 9 | } catch (err) { 10 | dispatch({ type: "GET_PIZZAS_FAIL", payload: err }); 11 | } 12 | }; 13 | 14 | export const addPizza = (pizza) => async (dispatch) => { 15 | dispatch({ type: "ADD_PIZZAS_REQUEST" }); 16 | try { 17 | await axios.post("/api/pizzas/addpizza", { pizza }); 18 | dispatch({ type: "ADD_PIZZAS_SUCCESS" }); 19 | } catch (err) { 20 | dispatch({ type: "ADD_PIZZAS_FAIL", payload: err }); 21 | } 22 | }; 23 | 24 | export const getPizzaById = (pizzaId) => async (dispatch) => { 25 | dispatch({ type: "GET_PIZZABYID_REQUEST" }); 26 | try { 27 | const response = await axios.post("/api/pizzas/getpizzabyid", { pizzaId }); 28 | dispatch({ type: "GET_PIZZABYID_SUCCESS", payload: response.data }); 29 | } catch (err) { 30 | dispatch({ type: "GET_PIZZABYID_FAIL", payload: err }); 31 | } 32 | }; 33 | export const updatePizza = (updatedPizza) => async (dispatch) => { 34 | dispatch({ type: "UPDATE_PIZZABYID_REQUEST" }); 35 | try { 36 | const response = await axios.post("/api/pizzas/updatepizza", { 37 | updatedPizza, 38 | }); 39 | dispatch({ type: "UPDATE_PIZZABYID_SUCCESS", payload: response.data }); 40 | window.location.href = "/admin/pizzalist"; 41 | } catch (err) { 42 | dispatch({ type: "UPDATE_PIZZABYID_FAIL", payload: err }); 43 | } 44 | }; 45 | 46 | export const deletePizza = (pizzaId) => async (dispatch) => { 47 | try { 48 | await axios.post("/api/pizzas/deletepizza", { pizzaId }); 49 | swal("Pizza Deleted Succss!", "success"); 50 | window.location.href = "/admin/pizzalist"; 51 | // console.log(res); 52 | } catch (error) { 53 | swal("Errro While Deleteing Pizza"); 54 | } 55 | }; 56 | 57 | export const filterPizza = (searchkey, category) => async (dispatch) => { 58 | let filterdPizza; 59 | dispatch({ type: "GET_PIZZAS_REQUEST" }); 60 | try { 61 | const res = await axios.get("/api/pizzas/getAllPizzas"); 62 | filterdPizza = res.data.filter((pizza) => 63 | pizza.name.toLowerCase().includes(searchkey) 64 | ); 65 | if (category !== "all") { 66 | filterdPizza = res.data.filter( 67 | (pizza) => pizza.category.toLowerCase() === category 68 | ); 69 | } 70 | dispatch({ type: "GET_PIZZAS_SUCCESS", payload: filterdPizza }); 71 | } catch (error) { 72 | dispatch({ type: "GET_PIZZAS_FAIL", payload: error }); 73 | } 74 | }; 75 | -------------------------------------------------------------------------------- /client/src/actions/userAction.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import swal from "sweetalert"; 3 | export const registerUser = (user) => async (dispatch) => { 4 | dispatch({ type: "USER_REGISTER_REQUEST" }); 5 | try { 6 | await axios.post("/api/users/register", user); 7 | dispatch({ type: "USER_REGISTER_SUCCESS" }); 8 | } catch (error) { 9 | dispatch({ type: "USER_REGISTER_FAIL", payload: error }); 10 | } 11 | }; 12 | 13 | export const loginUser = (user) => async (dispatch) => { 14 | dispatch({ type: "USER_LOGIN_REQUEST" }); 15 | try { 16 | const response = await axios.post("/api/users/login", user); 17 | // console.log(response); 18 | dispatch({ type: "USER_LOGIN_SUCCESS", payload: response.data }); 19 | localStorage.setItem("currentUser", JSON.stringify(response.data)); 20 | window.location.href = "/"; 21 | } catch (error) { 22 | dispatch({ type: "USER_LOGIN_FAIL", payload: error }); 23 | } 24 | }; 25 | 26 | export const logoutUser = () => (dispatch) => { 27 | localStorage.removeItem("currentUser"); 28 | window.location.href = "/login"; 29 | }; 30 | 31 | export const getAllUsers = () => async (dispatch) => { 32 | dispatch({ type: "GET_USERS_REQUEST" }); 33 | try { 34 | const response = await axios.get("/api/users/getallusers"); 35 | // console.log(response.data); 36 | dispatch({ type: "GET_USERS_SUCCESS", payload: response.data }); 37 | } catch (err) { 38 | dispatch({ type: "GET_USERS_FAIL", payload: err }); 39 | } 40 | }; 41 | 42 | export const deleteUser = (userid) => async (dispatch) => { 43 | try { 44 | await axios.post("/api/users/deleteuser", { userid }); 45 | swal("User Deleted Succss!", "success"); 46 | window.location.reload(); 47 | // console.log(res); 48 | } catch (error) { 49 | swal("Errro While Deleteing User"); 50 | } 51 | }; 52 | -------------------------------------------------------------------------------- /client/src/components/About.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Container, Row, Col } from "react-bootstrap"; 3 | 4 | const About = () => { 5 | return ( 6 | <> 7 | 8 |

Whoe we are

9 |

10 | Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nisi eveniet 11 | unde vel dignissimos. Cum minima iste quaerat sequi, eum aspernatur 12 | dignissimos magni impedit repudiandae, quidem laudantium accusamus 13 | modi, ipsa quae! Facilis ducimus vero saepe illo consectetur. 14 | Assumenda vel, temporibus voluptatibus possimus eaque beatae 15 | distinctio excepturi eos sint dolore ut architecto iure doloribus 16 | debitis similique impedit culpa alias voluptatum ab magni odio quia. 17 | Suscipit in tempore alias aut nemo minus velit commodi perspiciatis 18 | molestias unde doloremque placeat officia quaerat fuga nisi modi vitae 19 | consequuntur, illum harum dolore asperiores at illo itaque! Accusamus 20 | sed cumque, quo veniam iure aperiam quod dolorem, unde magnam nobis 21 | ullam repudiandae repellat! Cumque, beatae explicabo totam quae 22 | incidunt voluptates sit nisi aspernatur tenetur rerum molestiae 23 | assumenda in autem commodi, doloribus tempora dolor ab eligendi? Amet 24 | voluptatem expedita architecto odit possimus, aperiam commodi ullam 25 | accusantium nam magni, placeat error ipsum temporibus nihil molestias 26 | a minima hic sapiente at est quae porro. Iste iusto provident, totam 27 | laborum in molestiae officia voluptatum quis fugiat ullam amet 28 | accusantium ipsam aliquid nisi quaerat a repudiandae consequatur 29 | reprehenderit. Ea itaque cupiditate vel sequi blanditiis deleniti hic 30 | ipsum eaque officiis adipisci omnis, deserunt rerum, laudantium, et 31 | impedit quos a eius soluta ut dolore esse. 32 |

33 |

Our Speciality

34 | 35 | 36 |

37 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque in 38 | quibusdam deserunt tempore enim veritatis ducimus facilis cum 39 | animi ex eius doloribus ratione illo, laborum laboriosam! 40 | Consequatur maxime placeat, voluptatum veniam quisquam deleniti 41 | laudantium repellendus rerum vitae minima dolorum, earum sapiente 42 | rem reiciendis voluptas sunt sed repudiandae eaque! Quas adipisci 43 | recusandae debitis officia delectus aliquam id harum quis 44 | consequuntur vero, iste maxime eius ullam, praesentium qui ut sit 45 | consectetur. Quis provident libero ad veniam possimus minus, nulla 46 | molestias. Sapiente ipsa amet odio at omnis natus provident 47 | eveniet nam aperiam reiciendis nostrum distinctio ea illum 48 | accusantium labore, sed quisquam, temporibus vitae. 49 |

50 | 51 | 52 |

53 | Lorem ipsum dolor sit amet consectetur adipisicing elit. 54 | Laboriosam dignissimos recusandae doloremque mollitia dolorem 55 | debitis animi. Natus tempore facere perferendis consequuntur quae 56 | temporibus dignissimos velit! Dicta aliquam sint recusandae 57 | dignissimos neque quia repellendus dolorum autem aspernatur 58 | repudiandae similique hic possimus, repellat voluptatibus 59 | architecto voluptate consectetur, amet ducimus eos fugiat 60 | asperiores. Quae maiores quis animi sit optio dicta aperiam nulla 61 | magnam quisquam rem deserunt explicabo, itaque obcaecati iste. Eum 62 | corrupti voluptas veritatis neque sunt recusandae temporibus 63 | maiores, mollitia facilis repudiandae magni ipsum iste, voluptates 64 | ratione rerum quo dolorem aut impedit omnis reiciendis dolores 65 | nam. Accusamus ratione sapiente minima vero ex consequatur. 66 |

67 | 68 |
69 | 70 |

Our Cheif

71 | 72 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nulla 73 | libero adipisci aliquid veniam. Incidunt sequi nesciunt rerum 74 | accusamus! Adipisci rerum earum ex eos quos consectetur distinctio 75 | nisi, sapiente, dignissimos facere harum reiciendis? Velit 76 | laudantium vero aspernatur illum veniam iusto consectetur, facilis 77 | excepturi amet exercitationem deleniti, sed assumenda minima! Rerum, 78 | eveniet. 79 | 80 | 81 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nulla 82 | libero adipisci aliquid veniam. Incidunt sequi nesciunt rerum 83 | accusamus! Adipisci rerum earum ex eos quos consectetur distinctio 84 | nisi, sapiente, dignissimos facere harum reiciendis? Velit 85 | laudantium vero aspernatur illum veniam iusto consectetur, facilis 86 | excepturi amet exercitationem deleniti, sed assumenda minima! Rerum, 87 | eveniet. 88 | 89 | 90 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nulla 91 | libero adipisci aliquid veniam. Incidunt sequi nesciunt rerum 92 | accusamus! Adipisci rerum earum ex eos quos consectetur distinctio 93 | nisi, sapiente, dignissimos facere harum reiciendis? Velit 94 | laudantium vero aspernatur illum veniam iusto consectetur, facilis 95 | excepturi amet exercitationem deleniti, sed assumenda minima! Rerum, 96 | eveniet. 97 | 98 | 99 | Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nulla 100 | libero adipisci aliquid veniam. Incidunt sequi nesciunt rerum 101 | accusamus! Adipisci rerum earum ex eos quos consectetur distinctio 102 | nisi, sapiente, dignissimos facere harum reiciendis? Velit 103 | laudantium vero aspernatur illum veniam iusto consectetur, facilis 104 | excepturi amet exercitationem deleniti, sed assumenda minima! Rerum, 105 | eveniet. 106 | 107 |
108 |
109 | 110 | ); 111 | }; 112 | 113 | export default About; 114 | -------------------------------------------------------------------------------- /client/src/components/Admin/AddNewPizza.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Form, Row, Col, Button } from "react-bootstrap"; 3 | import { addPizza } from "../../actions/pizzaAction"; 4 | import { useDispatch, useSelector } from "react-redux"; 5 | import Loader from "./../Loader"; 6 | import Error from "./../Error"; 7 | import Success from "./../Success"; 8 | const AddNewPizza = () => { 9 | const [name, setname] = useState(""); 10 | const [smallPrice, setsmallPrice] = useState(); 11 | const [largprice, setlargprice] = useState(); 12 | const [mediumPrice, setmediumPrice] = useState(); 13 | const [image, setimage] = useState(""); 14 | const [description, setdescription] = useState(""); 15 | const [category, setcategory] = useState(""); 16 | 17 | const addPizzaState = useSelector((state) => state.addPizzaReducer); 18 | const { loading, error, success } = addPizzaState; 19 | 20 | const dispatch = useDispatch(); 21 | 22 | const submitForm = (e) => { 23 | e.preventDefault(); 24 | const pizza = { 25 | name, 26 | image, 27 | description, 28 | category, 29 | prices: { 30 | small: smallPrice, 31 | medium: mediumPrice, 32 | larg: largprice, 33 | }, 34 | }; 35 | dispatch(addPizza(pizza)); 36 | }; 37 | return ( 38 |
39 | {loading && } 40 | {error && } 41 | {success && } 42 |
43 | 44 | 45 | Name 46 | setname(e.target.value)} 50 | placeholder="Enter email" 51 | /> 52 | 53 | 54 | 55 | Small Price 56 | setsmallPrice(e.target.value)} 60 | placeholder="Enter Small Price" 61 | /> 62 | 63 | 64 | 65 | Medium Price 66 | setmediumPrice(e.target.value)} 70 | placeholder="Enter medium price" 71 | /> 72 | 73 | 74 | 75 | Larg Price 76 | setlargprice(e.target.value)} 80 | placeholder="Enter larg price" 81 | /> 82 | 83 | 84 | 85 | Image 86 | setimage(e.target.value)} 90 | placeholder="Add Image URL" 91 | /> 92 | 93 | 94 | 95 | 96 | Description 97 | setdescription(e.target.value)} 101 | placeholder="Enter Description" 102 | /> 103 | 104 | 105 | 106 | Category 107 | setcategory(e.target.value)} 111 | placeholder="Enter Category" 112 | /> 113 | 114 | 115 | 118 |
119 |
120 | ); 121 | }; 122 | 123 | export default AddNewPizza; 124 | -------------------------------------------------------------------------------- /client/src/components/Admin/EditPizza.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { Form, Row, Col, Button } from "react-bootstrap"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { getPizzaById, updatePizza } from "../../actions/pizzaAction"; 5 | import Loader from "./../Loader"; 6 | import Error from "./../Error"; 7 | 8 | const EditPizza = ({ match }) => { 9 | const [name, setname] = useState(""); 10 | const [smallPrice, setsmallPrice] = useState(); 11 | const [largprice, setlargprice] = useState(); 12 | const [mediumPrice, setmediumPrice] = useState(); 13 | const [image, setimage] = useState(""); 14 | const [description, setdescription] = useState(""); 15 | const [category, setcategory] = useState(""); 16 | const dispatch = useDispatch(); 17 | const getPizzaByState = useSelector((state) => state.getPizzaByIdReducer); 18 | const { error, pizza } = getPizzaByState; 19 | const updatePizzaState = useSelector((state) => state.updatePizzaByIdReducer); 20 | const { updateloading } = updatePizzaState; 21 | useEffect(() => { 22 | if (pizza) { 23 | if (pizza._id === match.params.pizzaId) { 24 | setname(pizza.name); 25 | setdescription(pizza.description); 26 | setcategory(pizza.category); 27 | setimage(pizza.image); 28 | setsmallPrice(pizza.prices[0]["small"]); 29 | setmediumPrice(pizza.prices[0]["medium"]); 30 | setlargprice(pizza.prices[0]["large"]); 31 | } else { 32 | dispatch(getPizzaById(match.params.pizzaId)); 33 | } 34 | } else { 35 | dispatch(getPizzaById(match.params.pizzaId)); 36 | } 37 | }, [pizza, dispatch, match.params.pizzaId]); 38 | const submitForm = (e) => { 39 | e.preventDefault(); 40 | const updatedPizza = { 41 | _id: match.params.pizzaId, 42 | name, 43 | image, 44 | description, 45 | category, 46 | prices: { 47 | small: smallPrice, 48 | medium: mediumPrice, 49 | larg: largprice, 50 | }, 51 | }; 52 | dispatch(updatePizza(updatedPizza)); 53 | }; 54 | return ( 55 |
56 | {updateloading && } 57 | {error && } 58 | {/* {success && } */} 59 |
60 | 61 | 62 | Name 63 | setname(e.target.value)} 67 | placeholder="Enter email" 68 | /> 69 | 70 | 71 | 72 | Small Price 73 | setsmallPrice(e.target.value)} 77 | placeholder="Enter Small Price" 78 | /> 79 | 80 | 81 | 82 | Medium Price 83 | setmediumPrice(e.target.value)} 87 | placeholder="Enter medium price" 88 | /> 89 | 90 | 91 | 92 | Larg Price 93 | setlargprice(e.target.value)} 97 | placeholder="Enter larg price" 98 | /> 99 | 100 | 101 | 102 | Image 103 | setimage(e.target.value)} 107 | placeholder="Add Image URL" 108 | /> 109 | 110 | 111 | 112 | 113 | Description 114 | setdescription(e.target.value)} 118 | placeholder="Enter Description" 119 | /> 120 | 121 | 122 | 123 | Category 124 | setcategory(e.target.value)} 128 | placeholder="Enter Category" 129 | /> 130 | 131 | 132 | 135 |
136 |
137 | ); 138 | }; 139 | 140 | export default EditPizza; 141 | -------------------------------------------------------------------------------- /client/src/components/Admin/OrderList.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { deliverOrder, getAllOrders } from "./../../actions/orderAction"; 4 | import { Table, Button } from "react-bootstrap"; 5 | import Loader from "./../Loader"; 6 | import Error from "./../Error"; 7 | const OrderList = () => { 8 | const allOrdersState = useSelector((state) => state.allUserOrdersReducer); 9 | const { loading, orders, error } = allOrdersState; 10 | const dispatch = useDispatch(); 11 | useEffect(() => { 12 | dispatch(getAllOrders()); 13 | }, [dispatch]); 14 | return ( 15 |
16 |

Order Lists

17 | {loading && } 18 | {error && } 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | {orders && 32 | orders.map((order) => ( 33 | 34 | 35 | 36 | 37 | 38 | 39 | 56 | 57 | ))} 58 | 59 |
Order IdEmailUser IDAmountDateStatus
{order._id}{order.email}{order.transectionId}Rs {order.orderAmount}/-{order.createdAt.substring(0, 10)} 40 | {" "} 41 | {order.isDeliverd ? ( 42 |
Deliverd
43 | ) : ( 44 | <> 45 | 53 | 54 | )}{" "} 55 |
60 |
61 | ); 62 | }; 63 | 64 | export default OrderList; 65 | -------------------------------------------------------------------------------- /client/src/components/Admin/Pizzaslist.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { AiFillEdit, AiFillDelete } from "react-icons/ai"; 4 | import { Table } from "react-bootstrap"; 5 | import { deletePizza, getAllPizzas } from "../../actions/pizzaAction"; 6 | import Loader from "../../components/Loader"; 7 | import Error from "../../components/Error"; 8 | import { Link } from "react-router-dom"; 9 | 10 | const Pizzaslist = () => { 11 | const dispatch = useDispatch(); 12 | const pizzastate = useSelector((state) => state.getAllPizzaReducer); 13 | const { loading, pizzas, error } = pizzastate; 14 | console.log(pizzas); 15 | useEffect(() => { 16 | dispatch(getAllPizzas()); 17 | }, [dispatch]); 18 | return ( 19 | <> 20 | {loading ? ( 21 | 22 | ) : error ? ( 23 | Error while fetching pizzas {error} 24 | ) : ( 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {pizzas && 38 | pizzas.map((pizza) => ( 39 | 40 | 48 | 49 | 56 | 57 | 69 | 70 | ))} 71 | 72 |
ImagePizza NamePricesCategoryAction
41 | logo 47 | {pizza.name} 50 | Small : {pizza.prices[0]["small"]} 51 |
52 | Medium : {pizza.prices[0]["medium"]} 53 |
54 | Large : {pizza.prices[0]["large"]} 55 |
{pizza.category} 58 | 59 | 60 | 61 |   62 | { 65 | dispatch(deletePizza(pizza._id)); 66 | }} 67 | /> 68 |
73 |
74 | )} 75 | 76 | ); 77 | }; 78 | 79 | export default Pizzaslist; 80 | -------------------------------------------------------------------------------- /client/src/components/Admin/Userlist.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import { useDispatch, useSelector } from "react-redux"; 3 | import { AiFillDelete } from "react-icons/ai"; 4 | import { Table } from "react-bootstrap"; 5 | import { deleteUser, getAllUsers } from "../../actions/userAction"; 6 | import Loader from "./../Loader"; 7 | import Error from "./../Error"; 8 | 9 | const Userlist = () => { 10 | const userState = useSelector((state) => state.getAllUsersReducer); 11 | const { loading, error, users } = userState; 12 | const dispatch = useDispatch(); 13 | useEffect(() => { 14 | dispatch(getAllUsers()); 15 | }, [dispatch]); 16 | return ( 17 |
18 |

User List

19 | {loading && } 20 | {error && } 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | {users && 32 | users.map((user) => ( 33 | 34 | 35 | 36 | 37 | 45 | 46 | ))} 47 | 48 |
User IDNameEmailDelete
{user._id}{user.name}{user.email} 38 | { 41 | dispatch(deleteUser(user._id)); 42 | }} 43 | /> 44 |
49 |
50 | ); 51 | }; 52 | 53 | export default Userlist; 54 | -------------------------------------------------------------------------------- /client/src/components/Checkout.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Button } from "react-bootstrap"; 3 | import StripeCheckout from "react-stripe-checkout"; 4 | import { useDispatch, useSelector } from "react-redux"; 5 | import { placeOrder } from "../actions/orderAction"; 6 | import Loader from "./Loader"; 7 | import Error from "./Error"; 8 | import Success from "./Success"; 9 | const Checkout = ({ subTotal }) => { 10 | const orderState = useSelector((state) => state.placeOrderReducer); 11 | const { loading, error, success } = orderState; 12 | const dispatch = useDispatch(); 13 | const tokenHandler = (token) => { 14 | dispatch(placeOrder(token, subTotal)); 15 | console.log(token); 16 | }; 17 | return ( 18 | <> 19 | {loading && } 20 | {error && } 21 | {success && } 22 | 29 | 30 | 31 | 32 | ); 33 | }; 34 | 35 | export default Checkout; 36 | -------------------------------------------------------------------------------- /client/src/components/Contact.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Container, Row, Col, Table, Image } from "react-bootstrap"; 3 | import { FiPhoneCall } from "react-icons/fi"; 4 | import { ImMobile } from "react-icons/im"; 5 | import { AiOutlineMail } from "react-icons/ai"; 6 | const Contact = () => { 7 | return ( 8 | <> 9 | 10 | 11 | 12 |

Techinfo YT Pizza Shop

13 |

14 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolores, 15 | nostrum magni voluptatem perferendis dolorum nisi architecto 16 | maxime voluptas exercitationem. Omnis, iure laudantium eveniet 17 | voluptas corrupti deserunt minima. Omnis dolore unde, esse magnam 18 | animi nesciunt velit impedit eveniet voluptates beatae libero 19 | laboriosam soluta dolorem odio delectus nisi suscipit quaerat 20 | repudiandae ratione? Cum fugit inventore porro, ipsum quas 21 | voluptas? Optio assumenda ut rem totam ea, sequi consequuntur eos 22 | magnam asperiores fugiat repudiandae dolor rerum praesentium a 23 | deleniti doloribus exercitationem officiis odio iure quis minus 24 | omnis quisquam cumque aperiam. Dolorum sed fugit voluptates vel 25 | quia sit molestias. Voluptas sint at maxime saepe, fuga 26 | exercitationem incidunt eveniet esse laudantium itaque dolores 27 | reiciendis nihil quia iste minus minima quas ut doloremque 28 | delectus reprehenderit quo voluptate molestiae omnis earum. Nemo 29 | corporis possimus, ea animi quis ipsam, dolorem facere eum sint 30 | adipisci aperiam odit repellendus inventore qui eius magnam cumque 31 | iste, sit maiores iusto modi distinctio reiciendis. Voluptatem 32 | omnis nam iste culpa, a pariatur facere debitis mollitia impedit 33 | ea, similique iusto veritatis ab. Eum sint possimus facilis 34 | praesentium nostrum iure voluptatem, explicabo dolorum, illum 35 | maxime corrupti itaque esse aspernatur voluptates, in officiis 36 | temporibus obcaecati. Sunt ad velit beatae deserunt ab iure 37 | veritatis modi dolorum? Quisquam, reiciendis iusto. 38 |

39 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | 49 | 50 | 53 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 67 | 68 | 69 | 70 | 71 |
44 | --- Contact Details --- 45 |
51 | 52 | Phone0123-456789
58 | 59 | Call1234567890
65 | 66 | EmailHelp@urdomain.com
72 | 73 | 74 | 78 | 79 |
80 |
81 | 82 | ); 83 | }; 84 | 85 | export default Contact; 86 | -------------------------------------------------------------------------------- /client/src/components/Error.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Alert } from "react-bootstrap"; 3 | const Error = ({ error }) => { 4 | return {error}; 5 | }; 6 | 7 | export default Error; 8 | -------------------------------------------------------------------------------- /client/src/components/Filters.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Form, Col, Row, Button } from "react-bootstrap"; 3 | import { useDispatch } from "react-redux"; 4 | import { filterPizza } from "../actions/pizzaAction"; 5 | const Filters = () => { 6 | const [searchkey, setsearchkey] = useState(""); 7 | const [category, setcategory] = useState("all"); 8 | const dispatch = useDispatch(); 9 | return ( 10 |
11 |
12 | 13 | 14 | setsearchkey(e.target.value)} 17 | placeholder="serach pizza" 18 | /> 19 | 20 | 21 | 30 | 31 | 32 | 39 | 40 | 41 |
42 |
43 | ); 44 | }; 45 | 46 | export default Filters; 47 | -------------------------------------------------------------------------------- /client/src/components/Loader.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Spinner } from "react-bootstrap"; 3 | 4 | const Loader = () => { 5 | return ; 6 | }; 7 | 8 | export default Loader; 9 | -------------------------------------------------------------------------------- /client/src/components/NavBar.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Navbar, Nav, Container, Image, NavDropdown } from "react-bootstrap"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { LinkContainer } from "react-router-bootstrap"; 5 | import { logoutUser } from "../actions/userAction"; 6 | const NavBar = () => { 7 | const dispatch = useDispatch(); 8 | const cartState = useSelector((state) => state.cartReducer); 9 | const userState = useSelector((state) => state.loginUserReducer); 10 | const { currentUser } = userState; 11 | return ( 12 | <> 13 | 14 | 15 | 16 | logo 21 | 22 | 23 | 24 | 56 | 57 | 58 | 59 | 60 | ); 61 | }; 62 | 63 | export default NavBar; 64 | -------------------------------------------------------------------------------- /client/src/components/Pizza.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Card, Button, Row, Col, Modal } from "react-bootstrap"; 3 | import { useDispatch } from "react-redux"; 4 | import { addToCart } from "../actions/cartAction"; 5 | 6 | const Pizza = ({ pizza }) => { 7 | const [varient, setVarient] = useState("small"); 8 | const [quantity, setQuantity] = useState(1); 9 | const [show, setShow] = useState(false); 10 | 11 | const dispatch = useDispatch(); 12 | 13 | const addToCartHandler = () => { 14 | dispatch(addToCart(pizza, quantity, varient)); 15 | }; 16 | 17 | const handleClose = () => setShow(false); 18 | const handleShow = () => setShow(true); 19 | 20 | return ( 21 | <> 22 | 23 | 29 | 30 | 31 | {pizza.name} 32 |
33 | 34 | 35 | 36 |
Varients
37 | 45 | 46 | 47 |
Quantity
48 | 58 | 59 |
60 |
61 | 62 | Price : {pizza.prices[0][varient] * quantity} /-RS 63 | 64 | 70 | 71 | 72 |
73 |
74 | 75 | {/* modal */} 76 | 77 | 78 | {pizza.name} 79 | 80 | 81 |
82 | 87 |
88 |
89 |
Description :
90 |
{pizza.description}
91 |
92 |
93 |
94 | 95 | ); 96 | }; 97 | 98 | export default Pizza; 99 | -------------------------------------------------------------------------------- /client/src/components/Policy.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Container, Row, Col } from "react-bootstrap"; 3 | 4 | const Policy = () => { 5 | return ( 6 | <> 7 | 8 |

Terms and policy

9 | 10 | 11 |
12 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum, 13 | praesentium? 14 |
15 |

16 | Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam 17 | officia nemo unde neque iusto minima reiciendis vitae nam deserunt 18 | qui nulla rem voluptas, non velit earum, corrupti delectus sint! 19 | Quibusdam quam aliquam eveniet molestias fuga assumenda culpa at, 20 | temporibus tempore perspiciatis repellat architecto iste 21 | aspernatur repellendus quaerat reprehenderit libero excepturi iure 22 | nisi! Ipsum unde voluptatibus repellendus provident esse aliquam 23 | labore, inventore ex autem nobis sunt. Cupiditate unde impedit 24 | ullam blanditiis quos molestias molestiae modi iusto dignissimos, 25 | sed architecto? Officiis, esse perferendis. Dolor dolores 26 | voluptates quos, officia voluptatibus nesciunt voluptatum 27 | voluptatem ipsa, minus magni, quisquam illum sit quis itaque quas. 28 |

29 |
30 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum, 31 | praesentium? 32 |
33 |

34 | Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam 35 | officia nemo unde neque iusto minima reiciendis vitae nam deserunt 36 | qui nulla rem voluptas, non velit earum, corrupti delectus sint! 37 | Quibusdam quam aliquam eveniet molestias fuga assumenda culpa at, 38 | temporibus tempore perspiciatis repellat architecto iste 39 | aspernatur repellendus quaerat reprehenderit libero excepturi iure 40 | nisi! Ipsum unde voluptatibus repellendus provident esse aliquam 41 | labore, inventore ex autem nobis sunt. Cupiditate unde impedit 42 | ullam blanditiis quos molestias molestiae modi iusto dignissimos, 43 | sed architecto? Officiis, esse perferendis. Dolor dolores 44 | voluptates quos, officia voluptatibus nesciunt voluptatum 45 | voluptatem ipsa, minus magni, quisquam illum sit quis itaque quas. 46 |

47 |
48 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum, 49 | praesentium? 50 |
51 |

52 | Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam 53 | officia nemo unde neque iusto minima reiciendis vitae nam deserunt 54 | qui nulla rem voluptas, non velit earum, corrupti delectus sint! 55 | Quibusdam quam aliquam eveniet molestias fuga assumenda culpa at, 56 | temporibus tempore perspiciatis repellat architecto iste 57 | aspernatur repellendus quaerat reprehenderit libero excepturi iure 58 | nisi! Ipsum unde voluptatibus repellendus provident esse aliquam 59 | labore, inventore ex autem nobis sunt. Cupiditate unde impedit 60 | ullam blanditiis quos molestias molestiae modi iusto dignissimos, 61 | sed architecto? Officiis, esse perferendis. Dolor dolores 62 | voluptates quos, officia voluptatibus nesciunt voluptatum 63 | voluptatem ipsa, minus magni, quisquam illum sit quis itaque quas. 64 |

65 |
66 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum, 67 | praesentium? 68 |
69 |

70 | Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam 71 | officia nemo unde neque iusto minima reiciendis vitae nam deserunt 72 | qui nulla rem voluptas, non velit earum, corrupti delectus sint! 73 | Quibusdam quam aliquam eveniet molestias fuga assumenda culpa at, 74 | temporibus tempore perspiciatis repellat architecto iste 75 | aspernatur repellendus quaerat reprehenderit libero excepturi iure 76 | nisi! Ipsum unde voluptatibus repellendus provident esse aliquam 77 | labore, inventore ex autem nobis sunt. Cupiditate unde impedit 78 | ullam blanditiis quos molestias molestiae modi iusto dignissimos, 79 | sed architecto? Officiis, esse perferendis. Dolor dolores 80 | voluptates quos, officia voluptatibus nesciunt voluptatum 81 | voluptatem ipsa, minus magni, quisquam illum sit quis itaque quas. 82 |

83 |
84 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum, 85 | praesentium? 86 |
87 |

88 | Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam 89 | officia nemo unde neque iusto minima reiciendis vitae nam deserunt 90 | qui nulla rem voluptas, non velit earum, corrupti delectus sint! 91 | Quibusdam quam aliquam eveniet molestias fuga assumenda culpa at, 92 | temporibus tempore perspiciatis repellat architecto iste 93 | aspernatur repellendus quaerat reprehenderit libero excepturi iure 94 | nisi! Ipsum unde voluptatibus repellendus provident esse aliquam 95 | labore, inventore ex autem nobis sunt. Cupiditate unde impedit 96 | ullam blanditiis quos molestias molestiae modi iusto dignissimos, 97 | sed architecto? Officiis, esse perferendis. Dolor dolores 98 | voluptates quos, officia voluptatibus nesciunt voluptatum 99 | voluptatem ipsa, minus magni, quisquam illum sit quis itaque quas. 100 |

101 |
102 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum, 103 | praesentium? 104 |
105 |

106 | Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam 107 | officia nemo unde neque iusto minima reiciendis vitae nam deserunt 108 | qui nulla rem voluptas, non velit earum, corrupti delectus sint! 109 | Quibusdam quam aliquam eveniet molestias fuga assumenda culpa at, 110 | temporibus tempore perspiciatis repellat architecto iste 111 | aspernatur repellendus quaerat reprehenderit libero excepturi iure 112 | nisi! Ipsum unde voluptatibus repellendus provident esse aliquam 113 | labore, inventore ex autem nobis sunt. Cupiditate unde impedit 114 | ullam blanditiis quos molestias molestiae modi iusto dignissimos, 115 | sed architecto? Officiis, esse perferendis. Dolor dolores 116 | voluptates quos, officia voluptatibus nesciunt voluptatum 117 | voluptatem ipsa, minus magni, quisquam illum sit quis itaque quas. 118 |

119 | 120 |
121 |
122 | 123 | ); 124 | }; 125 | 126 | export default Policy; 127 | -------------------------------------------------------------------------------- /client/src/components/Success.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Alert } from "react-bootstrap"; 3 | const Success = ({ success }) => { 4 | return {success}; 5 | }; 6 | 7 | export default Success; 8 | -------------------------------------------------------------------------------- /client/src/components/TopBar.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Navbar, Nav, Container } from "react-bootstrap"; 3 | import { LinkContainer } from "react-router-bootstrap"; 4 | import { MdLocalOffer } from "react-icons/md"; 5 | 6 | const TopBar = () => { 7 | return ( 8 | <> 9 | 10 | 11 |
12 |    Free Home 13 | Delivery on Order Above 500/- Rupees 14 |
15 | 29 |
30 |
31 | 32 | ); 33 | }; 34 | 35 | export default TopBar; 36 | -------------------------------------------------------------------------------- /client/src/index.css: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /client/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import { Provider } from "react-redux"; 4 | import store from "./store"; 5 | import "bootstrap/dist/css/bootstrap.min.css"; 6 | import "./index.css"; 7 | import App from "./App"; 8 | 9 | ReactDOM.render( 10 | 11 | 12 | , 13 | document.getElementById("root") 14 | ); 15 | -------------------------------------------------------------------------------- /client/src/pizza-data.js: -------------------------------------------------------------------------------- 1 | const pizzas = [ 2 | { 3 | name: "Margherita", 4 | varients: ["small", "medium", "large"], 5 | prices: [ 6 | { 7 | small: 99, 8 | medium: 199, 9 | large: 399, 10 | }, 11 | ], 12 | category: "veg", 13 | image: "/images/margherita.jpg", 14 | description: "Classic delight with 100% real mozzarella cheese", 15 | }, 16 | { 17 | name: "Farmhouse", 18 | varients: ["small", "medium", "large"], 19 | prices: [ 20 | { 21 | small: 229, 22 | medium: 399, 23 | large: 599, 24 | }, 25 | ], 26 | category: "veg", 27 | image: "/images/farmhouse.jpg", 28 | description: 29 | "Delightful combination of onion, capsicum, tomato & grilled mushroom", 30 | }, 31 | { 32 | name: "Veggie Paradise", 33 | varients: ["small", "medium", "large"], 34 | prices: [ 35 | { 36 | small: 180, 37 | medium: 290, 38 | large: 460, 39 | }, 40 | ], 41 | category: "veg", 42 | description: 43 | "The awesome foursome! Golden corn, black olives, capsicum, red paprika", 44 | image: "/images/veggie_paradise.jpg", 45 | }, 46 | { 47 | name: "Chicken Golden Delight", 48 | varients: ["small", "medium", "large"], 49 | prices: [ 50 | { 51 | small: 249, 52 | medium: 349, 53 | large: 599, 54 | }, 55 | ], 56 | category: "nonveg", 57 | image: "/images/chicken_golden_delight.jpg", 58 | description: 59 | "Double pepper barbecue chicken, golden corn and extra cheese, true delight", 60 | }, 61 | { 62 | name: "Chicken Pepperoni", 63 | varients: ["small", "medium", "large"], 64 | prices: [ 65 | { 66 | small: 320, 67 | medium: 580, 68 | large: 800, 69 | }, 70 | ], 71 | category: "nonveg", 72 | image: "/images/cheesepepperoni.jpg", 73 | description: 74 | "A classic American taste! Relish the delectable flavor of Chicken Pepperoni, topped with extra cheese", 75 | }, 76 | { 77 | name: "Indi Chicken Tikka", 78 | varients: ["small", "medium", "large"], 79 | prices: [ 80 | { 81 | small: 250, 82 | medium: 380, 83 | large: 500, 84 | }, 85 | ], 86 | category: "nonveg", 87 | image: "/images/IndianTandooriChickenTikka.jpg", 88 | description: 89 | "The wholesome flavour of tandoori masala with Chicken tikka, onion, red paprika & mint mayo", 90 | }, 91 | ]; 92 | export default pizzas; 93 | -------------------------------------------------------------------------------- /client/src/reducers/cartReducer.js: -------------------------------------------------------------------------------- 1 | export const cartReducer = (state = { cartItems: [] }, action) => { 2 | switch (action.type) { 3 | case "ADD_TO_CART": 4 | const alreadyExists = state.cartItems.find( 5 | (item) => item._id === action.payload._id 6 | ); 7 | if (alreadyExists) { 8 | return { 9 | ...state, 10 | cartItems: state.cartItems.map((item) => 11 | item._id === action.payload._id ? action.payload : item 12 | ), 13 | }; 14 | } else { 15 | return { 16 | ...state, 17 | cartItems: [...state.cartItems, action.payload], 18 | }; 19 | } 20 | case "DELETE_FROM_CART": 21 | return { 22 | ...state, 23 | cartItems: state.cartItems.filter( 24 | (item) => item._id !== action.payload._id 25 | ), 26 | }; 27 | default: 28 | return state; 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /client/src/reducers/orderReducer.js: -------------------------------------------------------------------------------- 1 | export const placeOrderReducer = (state = {}, action) => { 2 | switch (action.type) { 3 | case "PLACE_ORDER_REQUEST": 4 | return { 5 | loading: true, 6 | }; 7 | case "PLACE_ORDER_SUCCESS": 8 | return { 9 | loading: false, 10 | success: true, 11 | }; 12 | case "PLACE_ORDER_FAIL": 13 | return { 14 | loading: false, 15 | error: action.payload, 16 | }; 17 | default: 18 | return state; 19 | } 20 | }; 21 | 22 | export const getUserOrdersReducer = (state = { orders: [] }, action) => { 23 | switch (action.type) { 24 | case "USER_ORDER_REQUEST": 25 | return { 26 | loading: true, 27 | ...state, 28 | }; 29 | case "USER_ORDER_SUCCESS": 30 | return { 31 | loading: false, 32 | success: true, 33 | orders: action.payload, 34 | }; 35 | case "USER_ORDER_FAIL": 36 | return { 37 | loading: false, 38 | error: action.payload, 39 | }; 40 | default: 41 | return state; 42 | } 43 | }; 44 | export const allUserOrdersReducer = (state = { orders: [] }, action) => { 45 | switch (action.type) { 46 | case "ALL_ORDER_REQUEST": 47 | return { 48 | loading: true, 49 | ...state, 50 | }; 51 | case "ALL_ORDER_SUCCESS": 52 | return { 53 | loading: false, 54 | success: true, 55 | orders: action.payload, 56 | }; 57 | case "ALL_ORDER_FAIL": 58 | return { 59 | loading: false, 60 | error: action.payload, 61 | }; 62 | default: 63 | return state; 64 | } 65 | }; 66 | -------------------------------------------------------------------------------- /client/src/reducers/pizzaReducer.js: -------------------------------------------------------------------------------- 1 | export const getAllPizzaReducer = (state = { pizzas: [] }, action) => { 2 | switch (action.type) { 3 | case "GET_PIZZAS_REQUEST": 4 | return { 5 | ...state, 6 | loading: true, 7 | }; 8 | case "GET_PIZZAS_SUCCESS": 9 | return { 10 | pizzas: action.payload, 11 | loading: false, 12 | }; 13 | case "GET_PIZZAS_FAIL": 14 | return { 15 | error: action.payload, 16 | loading: false, 17 | }; 18 | default: 19 | return state; 20 | } 21 | }; 22 | export const addPizzaReducer = (state = {}, action) => { 23 | switch (action.type) { 24 | case "ADD_PIZZAS_REQUEST": 25 | return { 26 | ...state, 27 | loading: true, 28 | }; 29 | case "ADD_PIZZAS_SUCCESS": 30 | return { 31 | success: true, 32 | loading: false, 33 | }; 34 | case "ADD_PIZZAS_FAIL": 35 | return { 36 | loading: false, 37 | error: action.payload, 38 | }; 39 | default: 40 | return state; 41 | } 42 | }; 43 | export const getPizzaByIdReducer = (state = {}, action) => { 44 | switch (action.type) { 45 | case "GET_PIZZABYID_REQUEST": 46 | return { 47 | ...state, 48 | loading: true, 49 | }; 50 | case "GET_PIZZABYID_SUCCESS": 51 | return { 52 | pizza: action.payload, 53 | loading: false, 54 | }; 55 | case "GET_PIZZABYID_FAIL": 56 | return { 57 | loading: false, 58 | error: action.payload, 59 | }; 60 | default: 61 | return state; 62 | } 63 | }; 64 | export const updatePizzaByIdReducer = (state = {}, action) => { 65 | switch (action.type) { 66 | case "UPDATE_PIZZABYID_REQUEST": 67 | return { 68 | ...state, 69 | loading: true, 70 | }; 71 | case "UPDATE_PIZZABYID_SUCCESS": 72 | return { 73 | updatesuccess: true, 74 | updateloading: false, 75 | }; 76 | case "UPDATE_PIZZABYID_FAIL": 77 | return { 78 | updateloading: false, 79 | updateerror: action.payload, 80 | }; 81 | default: 82 | return state; 83 | } 84 | }; 85 | -------------------------------------------------------------------------------- /client/src/reducers/userReducer.js: -------------------------------------------------------------------------------- 1 | export const registerUserReducer = (state = {}, action) => { 2 | switch (action.type) { 3 | case "USER_REGISTER_REQUEST": 4 | return { 5 | lodaing: true, 6 | }; 7 | case "USER_REGISTER_SUCCESS": 8 | return { 9 | loading: false, 10 | success: true, 11 | }; 12 | case "USER_REGISTER_FAIL": 13 | return { 14 | loading: false, 15 | error: action.payload, 16 | }; 17 | default: 18 | return state; 19 | } 20 | }; 21 | 22 | export const loginUserReducer = (state = {}, action) => { 23 | switch (action.type) { 24 | case "USER_LOGIN_REQUEST": 25 | return { 26 | loading: true, 27 | }; 28 | case "USER_LOGIN_SUCCESS": 29 | return { 30 | loading: false, 31 | success: true, 32 | currentUser: action.payload, 33 | }; 34 | case "USER_LOGIN_FAIL": 35 | return { 36 | loading: false, 37 | error: action.payload, 38 | }; 39 | default: 40 | return state; 41 | } 42 | }; 43 | 44 | export const getAllUsersReducer = (state = { users: [] }, action) => { 45 | switch (action.type) { 46 | case "GET_USERS_REQUEST": 47 | return { 48 | ...state, 49 | loading: true, 50 | }; 51 | case "GET_USERS_SUCCESS": 52 | return { 53 | users: action.payload, 54 | loading: false, 55 | }; 56 | case "GET_USERS_FAIL": 57 | return { 58 | error: action.payload, 59 | loading: false, 60 | }; 61 | default: 62 | return state; 63 | } 64 | }; 65 | -------------------------------------------------------------------------------- /client/src/screens/AdminScreen.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import { Row, Col, Container, Button, ButtonGroup } from "react-bootstrap"; 3 | import { useSelector } from "react-redux"; 4 | import { Switch, Route } from "react-router-dom"; 5 | import AddNewPizza from "../components/Admin/AddNewPizza"; 6 | import OrderList from "../components/Admin/OrderList"; 7 | import Pizzaslist from "../components/Admin/Pizzaslist"; 8 | import Userlist from "../components/Admin/Userlist"; 9 | import EditPizza from "./../components/Admin/EditPizza"; 10 | const AdminScreen = ({ history }) => { 11 | const userState = useSelector((state) => state.loginUserReducer); 12 | const { currentUser } = userState; 13 | useEffect(() => { 14 | if (localStorage.getItem("currentUser") === null || !currentUser.isAdmin) { 15 | window.location.href = "/"; 16 | } 17 | }, [currentUser]); 18 | return ( 19 | <> 20 | 21 | 22 |

Admin Panel

23 | 24 | 25 | 28 | 31 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | 53 |
54 |
55 | 56 | ); 57 | }; 58 | 59 | export default AdminScreen; 60 | -------------------------------------------------------------------------------- /client/src/screens/CartScreen.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Container, Row, Col } from "react-bootstrap"; 3 | import { useSelector, useDispatch } from "react-redux"; 4 | import { FaMinusCircle, FaPlusCircle, FaTrash } from "react-icons/fa"; 5 | import { addToCart, deleteFromCart } from "../actions/cartAction"; 6 | import Checkout from "../components/Checkout"; 7 | const CartScreen = () => { 8 | const cartState = useSelector((state) => state.cartReducer); 9 | const cartItems = cartState.cartItems; 10 | const dispatch = useDispatch(); 11 | const subTotal = cartItems.reduce((x, item) => x + item.price, 0); 12 | return ( 13 | <> 14 | 15 | 16 | 17 |

My Cart

18 | 19 | {cartItems.map((item) => ( 20 | <> 21 | 22 |
23 | {item.name} [{item.varient}] 24 |
25 |
26 | {" "} 27 | Price : {item.quantity} X {item.prices[0][item.varient]} ={" "} 28 | {item.price} 29 |
30 | 31 |
32 | Quantity :  33 | { 37 | dispatch( 38 | addToCart(item, item.quantity - 1, item.varient) 39 | ); 40 | }} 41 | />{" "} 42 |   43 | {item.quantity}   44 | { 48 | dispatch( 49 | addToCart(item, item.quantity + 1, item.varient) 50 | ); 51 | }} 52 | /> 53 |
54 | 55 | 56 | {item.name} 61 | { 65 | dispatch(deleteFromCart(item)); 66 | }} 67 | /> 68 | 69 |
70 | 71 | ))} 72 |
73 | 74 | 75 |

Payment Info

76 |

Sub Total

77 |

RS : {subTotal} /-

78 | 79 | 80 |
81 |
82 | 83 | ); 84 | }; 85 | 86 | export default CartScreen; 87 | -------------------------------------------------------------------------------- /client/src/screens/HomeScreen.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { Container, Row, Col } from "react-bootstrap"; 5 | import { getAllPizzas } from "../actions/pizzaAction"; 6 | import Pizza from "../components/Pizza"; 7 | import Loader from "../components/Loader"; 8 | import Error from "../components/Error"; 9 | import Filters from "../components/Filters"; 10 | 11 | const HomeScreen = () => { 12 | const dispatch = useDispatch(); 13 | const pizzastate = useSelector((state) => state.getAllPizzaReducer); 14 | const { loading, pizzas, error } = pizzastate; 15 | // console.log(pizzas); 16 | useEffect(() => { 17 | dispatch(getAllPizzas()); 18 | }, [dispatch]); 19 | 20 | return ( 21 | <> 22 | 23 | {loading ? ( 24 | 25 | ) : error ? ( 26 | Error while fetching pizzas {error} 27 | ) : ( 28 | 29 | 30 | {pizzas.map((pizza) => ( 31 | 32 | 33 | 34 | ))} 35 | 36 | )} 37 | 38 | 39 | ); 40 | }; 41 | 42 | export default HomeScreen; 43 | -------------------------------------------------------------------------------- /client/src/screens/Login.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { Container, Form, Button } from "react-bootstrap"; 3 | import { useDispatch } from "react-redux"; 4 | import { loginUser } from "../actions/userAction"; 5 | const Login = () => { 6 | const [email, setEmail] = useState(""); 7 | const [password, setPassword] = useState(""); 8 | const dispatch = useDispatch(); 9 | 10 | useEffect(() => { 11 | if (localStorage.getItem("currentUser")) { 12 | window.location.href = "/"; 13 | } 14 | }, []); 15 | const loginHandler = () => { 16 | const user = { email, password }; 17 | dispatch(loginUser(user)); 18 | }; 19 | return ( 20 | <> 21 | 22 |
23 | 24 | Email address 25 | setEmail(e.target.value)} 29 | placeholder="Enter email" 30 | /> 31 | 32 | We'll never share your email with anyone else. 33 | 34 | 35 | 36 | 37 | Password 38 | setPassword(e.target.value)} 42 | placeholder="Password" 43 | /> 44 | 45 | 46 | 47 | 48 | 51 |
52 |
53 | 54 | ); 55 | }; 56 | 57 | export default Login; 58 | -------------------------------------------------------------------------------- /client/src/screens/OrderScreen.jsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import { getUserOrders } from "../actions/orderAction"; 3 | import { useDispatch, useSelector } from "react-redux"; 4 | import { Row, Col } from "react-bootstrap"; 5 | import Loader from "../components/Loader"; 6 | import Error from "../components/Error"; 7 | 8 | const OrderScreen = () => { 9 | const orderState = useSelector((state) => state.getUserOrdersReducer); 10 | const { loading, error, orders } = orderState; 11 | const dispatch = useDispatch(); 12 | useEffect(() => { 13 | dispatch(getUserOrders()); 14 | }, [dispatch]); 15 | return ( 16 | <> 17 |

Your Orders

18 | {loading && } 19 | {error && } 20 | {orders && 21 | orders.map((order) => ( 22 |
23 | 24 | 25 |

Items :

26 | {order.orderItems.map((item) => ( 27 |
28 | {item.name} [{item.varient}] * {item.quantity} ={" "} 29 | {item.price} 30 |
31 | ))} 32 | 33 | 34 |

Address :

35 |
Street : {order.shippingAddress.street}
36 |
City : {order.shippingAddress.city}
37 |
PinCode : {order.shippingAddress.picode}
38 |
Countery : {order.shippingAddress.country}
39 | 40 | 41 |

Order Info :

42 |
Order Amount : {order.orderAmount}
43 |
Transection id : {order.transectionId}
44 |
Order id : {order._id}
45 | 46 |
47 |
48 | ))} 49 | 50 | ); 51 | }; 52 | 53 | export default OrderScreen; 54 | -------------------------------------------------------------------------------- /client/src/screens/Registe.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from "react"; 2 | import { Container, Form, Button } from "react-bootstrap"; 3 | import { useDispatch } from "react-redux"; 4 | import { registerUser } from "../actions/userAction"; 5 | import { useSelector } from "react-redux"; 6 | import Loader from "../components/Loader"; 7 | import Success from "../components/Success"; 8 | import Error from "../components/Error"; 9 | 10 | const Registe = () => { 11 | const registerState = useSelector((state) => state.registerUserReducer); 12 | const { error, success, loading } = registerState; 13 | 14 | const [name, setName] = useState(""); 15 | const [email, setEmail] = useState(""); 16 | const [password, setPassword] = useState(""); 17 | const [confrimPassword, setConfirmPassword] = useState(""); 18 | 19 | const dispatch = useDispatch(); 20 | 21 | const registerhandler = () => { 22 | if (password !== confrimPassword) { 23 | alert("Password do not match"); 24 | } else { 25 | const user = { name, email, password, confrimPassword }; 26 | dispatch(registerUser(user)); 27 | } 28 | }; 29 | return ( 30 | <> 31 | 32 | {loading && } 33 | {success && } 34 | {error && } 35 |
36 |

Regiteration

37 | 38 | Name 39 | setName(e.target.value)} 44 | /> 45 | 46 | 47 | Email address 48 | setEmail(e.target.value)} 53 | /> 54 | 55 | We'll never share your email with anyone else. 56 | 57 | 58 | 59 | 60 | Password 61 | setPassword(e.target.value)} 66 | /> 67 | 68 | 69 | Confrim Password 70 | setConfirmPassword(e.target.value)} 75 | /> 76 | 77 | 78 | 79 | 80 | 81 | 84 |
85 |
86 | 87 | ); 88 | }; 89 | 90 | export default Registe; 91 | -------------------------------------------------------------------------------- /client/src/store.js: -------------------------------------------------------------------------------- 1 | import { createStore, combineReducers, applyMiddleware } from "redux"; 2 | import thunk from "redux-thunk"; 3 | import { composeWithDevTools } from "redux-devtools-extension"; 4 | import { 5 | getAllPizzaReducer, 6 | addPizzaReducer, 7 | getPizzaByIdReducer, 8 | updatePizzaByIdReducer, 9 | } from "./reducers/pizzaReducer"; 10 | import { cartReducer } from "./reducers/cartReducer"; 11 | import { 12 | registerUserReducer, 13 | loginUserReducer, 14 | getAllUsersReducer, 15 | } from "./reducers/userReducer"; 16 | import { 17 | placeOrderReducer, 18 | getUserOrdersReducer, 19 | allUserOrdersReducer, 20 | } from "./reducers/orderReducer"; 21 | const cartItems = localStorage.getItem("cartItems") 22 | ? JSON.parse(localStorage.getItem("cartItems")) 23 | : []; 24 | 25 | const currentUser = localStorage.getItem("currentUser") 26 | ? JSON.parse(localStorage.getItem("currentUser")) 27 | : null; 28 | const rootReducer = combineReducers({ 29 | getAllPizzaReducer: getAllPizzaReducer, 30 | cartReducer: cartReducer, 31 | registerUserReducer: registerUserReducer, 32 | loginUserReducer: loginUserReducer, 33 | placeOrderReducer: placeOrderReducer, 34 | getUserOrdersReducer: getUserOrdersReducer, 35 | addPizzaReducer: addPizzaReducer, 36 | getPizzaByIdReducer: getPizzaByIdReducer, 37 | updatePizzaByIdReducer: updatePizzaByIdReducer, 38 | allUserOrdersReducer: allUserOrdersReducer, 39 | getAllUsersReducer: getAllUsersReducer, 40 | }); 41 | 42 | const initialState = { 43 | cartReducer: { 44 | cartItems: cartItems, 45 | }, 46 | loginUserReducer: { 47 | currentUser: currentUser, 48 | }, 49 | }; 50 | const middleware = [thunk]; 51 | 52 | const store = createStore( 53 | rootReducer, 54 | initialState, 55 | composeWithDevTools(applyMiddleware(...middleware)) 56 | ); 57 | export default store; 58 | -------------------------------------------------------------------------------- /config/config.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | require("colors"); 3 | 4 | const connectDB = async () => { 5 | try { 6 | const url = process.env.MONGO_URI; 7 | const conn = await mongoose.connect(url, { 8 | useUnifiedTopology: true, 9 | useNewUrlParser: true, 10 | useCreateIndex: true, 11 | }); 12 | console.log( 13 | `Mongodb DataBase Connected! ${conn.connection.host}`.bgCyan.white 14 | ); 15 | } catch (error) { 16 | console.log(`error: ${error.message}`.bgRed.white); 17 | } 18 | }; 19 | 20 | module.exports = connectDB; 21 | -------------------------------------------------------------------------------- /data/pizza-data.js: -------------------------------------------------------------------------------- 1 | const pizzas = [ 2 | { 3 | name: "Margherita", 4 | varients: ["small", "medium", "large"], 5 | prices: [ 6 | { 7 | small: 99, 8 | medium: 199, 9 | large: 399, 10 | }, 11 | ], 12 | category: "veg", 13 | image: "/images/margherita.jpg", 14 | description: "Classic delight with 100% real mozzarella cheese", 15 | }, 16 | { 17 | name: "Farmhouse", 18 | varients: ["small", "medium", "large"], 19 | prices: [ 20 | { 21 | small: 229, 22 | medium: 399, 23 | large: 599, 24 | }, 25 | ], 26 | category: "veg", 27 | image: "/images/farmhouse.jpg", 28 | description: 29 | "Delightful combination of onion, capsicum, tomato & grilled mushroom", 30 | }, 31 | { 32 | name: "Veggie Paradise", 33 | varients: ["small", "medium", "large"], 34 | prices: [ 35 | { 36 | small: 180, 37 | medium: 290, 38 | large: 460, 39 | }, 40 | ], 41 | category: "veg", 42 | description: 43 | "The awesome foursome! Golden corn, black olives, capsicum, red paprika", 44 | image: "/images/veggie_paradise.jpg", 45 | }, 46 | { 47 | name: "Chicken Golden Delight", 48 | varients: ["small", "medium", "large"], 49 | prices: [ 50 | { 51 | small: 249, 52 | medium: 349, 53 | large: 599, 54 | }, 55 | ], 56 | category: "nonveg", 57 | image: "/images/chicken_golden_delight.jpg", 58 | description: 59 | "Double pepper barbecue chicken, golden corn and extra cheese, true delight", 60 | }, 61 | { 62 | name: "Chicken Pepperoni", 63 | varients: ["small", "medium", "large"], 64 | prices: [ 65 | { 66 | small: 320, 67 | medium: 580, 68 | large: 800, 69 | }, 70 | ], 71 | category: "nonveg", 72 | image: "/images/cheesepepperoni.jpg", 73 | description: 74 | "A classic American taste! Relish the delectable flavor of Chicken Pepperoni, topped with extra cheese", 75 | }, 76 | { 77 | name: "Indi Chicken Tikka", 78 | varients: ["small", "medium", "large"], 79 | prices: [ 80 | { 81 | small: 250, 82 | medium: 380, 83 | large: 500, 84 | }, 85 | ], 86 | category: "nonveg", 87 | image: "/images/IndianTandooriChickenTikka.jpg", 88 | description: 89 | "The wholesome flavour of tandoori masala with Chicken tikka, onion, red paprika & mint mayo", 90 | }, 91 | ]; 92 | module.exports = pizzas; 93 | -------------------------------------------------------------------------------- /models/orderModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const orderSchema = mongoose.Schema( 4 | { 5 | name: { 6 | type: String, 7 | required: [true, "order name required"], 8 | }, 9 | email: { 10 | type: String, 11 | required: [true, "email is required"], 12 | }, 13 | userid: { 14 | type: String, 15 | }, 16 | orderItems: [], 17 | shippingAddress: { 18 | type: Object, 19 | }, 20 | orderAmount: { 21 | type: String, 22 | // required: true, 23 | }, 24 | isDeliverd: { 25 | type: Boolean, 26 | default: false, 27 | }, 28 | transectionId: { 29 | type: String, 30 | // required: true, 31 | }, 32 | }, 33 | { timestamps: true } 34 | ); 35 | 36 | module.exports = mongoose.model("order", orderSchema); 37 | -------------------------------------------------------------------------------- /models/pizzaModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const pizzaSchema = mongoose.Schema( 4 | { 5 | name: { 6 | type: String, 7 | required: true, 8 | }, 9 | varients: [], 10 | prices: [], 11 | category: { 12 | type: String, 13 | required: true, 14 | }, 15 | image: { 16 | type: String, 17 | required: true, 18 | }, 19 | description: { 20 | type: String, 21 | required: true, 22 | }, 23 | }, 24 | { timestamps: true } 25 | ); 26 | 27 | const pizzaModel = mongoose.model("pizza", pizzaSchema); 28 | module.exports = pizzaModel; 29 | -------------------------------------------------------------------------------- /models/userModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const userSchema = mongoose.Schema( 4 | { 5 | name: { 6 | type: String, 7 | required: [true, "Name is required"], 8 | }, 9 | email: { 10 | type: String, 11 | required: [true, "Email is Required"], 12 | }, 13 | password: { 14 | type: String, 15 | required: [true, "Password is Required"], 16 | }, 17 | isAdmin: { 18 | type: Boolean, 19 | default: false, 20 | }, 21 | }, 22 | { timestamps: true } 23 | ); 24 | 25 | module.exports = mongoose.model("User", userSchema); 26 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.14.5", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", 10 | "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", 11 | "requires": { 12 | "@babel/highlight": "^7.14.5" 13 | } 14 | }, 15 | "@babel/helper-validator-identifier": { 16 | "version": "7.14.8", 17 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", 18 | "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" 19 | }, 20 | "@babel/highlight": { 21 | "version": "7.14.5", 22 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", 23 | "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", 24 | "requires": { 25 | "@babel/helper-validator-identifier": "^7.14.5", 26 | "chalk": "^2.0.0", 27 | "js-tokens": "^4.0.0" 28 | }, 29 | "dependencies": { 30 | "ansi-styles": { 31 | "version": "3.2.1", 32 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 33 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 34 | "requires": { 35 | "color-convert": "^1.9.0" 36 | } 37 | }, 38 | "chalk": { 39 | "version": "2.4.2", 40 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 41 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 42 | "requires": { 43 | "ansi-styles": "^3.2.1", 44 | "escape-string-regexp": "^1.0.5", 45 | "supports-color": "^5.3.0" 46 | } 47 | }, 48 | "color-convert": { 49 | "version": "1.9.3", 50 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 51 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 52 | "requires": { 53 | "color-name": "1.1.3" 54 | } 55 | }, 56 | "color-name": { 57 | "version": "1.1.3", 58 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 59 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 60 | }, 61 | "has-flag": { 62 | "version": "3.0.0", 63 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 64 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 65 | }, 66 | "supports-color": { 67 | "version": "5.5.0", 68 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 69 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 70 | "requires": { 71 | "has-flag": "^3.0.0" 72 | } 73 | } 74 | } 75 | }, 76 | "@types/bson": { 77 | "version": "4.0.4", 78 | "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.4.tgz", 79 | "integrity": "sha512-awqorHvQS0DqxkHQ/FxcPX9E+H7Du51Qw/2F+5TBMSaE3G0hm+8D3eXJ6MAzFw75nE8V7xF0QvzUSdxIjJb/GA==", 80 | "requires": { 81 | "@types/node": "*" 82 | } 83 | }, 84 | "@types/mongodb": { 85 | "version": "3.6.20", 86 | "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.6.20.tgz", 87 | "integrity": "sha512-WcdpPJCakFzcWWD9juKoZbRtQxKIMYF/JIAM4JrNHrMcnJL6/a2NWjXxW7fo9hxboxxkg+icff8d7+WIEvKgYQ==", 88 | "requires": { 89 | "@types/bson": "*", 90 | "@types/node": "*" 91 | } 92 | }, 93 | "@types/node": { 94 | "version": "15.14.3", 95 | "resolved": "https://registry.npmjs.org/@types/node/-/node-15.14.3.tgz", 96 | "integrity": "sha512-gliNP92vLGGha1nioYHIIT2WrZ450sxpRgyPCEyog2hMVi6LEbhY/Pkj+EDiGWrCXntZ9lrnE2+lTIlyYtaxCg==" 97 | }, 98 | "@types/normalize-package-data": { 99 | "version": "2.4.1", 100 | "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", 101 | "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" 102 | }, 103 | "accepts": { 104 | "version": "1.3.7", 105 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 106 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 107 | "requires": { 108 | "mime-types": "~2.1.24", 109 | "negotiator": "0.6.2" 110 | } 111 | }, 112 | "ansi-regex": { 113 | "version": "5.0.0", 114 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", 115 | "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" 116 | }, 117 | "ansi-styles": { 118 | "version": "4.3.0", 119 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 120 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 121 | "requires": { 122 | "color-convert": "^2.0.1" 123 | } 124 | }, 125 | "array-flatten": { 126 | "version": "1.1.1", 127 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 128 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 129 | }, 130 | "basic-auth": { 131 | "version": "2.0.1", 132 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", 133 | "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", 134 | "requires": { 135 | "safe-buffer": "5.1.2" 136 | } 137 | }, 138 | "bl": { 139 | "version": "2.2.1", 140 | "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", 141 | "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", 142 | "requires": { 143 | "readable-stream": "^2.3.5", 144 | "safe-buffer": "^5.1.1" 145 | } 146 | }, 147 | "bluebird": { 148 | "version": "3.5.1", 149 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", 150 | "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" 151 | }, 152 | "body-parser": { 153 | "version": "1.19.0", 154 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 155 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 156 | "requires": { 157 | "bytes": "3.1.0", 158 | "content-type": "~1.0.4", 159 | "debug": "2.6.9", 160 | "depd": "~1.1.2", 161 | "http-errors": "1.7.2", 162 | "iconv-lite": "0.4.24", 163 | "on-finished": "~2.3.0", 164 | "qs": "6.7.0", 165 | "raw-body": "2.4.0", 166 | "type-is": "~1.6.17" 167 | } 168 | }, 169 | "bson": { 170 | "version": "1.1.6", 171 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz", 172 | "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==" 173 | }, 174 | "bytes": { 175 | "version": "3.1.0", 176 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 177 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 178 | }, 179 | "chalk": { 180 | "version": "4.1.1", 181 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", 182 | "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", 183 | "requires": { 184 | "ansi-styles": "^4.1.0", 185 | "supports-color": "^7.1.0" 186 | }, 187 | "dependencies": { 188 | "supports-color": { 189 | "version": "7.2.0", 190 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 191 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 192 | "requires": { 193 | "has-flag": "^4.0.0" 194 | } 195 | } 196 | } 197 | }, 198 | "cliui": { 199 | "version": "7.0.4", 200 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", 201 | "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", 202 | "requires": { 203 | "string-width": "^4.2.0", 204 | "strip-ansi": "^6.0.0", 205 | "wrap-ansi": "^7.0.0" 206 | } 207 | }, 208 | "color-convert": { 209 | "version": "2.0.1", 210 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 211 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 212 | "requires": { 213 | "color-name": "~1.1.4" 214 | } 215 | }, 216 | "color-name": { 217 | "version": "1.1.4", 218 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 219 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 220 | }, 221 | "colors": { 222 | "version": "1.4.0", 223 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", 224 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" 225 | }, 226 | "concurrently": { 227 | "version": "6.2.0", 228 | "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.2.0.tgz", 229 | "integrity": "sha512-v9I4Y3wFoXCSY2L73yYgwA9ESrQMpRn80jMcqMgHx720Hecz2GZAvTI6bREVST6lkddNypDKRN22qhK0X8Y00g==", 230 | "requires": { 231 | "chalk": "^4.1.0", 232 | "date-fns": "^2.16.1", 233 | "lodash": "^4.17.21", 234 | "read-pkg": "^5.2.0", 235 | "rxjs": "^6.6.3", 236 | "spawn-command": "^0.0.2-1", 237 | "supports-color": "^8.1.0", 238 | "tree-kill": "^1.2.2", 239 | "yargs": "^16.2.0" 240 | } 241 | }, 242 | "content-disposition": { 243 | "version": "0.5.3", 244 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 245 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 246 | "requires": { 247 | "safe-buffer": "5.1.2" 248 | } 249 | }, 250 | "content-type": { 251 | "version": "1.0.4", 252 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 253 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 254 | }, 255 | "cookie": { 256 | "version": "0.4.0", 257 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 258 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 259 | }, 260 | "cookie-signature": { 261 | "version": "1.0.6", 262 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 263 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 264 | }, 265 | "core-util-is": { 266 | "version": "1.0.2", 267 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 268 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 269 | }, 270 | "date-fns": { 271 | "version": "2.23.0", 272 | "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.23.0.tgz", 273 | "integrity": "sha512-5ycpauovVyAk0kXNZz6ZoB9AYMZB4DObse7P3BPWmyEjXNORTI8EJ6X0uaSAq4sCHzM1uajzrkr6HnsLQpxGXA==" 274 | }, 275 | "debug": { 276 | "version": "2.6.9", 277 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 278 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 279 | "requires": { 280 | "ms": "2.0.0" 281 | } 282 | }, 283 | "denque": { 284 | "version": "1.5.0", 285 | "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", 286 | "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" 287 | }, 288 | "depd": { 289 | "version": "1.1.2", 290 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 291 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 292 | }, 293 | "destroy": { 294 | "version": "1.0.4", 295 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 296 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 297 | }, 298 | "dotenv": { 299 | "version": "10.0.0", 300 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", 301 | "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" 302 | }, 303 | "ee-first": { 304 | "version": "1.1.1", 305 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 306 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 307 | }, 308 | "emoji-regex": { 309 | "version": "8.0.0", 310 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 311 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 312 | }, 313 | "encodeurl": { 314 | "version": "1.0.2", 315 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 316 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 317 | }, 318 | "error-ex": { 319 | "version": "1.3.2", 320 | "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", 321 | "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", 322 | "requires": { 323 | "is-arrayish": "^0.2.1" 324 | } 325 | }, 326 | "escalade": { 327 | "version": "3.1.1", 328 | "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 329 | "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" 330 | }, 331 | "escape-html": { 332 | "version": "1.0.3", 333 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 334 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 335 | }, 336 | "escape-string-regexp": { 337 | "version": "1.0.5", 338 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 339 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 340 | }, 341 | "etag": { 342 | "version": "1.8.1", 343 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 344 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 345 | }, 346 | "express": { 347 | "version": "4.17.1", 348 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 349 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 350 | "requires": { 351 | "accepts": "~1.3.7", 352 | "array-flatten": "1.1.1", 353 | "body-parser": "1.19.0", 354 | "content-disposition": "0.5.3", 355 | "content-type": "~1.0.4", 356 | "cookie": "0.4.0", 357 | "cookie-signature": "1.0.6", 358 | "debug": "2.6.9", 359 | "depd": "~1.1.2", 360 | "encodeurl": "~1.0.2", 361 | "escape-html": "~1.0.3", 362 | "etag": "~1.8.1", 363 | "finalhandler": "~1.1.2", 364 | "fresh": "0.5.2", 365 | "merge-descriptors": "1.0.1", 366 | "methods": "~1.1.2", 367 | "on-finished": "~2.3.0", 368 | "parseurl": "~1.3.3", 369 | "path-to-regexp": "0.1.7", 370 | "proxy-addr": "~2.0.5", 371 | "qs": "6.7.0", 372 | "range-parser": "~1.2.1", 373 | "safe-buffer": "5.1.2", 374 | "send": "0.17.1", 375 | "serve-static": "1.14.1", 376 | "setprototypeof": "1.1.1", 377 | "statuses": "~1.5.0", 378 | "type-is": "~1.6.18", 379 | "utils-merge": "1.0.1", 380 | "vary": "~1.1.2" 381 | } 382 | }, 383 | "finalhandler": { 384 | "version": "1.1.2", 385 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 386 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 387 | "requires": { 388 | "debug": "2.6.9", 389 | "encodeurl": "~1.0.2", 390 | "escape-html": "~1.0.3", 391 | "on-finished": "~2.3.0", 392 | "parseurl": "~1.3.3", 393 | "statuses": "~1.5.0", 394 | "unpipe": "~1.0.0" 395 | } 396 | }, 397 | "forwarded": { 398 | "version": "0.2.0", 399 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 400 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" 401 | }, 402 | "fresh": { 403 | "version": "0.5.2", 404 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 405 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 406 | }, 407 | "function-bind": { 408 | "version": "1.1.1", 409 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 410 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 411 | }, 412 | "get-caller-file": { 413 | "version": "2.0.5", 414 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 415 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" 416 | }, 417 | "has": { 418 | "version": "1.0.3", 419 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 420 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 421 | "requires": { 422 | "function-bind": "^1.1.1" 423 | } 424 | }, 425 | "has-flag": { 426 | "version": "4.0.0", 427 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 428 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 429 | }, 430 | "hosted-git-info": { 431 | "version": "2.8.9", 432 | "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", 433 | "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" 434 | }, 435 | "http-errors": { 436 | "version": "1.7.2", 437 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 438 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 439 | "requires": { 440 | "depd": "~1.1.2", 441 | "inherits": "2.0.3", 442 | "setprototypeof": "1.1.1", 443 | "statuses": ">= 1.5.0 < 2", 444 | "toidentifier": "1.0.0" 445 | } 446 | }, 447 | "iconv-lite": { 448 | "version": "0.4.24", 449 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 450 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 451 | "requires": { 452 | "safer-buffer": ">= 2.1.2 < 3" 453 | } 454 | }, 455 | "inherits": { 456 | "version": "2.0.3", 457 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 458 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 459 | }, 460 | "ipaddr.js": { 461 | "version": "1.9.1", 462 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 463 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 464 | }, 465 | "is-arrayish": { 466 | "version": "0.2.1", 467 | "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", 468 | "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" 469 | }, 470 | "is-core-module": { 471 | "version": "2.5.0", 472 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz", 473 | "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==", 474 | "requires": { 475 | "has": "^1.0.3" 476 | } 477 | }, 478 | "is-fullwidth-code-point": { 479 | "version": "3.0.0", 480 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 481 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" 482 | }, 483 | "isarray": { 484 | "version": "1.0.0", 485 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 486 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 487 | }, 488 | "js-tokens": { 489 | "version": "4.0.0", 490 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 491 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 492 | }, 493 | "json-parse-even-better-errors": { 494 | "version": "2.3.1", 495 | "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", 496 | "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" 497 | }, 498 | "kareem": { 499 | "version": "2.3.2", 500 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", 501 | "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" 502 | }, 503 | "lines-and-columns": { 504 | "version": "1.1.6", 505 | "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", 506 | "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" 507 | }, 508 | "lodash": { 509 | "version": "4.17.21", 510 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 511 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 512 | }, 513 | "media-typer": { 514 | "version": "0.3.0", 515 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 516 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 517 | }, 518 | "memory-pager": { 519 | "version": "1.5.0", 520 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 521 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", 522 | "optional": true 523 | }, 524 | "merge-descriptors": { 525 | "version": "1.0.1", 526 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 527 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 528 | }, 529 | "methods": { 530 | "version": "1.1.2", 531 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 532 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 533 | }, 534 | "mime": { 535 | "version": "1.6.0", 536 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 537 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 538 | }, 539 | "mime-db": { 540 | "version": "1.48.0", 541 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", 542 | "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==" 543 | }, 544 | "mime-types": { 545 | "version": "2.1.31", 546 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", 547 | "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", 548 | "requires": { 549 | "mime-db": "1.48.0" 550 | } 551 | }, 552 | "mongodb": { 553 | "version": "3.6.10", 554 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.10.tgz", 555 | "integrity": "sha512-fvIBQBF7KwCJnDZUnFFy4WqEFP8ibdXeFANnylW19+vOwdjOAvqIzPdsNCEMT6VKTHnYu4K64AWRih0mkFms6Q==", 556 | "requires": { 557 | "bl": "^2.2.1", 558 | "bson": "^1.1.4", 559 | "denque": "^1.4.1", 560 | "optional-require": "^1.0.3", 561 | "safe-buffer": "^5.1.2", 562 | "saslprep": "^1.0.0" 563 | } 564 | }, 565 | "mongoose": { 566 | "version": "5.13.3", 567 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.3.tgz", 568 | "integrity": "sha512-q+zX6kqHAvwxf5speMWhq6qF4vdj+x6/kfD5RSKdZKNm52yGmaUygN+zgrtQjBZPFEzG0B3vF6GP0PoAGadE+w==", 569 | "requires": { 570 | "@types/mongodb": "^3.5.27", 571 | "@types/node": "14.x || 15.x", 572 | "bson": "^1.1.4", 573 | "kareem": "2.3.2", 574 | "mongodb": "3.6.10", 575 | "mongoose-legacy-pluralize": "1.0.2", 576 | "mpath": "0.8.3", 577 | "mquery": "3.2.5", 578 | "ms": "2.1.2", 579 | "regexp-clone": "1.0.0", 580 | "safe-buffer": "5.2.1", 581 | "sift": "13.5.2", 582 | "sliced": "1.0.1" 583 | }, 584 | "dependencies": { 585 | "ms": { 586 | "version": "2.1.2", 587 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 588 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 589 | }, 590 | "safe-buffer": { 591 | "version": "5.2.1", 592 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 593 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 594 | } 595 | } 596 | }, 597 | "mongoose-legacy-pluralize": { 598 | "version": "1.0.2", 599 | "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", 600 | "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" 601 | }, 602 | "morgan": { 603 | "version": "1.10.0", 604 | "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", 605 | "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", 606 | "requires": { 607 | "basic-auth": "~2.0.1", 608 | "debug": "2.6.9", 609 | "depd": "~2.0.0", 610 | "on-finished": "~2.3.0", 611 | "on-headers": "~1.0.2" 612 | }, 613 | "dependencies": { 614 | "depd": { 615 | "version": "2.0.0", 616 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 617 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" 618 | } 619 | } 620 | }, 621 | "mpath": { 622 | "version": "0.8.3", 623 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.8.3.tgz", 624 | "integrity": "sha512-eb9rRvhDltXVNL6Fxd2zM9D4vKBxjVVQNLNijlj7uoXUy19zNDsIif5zR+pWmPCWNKwAtqyo4JveQm4nfD5+eA==" 625 | }, 626 | "mquery": { 627 | "version": "3.2.5", 628 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.5.tgz", 629 | "integrity": "sha512-VjOKHHgU84wij7IUoZzFRU07IAxd5kWJaDmyUzQlbjHjyoeK5TNeeo8ZsFDtTYnSgpW6n/nMNIHvE3u8Lbrf4A==", 630 | "requires": { 631 | "bluebird": "3.5.1", 632 | "debug": "3.1.0", 633 | "regexp-clone": "^1.0.0", 634 | "safe-buffer": "5.1.2", 635 | "sliced": "1.0.1" 636 | }, 637 | "dependencies": { 638 | "debug": { 639 | "version": "3.1.0", 640 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 641 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 642 | "requires": { 643 | "ms": "2.0.0" 644 | } 645 | } 646 | } 647 | }, 648 | "ms": { 649 | "version": "2.0.0", 650 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 651 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 652 | }, 653 | "negotiator": { 654 | "version": "0.6.2", 655 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 656 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 657 | }, 658 | "normalize-package-data": { 659 | "version": "2.5.0", 660 | "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", 661 | "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", 662 | "requires": { 663 | "hosted-git-info": "^2.1.4", 664 | "resolve": "^1.10.0", 665 | "semver": "2 || 3 || 4 || 5", 666 | "validate-npm-package-license": "^3.0.1" 667 | } 668 | }, 669 | "on-finished": { 670 | "version": "2.3.0", 671 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 672 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 673 | "requires": { 674 | "ee-first": "1.1.1" 675 | } 676 | }, 677 | "on-headers": { 678 | "version": "1.0.2", 679 | "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", 680 | "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" 681 | }, 682 | "optional-require": { 683 | "version": "1.1.0", 684 | "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.1.0.tgz", 685 | "integrity": "sha512-5/7ee3eTFg1P+F9usTubuNCLfWRK6DjV0EFHLlbp7MmV5UlWqpWIVSnH6xo4u+fc5WHXaJuvJi6iuYnfDyj6oQ==", 686 | "requires": { 687 | "require-at": "^1.0.6" 688 | } 689 | }, 690 | "parse-json": { 691 | "version": "5.2.0", 692 | "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", 693 | "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", 694 | "requires": { 695 | "@babel/code-frame": "^7.0.0", 696 | "error-ex": "^1.3.1", 697 | "json-parse-even-better-errors": "^2.3.0", 698 | "lines-and-columns": "^1.1.6" 699 | } 700 | }, 701 | "parseurl": { 702 | "version": "1.3.3", 703 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 704 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 705 | }, 706 | "path-parse": { 707 | "version": "1.0.7", 708 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 709 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" 710 | }, 711 | "path-to-regexp": { 712 | "version": "0.1.7", 713 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 714 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 715 | }, 716 | "process-nextick-args": { 717 | "version": "2.0.1", 718 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 719 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 720 | }, 721 | "proxy-addr": { 722 | "version": "2.0.7", 723 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 724 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 725 | "requires": { 726 | "forwarded": "0.2.0", 727 | "ipaddr.js": "1.9.1" 728 | } 729 | }, 730 | "qs": { 731 | "version": "6.7.0", 732 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 733 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 734 | }, 735 | "range-parser": { 736 | "version": "1.2.1", 737 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 738 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 739 | }, 740 | "raw-body": { 741 | "version": "2.4.0", 742 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 743 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 744 | "requires": { 745 | "bytes": "3.1.0", 746 | "http-errors": "1.7.2", 747 | "iconv-lite": "0.4.24", 748 | "unpipe": "1.0.0" 749 | } 750 | }, 751 | "read-pkg": { 752 | "version": "5.2.0", 753 | "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", 754 | "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", 755 | "requires": { 756 | "@types/normalize-package-data": "^2.4.0", 757 | "normalize-package-data": "^2.5.0", 758 | "parse-json": "^5.0.0", 759 | "type-fest": "^0.6.0" 760 | } 761 | }, 762 | "readable-stream": { 763 | "version": "2.3.7", 764 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 765 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 766 | "requires": { 767 | "core-util-is": "~1.0.0", 768 | "inherits": "~2.0.3", 769 | "isarray": "~1.0.0", 770 | "process-nextick-args": "~2.0.0", 771 | "safe-buffer": "~5.1.1", 772 | "string_decoder": "~1.1.1", 773 | "util-deprecate": "~1.0.1" 774 | } 775 | }, 776 | "regexp-clone": { 777 | "version": "1.0.0", 778 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", 779 | "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" 780 | }, 781 | "require-at": { 782 | "version": "1.0.6", 783 | "resolved": "https://registry.npmjs.org/require-at/-/require-at-1.0.6.tgz", 784 | "integrity": "sha512-7i1auJbMUrXEAZCOQ0VNJgmcT2VOKPRl2YGJwgpHpC9CE91Mv4/4UYIUm4chGJaI381ZDq1JUicFii64Hapd8g==" 785 | }, 786 | "require-directory": { 787 | "version": "2.1.1", 788 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 789 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" 790 | }, 791 | "resolve": { 792 | "version": "1.20.0", 793 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", 794 | "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", 795 | "requires": { 796 | "is-core-module": "^2.2.0", 797 | "path-parse": "^1.0.6" 798 | } 799 | }, 800 | "rxjs": { 801 | "version": "6.6.7", 802 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", 803 | "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", 804 | "requires": { 805 | "tslib": "^1.9.0" 806 | } 807 | }, 808 | "safe-buffer": { 809 | "version": "5.1.2", 810 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 811 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 812 | }, 813 | "safer-buffer": { 814 | "version": "2.1.2", 815 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 816 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 817 | }, 818 | "saslprep": { 819 | "version": "1.0.3", 820 | "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", 821 | "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", 822 | "optional": true, 823 | "requires": { 824 | "sparse-bitfield": "^3.0.3" 825 | } 826 | }, 827 | "semver": { 828 | "version": "5.7.1", 829 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 830 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 831 | }, 832 | "send": { 833 | "version": "0.17.1", 834 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 835 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 836 | "requires": { 837 | "debug": "2.6.9", 838 | "depd": "~1.1.2", 839 | "destroy": "~1.0.4", 840 | "encodeurl": "~1.0.2", 841 | "escape-html": "~1.0.3", 842 | "etag": "~1.8.1", 843 | "fresh": "0.5.2", 844 | "http-errors": "~1.7.2", 845 | "mime": "1.6.0", 846 | "ms": "2.1.1", 847 | "on-finished": "~2.3.0", 848 | "range-parser": "~1.2.1", 849 | "statuses": "~1.5.0" 850 | }, 851 | "dependencies": { 852 | "ms": { 853 | "version": "2.1.1", 854 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 855 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 856 | } 857 | } 858 | }, 859 | "serve-static": { 860 | "version": "1.14.1", 861 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 862 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 863 | "requires": { 864 | "encodeurl": "~1.0.2", 865 | "escape-html": "~1.0.3", 866 | "parseurl": "~1.3.3", 867 | "send": "0.17.1" 868 | } 869 | }, 870 | "setprototypeof": { 871 | "version": "1.1.1", 872 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 873 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 874 | }, 875 | "sift": { 876 | "version": "13.5.2", 877 | "resolved": "https://registry.npmjs.org/sift/-/sift-13.5.2.tgz", 878 | "integrity": "sha512-+gxdEOMA2J+AI+fVsCqeNn7Tgx3M9ZN9jdi95939l1IJ8cZsqS8sqpJyOkic2SJk+1+98Uwryt/gL6XDaV+UZA==" 879 | }, 880 | "sliced": { 881 | "version": "1.0.1", 882 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 883 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 884 | }, 885 | "sparse-bitfield": { 886 | "version": "3.0.3", 887 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 888 | "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", 889 | "optional": true, 890 | "requires": { 891 | "memory-pager": "^1.0.2" 892 | } 893 | }, 894 | "spawn-command": { 895 | "version": "0.0.2-1", 896 | "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", 897 | "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=" 898 | }, 899 | "spdx-correct": { 900 | "version": "3.1.1", 901 | "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", 902 | "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", 903 | "requires": { 904 | "spdx-expression-parse": "^3.0.0", 905 | "spdx-license-ids": "^3.0.0" 906 | } 907 | }, 908 | "spdx-exceptions": { 909 | "version": "2.3.0", 910 | "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", 911 | "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" 912 | }, 913 | "spdx-expression-parse": { 914 | "version": "3.0.1", 915 | "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", 916 | "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", 917 | "requires": { 918 | "spdx-exceptions": "^2.1.0", 919 | "spdx-license-ids": "^3.0.0" 920 | } 921 | }, 922 | "spdx-license-ids": { 923 | "version": "3.0.9", 924 | "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", 925 | "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==" 926 | }, 927 | "statuses": { 928 | "version": "1.5.0", 929 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 930 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 931 | }, 932 | "string-width": { 933 | "version": "4.2.2", 934 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", 935 | "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", 936 | "requires": { 937 | "emoji-regex": "^8.0.0", 938 | "is-fullwidth-code-point": "^3.0.0", 939 | "strip-ansi": "^6.0.0" 940 | } 941 | }, 942 | "string_decoder": { 943 | "version": "1.1.1", 944 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 945 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 946 | "requires": { 947 | "safe-buffer": "~5.1.0" 948 | } 949 | }, 950 | "strip-ansi": { 951 | "version": "6.0.0", 952 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", 953 | "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", 954 | "requires": { 955 | "ansi-regex": "^5.0.0" 956 | } 957 | }, 958 | "stripe": { 959 | "version": "8.176.0", 960 | "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.176.0.tgz", 961 | "integrity": "sha512-0KCDo8TWFgeNWU7cPaqdjO2u2OSth0cmWYZmA7xsuxRCk7/lgWbJ/UbeSphx74cCIjFCmGuzDoNuNxqon9lEbg==", 962 | "requires": { 963 | "@types/node": ">=8.1.0", 964 | "qs": "^6.6.0" 965 | } 966 | }, 967 | "supports-color": { 968 | "version": "8.1.1", 969 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", 970 | "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", 971 | "requires": { 972 | "has-flag": "^4.0.0" 973 | } 974 | }, 975 | "toidentifier": { 976 | "version": "1.0.0", 977 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 978 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 979 | }, 980 | "tree-kill": { 981 | "version": "1.2.2", 982 | "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", 983 | "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==" 984 | }, 985 | "tslib": { 986 | "version": "1.14.1", 987 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", 988 | "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" 989 | }, 990 | "type-fest": { 991 | "version": "0.6.0", 992 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", 993 | "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" 994 | }, 995 | "type-is": { 996 | "version": "1.6.18", 997 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 998 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 999 | "requires": { 1000 | "media-typer": "0.3.0", 1001 | "mime-types": "~2.1.24" 1002 | } 1003 | }, 1004 | "unpipe": { 1005 | "version": "1.0.0", 1006 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1007 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 1008 | }, 1009 | "util-deprecate": { 1010 | "version": "1.0.2", 1011 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1012 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1013 | }, 1014 | "utils-merge": { 1015 | "version": "1.0.1", 1016 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1017 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1018 | }, 1019 | "uuid": { 1020 | "version": "8.3.2", 1021 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", 1022 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" 1023 | }, 1024 | "validate-npm-package-license": { 1025 | "version": "3.0.4", 1026 | "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", 1027 | "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", 1028 | "requires": { 1029 | "spdx-correct": "^3.0.0", 1030 | "spdx-expression-parse": "^3.0.0" 1031 | } 1032 | }, 1033 | "vary": { 1034 | "version": "1.1.2", 1035 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1036 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 1037 | }, 1038 | "wrap-ansi": { 1039 | "version": "7.0.0", 1040 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", 1041 | "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", 1042 | "requires": { 1043 | "ansi-styles": "^4.0.0", 1044 | "string-width": "^4.1.0", 1045 | "strip-ansi": "^6.0.0" 1046 | } 1047 | }, 1048 | "y18n": { 1049 | "version": "5.0.8", 1050 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", 1051 | "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" 1052 | }, 1053 | "yargs": { 1054 | "version": "16.2.0", 1055 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", 1056 | "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", 1057 | "requires": { 1058 | "cliui": "^7.0.2", 1059 | "escalade": "^3.1.1", 1060 | "get-caller-file": "^2.0.5", 1061 | "require-directory": "^2.1.1", 1062 | "string-width": "^4.2.0", 1063 | "y18n": "^5.0.5", 1064 | "yargs-parser": "^20.2.2" 1065 | } 1066 | }, 1067 | "yargs-parser": { 1068 | "version": "20.2.9", 1069 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", 1070 | "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" 1071 | } 1072 | } 1073 | } 1074 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "pizza backend", 5 | "main": "server.js", 6 | "engines": { 7 | "node": "14.18.0" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1", 11 | "start": "node server.js", 12 | "server": "nodemon server.js", 13 | "client": "npm start --prefix client", 14 | "dev": " concurrently \"npm run server\" \"npm run client\" ", 15 | "data:import": "node seeder.js", 16 | "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client" 17 | 18 | }, 19 | "author": "techinfo yt", 20 | "license": "MIT", 21 | "dependencies": { 22 | "colors": "^1.4.0", 23 | "concurrently": "^6.2.0", 24 | "dotenv": "^10.0.0", 25 | "express": "^4.17.1", 26 | "mongoose": "^5.13.3", 27 | "morgan": "^1.10.0", 28 | "stripe": "^8.176.0", 29 | "uuid": "^8.3.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /routes/orderRoute.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | const { v4: uuidv4 } = require("uuid"); 4 | const stripe = require("stripe")( 5 | "sk_test_51HT3awLRpPHpN9zViTDEbkof6MkC4qStmbuzVSwEUm05GbEZnd2a4WkgoI0lyBdF3JsF8zmgPQHue92gLGsMQmBe00cxfp61Uq" 6 | ); 7 | const Order = require("../models/orderModel"); 8 | 9 | router.post("/placeorder", async (req, res) => { 10 | const { token, subTotal, currentUser, cartItems } = req.body; 11 | try { 12 | const customer = await stripe.customers.create({ 13 | email: token.email, 14 | source: token.id, 15 | }); 16 | const payment = await stripe.charges.create( 17 | { 18 | amount: subTotal * 100, 19 | currency: "inr", 20 | customer: customer.id, 21 | receipt_email: token.email, 22 | }, 23 | { 24 | idempotencyKey: uuidv4(), 25 | } 26 | ); 27 | if (payment) { 28 | const newOrder = new Order({ 29 | name: currentUser.name, 30 | email: currentUser.email, 31 | userid: currentUser._id, 32 | orderItems: cartItems, 33 | orderAmount: subTotal, 34 | shippingAddress: { 35 | street: token.card.address_line1, 36 | city: token.card.address_city, 37 | country: token.card.address_country, 38 | picode: token.card.address_zip, 39 | }, 40 | transectionId: payment.source.id, 41 | }); 42 | newOrder.save(); 43 | res.send("Payment Success"); 44 | } else { 45 | res.send("Payment Faild"); 46 | } 47 | } catch (error) { 48 | res.status(400).json({ 49 | message: "Something went wrong", 50 | error: error.stack, 51 | }); 52 | } 53 | }); 54 | 55 | router.post("/getuserorder", async (req, res) => { 56 | const { userid } = req.body; 57 | try { 58 | const orders = await Order.find({ userid }).sort({ _id: "-1" }); 59 | res.status(200).send(orders); 60 | } catch (error) { 61 | res.status(400).json({ 62 | message: "Something Went Wront", 63 | error: error.stack, 64 | }); 65 | } 66 | }); 67 | 68 | router.get("/alluserorder", async (req, res) => { 69 | try { 70 | const orders = await Order.find({}); 71 | res.status(200).send(orders); 72 | } catch (error) { 73 | res.status(400).json({ 74 | message: "Something Went Wront", 75 | error: error.stack, 76 | }); 77 | } 78 | }); 79 | 80 | router.post("/deliverorder", async (req, res) => { 81 | const orderid = req.body.orderid; 82 | try { 83 | const order = await Order.findOne({ _id: orderid }); 84 | order.isDeliverd = true; 85 | await order.save(); 86 | res.status(200).send("Order deliverd success"); 87 | } catch (error) { 88 | res.status(400).json({ 89 | message: "Something Went Wront", 90 | error: error.stack, 91 | }); 92 | } 93 | }); 94 | module.exports = router; 95 | -------------------------------------------------------------------------------- /routes/pizzaRoute.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | const pizzaModel = require("../models/pizzaModel"); 4 | 5 | //GET ALL PIZZA || @GET REQUEST 6 | router.get("/getAllPizzas", async (req, res) => { 7 | try { 8 | const pizzas = await pizzaModel.find({}); 9 | res.send(pizzas); 10 | } catch (error) { 11 | res.json({ message: error }); 12 | } 13 | }); 14 | router.post("/addpizza", async (req, res) => { 15 | const pizza = req.body.pizza; 16 | try { 17 | const newPizza = new pizzaModel({ 18 | name: pizza.name, 19 | image: pizza.image, 20 | varients: ["small", "medium", "larg"], 21 | description: pizza.description, 22 | category: pizza.category, 23 | prices: [pizza.prices], 24 | }); 25 | await newPizza.save(); 26 | res.status(201).send("New Pizza Added"); 27 | } catch (error) { 28 | res.json({ message: error }); 29 | } 30 | }); 31 | 32 | router.post("/getpizzabyid", async (req, res) => { 33 | const pizzaId = req.body.pizzaId; 34 | try { 35 | const pizza = await pizzaModel.findOne({ _id: pizzaId }); 36 | res.send(pizza); 37 | } catch (error) { 38 | res.json({ message: error }); 39 | } 40 | }); 41 | 42 | router.post("/updatepizza", async (req, res) => { 43 | const updatedPizza = req.body.updatedPizza; 44 | try { 45 | const pizza = await pizzaModel.findOne({ _id: updatedPizza._id }); 46 | (pizza.name = updatedPizza.name), 47 | (pizza.description = updatedPizza.description), 48 | (pizza.image = updatedPizza.image), 49 | (pizza.category = updatedPizza.category), 50 | (pizza.prices = [updatedPizza.prices]); 51 | await pizza.save(); 52 | res.status(200).send("Pizza Update Success"); 53 | } catch (error) { 54 | res.status(400).json({ message: error }); 55 | } 56 | }); 57 | 58 | router.post("/deletepizza", async (req, res) => { 59 | const pizzaId = req.body.pizzaId; 60 | try { 61 | await pizzaModel.findOneAndDelete({ _id: pizzaId }); 62 | res.status(200).send("Pizza Deleted"); 63 | } catch (error) { 64 | res.status(404).json({ message: error }); 65 | } 66 | }); 67 | 68 | module.exports = router; 69 | -------------------------------------------------------------------------------- /routes/userRoutes.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const router = express.Router(); 3 | const User = require("../models/userModel"); 4 | 5 | router.post("/register", (req, res) => { 6 | const { name, email, password } = req.body; 7 | const newUser = new User({ name, email, password }); 8 | try { 9 | newUser.save(); 10 | res.status(200).json({ 11 | success: true, 12 | message: "Register success", 13 | }); 14 | } catch (error) { 15 | res.status(400).json({ 16 | message: error, 17 | }); 18 | } 19 | }); 20 | 21 | router.post("/login", async (req, res) => { 22 | const { email, password } = req.body; 23 | try { 24 | const user = await User.find({ email, password }); 25 | if (user.length > 0) { 26 | const currentUser = { 27 | name: user[0].name, 28 | email: user[0].email, 29 | isAdmin: user[0].isAdmin, 30 | _id: user[0].Id, 31 | }; 32 | res.status(200).send(currentUser); 33 | } else { 34 | res.status(400).json({ 35 | message: "Login Failed", 36 | }); 37 | } 38 | } catch (error) { 39 | res.status(404).json({ 40 | message: "Something Went wrong", 41 | }); 42 | } 43 | }); 44 | 45 | router.get("/getallusers", async (req, res) => { 46 | try { 47 | const users = await User.find({}); 48 | res.status(200).send(users); 49 | } catch (error) { 50 | res.status(404).json({ message: error.stack }); 51 | } 52 | }); 53 | 54 | router.post("/deleteuser", async (req, res) => { 55 | const userid = req.body.userid; 56 | try { 57 | await User.findOneAndDelete({ _id: userid }); 58 | res.status(200).send("User Deleted"); 59 | } catch (error) { 60 | res.status(404).json({ message: error.stack }); 61 | } 62 | }); 63 | module.exports = router; 64 | -------------------------------------------------------------------------------- /seeder.js: -------------------------------------------------------------------------------- 1 | const mogoose = require("mongoose"); 2 | const dotenv = require("dotenv"); 3 | require("colors"); 4 | const connectDb = require("./config/config"); 5 | const Pizza = require("./models/pizzaModel"); 6 | const Pizzas = require("./data/pizza-data"); 7 | 8 | //config dot env and mongodb conn file 9 | dotenv.config(); 10 | connectDb(); 11 | 12 | //import data 13 | const importData = async () => { 14 | try { 15 | await Pizza.deleteMany(); 16 | const sampleData = Pizzas.map((pizza) => { 17 | return { ...pizza }; 18 | }); 19 | await Pizza.insertMany(sampleData); 20 | console.log("DATA IMPOrted".bgGreen.white); 21 | process.exit(); 22 | } catch (error) { 23 | console.log(`${error}`.bgRed.white); 24 | process.exit(1); 25 | } 26 | }; 27 | 28 | const dataDestroy = () => {}; 29 | 30 | if (process.argv[2] === "-d") { 31 | dataDestroy(); 32 | } else { 33 | importData(); 34 | } 35 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const dotenv = require("dotenv"); 3 | const path = require("path"); 4 | 5 | const connectDB = require("./config/config"); 6 | require("colors"); 7 | const morgan = require("morgan"); 8 | 9 | //config dotenv 10 | dotenv.config(); 11 | 12 | //connection mongodb 13 | connectDB(); 14 | 15 | const app = express(); 16 | 17 | //middlewares 18 | app.use(express.json()); 19 | app.use(morgan("dev")); 20 | 21 | //route 22 | app.use("/api/pizzas", require("./routes/pizzaRoute")); 23 | app.use("/api/users", require("./routes/userRoutes")); 24 | app.use("/api/orders", require("./routes/orderRoute")); 25 | 26 | if (process.env.NODE_ENV === "production") { 27 | app.use(express.static(path.join(__dirname, "/client/build"))); 28 | app.get("*", (req, res) => { 29 | res.sendFile(path.resolve(__dirname, "client", "build", "index.html")); 30 | }); 31 | } else { 32 | app.get("/", (req, res) => { 33 | res.send("

Hello From Node Server vai nodemon

"); 34 | }); 35 | } 36 | 37 | const port = process.env.PORT || 8080; 38 | app.listen(port, () => { 39 | console.log( 40 | `Server Running On ${process.env.NODE_ENV} mode on port no ${process.env.PORT}` 41 | .bgMagenta.white 42 | ); 43 | }); 44 | --------------------------------------------------------------------------------