├── client ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ └── robots.txt └── src │ ├── App.css │ ├── App.js │ ├── App.test.js │ ├── components │ ├── Cancel.js │ ├── CardData.js │ ├── CartDetails.js │ ├── Headers.js │ ├── Home.js │ ├── Sucess.js │ ├── cartstyle.css │ └── style.css │ ├── index.css │ ├── index.js │ ├── logo.svg │ ├── redux │ ├── app │ │ └── store.js │ └── features │ │ └── cartSlice.js │ ├── reportWebVitals.js │ └── setupTests.js └── server ├── .gitignore ├── app.js ├── package-lock.json └── package.json /client/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /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 | ### `npm start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser. 13 | 14 | The page will reload when you make changes.\ 15 | You may also see any lint errors in the console. 16 | 17 | ### `npm 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 | ### `npm run 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 | ### `npm run 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 | ### `npm run 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 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@reduxjs/toolkit": "^1.9.5", 7 | "@stripe/stripe-js": "^2.1.0", 8 | "@testing-library/jest-dom": "^5.17.0", 9 | "@testing-library/react": "^13.4.0", 10 | "@testing-library/user-event": "^13.5.0", 11 | "bootstrap": "^5.3.1", 12 | "react": "^18.2.0", 13 | "react-bootstrap": "^2.8.0", 14 | "react-dom": "^18.2.0", 15 | "react-hot-toast": "^2.4.1", 16 | "react-redux": "^8.1.2", 17 | "react-router-dom": "^6.15.0", 18 | "react-scripts": "5.0.1", 19 | "web-vitals": "^2.1.4" 20 | }, 21 | "scripts": { 22 | "start": "react-scripts start", 23 | "build": "react-scripts build", 24 | "test": "react-scripts test", 25 | "eject": "react-scripts eject" 26 | }, 27 | "eslintConfig": { 28 | "extends": [ 29 | "react-app", 30 | "react-app/jest" 31 | ] 32 | }, 33 | "browserslist": { 34 | "production": [ 35 | ">0.2%", 36 | "not dead", 37 | "not op_mini all" 38 | ], 39 | "development": [ 40 | "last 1 chrome version", 41 | "last 1 firefox version", 42 | "last 1 safari version" 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh17112000/stripe_inreact_node/5b27d0c6bf1b2ea875d8432fc38323837d767b52/client/public/favicon.ico -------------------------------------------------------------------------------- /client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 20 | 29 | React App 30 | 31 | 32 | 33 |
34 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh17112000/stripe_inreact_node/5b27d0c6bf1b2ea875d8432fc38323837d767b52/client/public/logo192.png -------------------------------------------------------------------------------- /client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh17112000/stripe_inreact_node/5b27d0c6bf1b2ea875d8432fc38323837d767b52/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: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /client/src/App.js: -------------------------------------------------------------------------------- 1 | import Headers from './components/Headers'; 2 | import Home from './components/Home'; 3 | import CartDetails from './components/CartDetails'; 4 | import './App.css'; 5 | import 'bootstrap/dist/css/bootstrap.min.css'; 6 | import {Routes,Route} from "react-router-dom" 7 | import toast, { Toaster } from 'react-hot-toast'; 8 | import Sucess from './components/Sucess'; 9 | import Cancel from './components/Cancel'; 10 | 11 | function App() { 12 | return ( 13 | <> 14 | 15 | 16 | }/> 17 | }/> 18 | }/> 19 | }/> 20 | 21 | 22 | 23 | ); 24 | } 25 | 26 | export default App; 27 | -------------------------------------------------------------------------------- /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/components/Cancel.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Cancel = () => { 4 | return ( 5 |
Cancel
6 | ) 7 | } 8 | 9 | export default Cancel -------------------------------------------------------------------------------- /client/src/components/CardData.js: -------------------------------------------------------------------------------- 1 | const Cardsdata = [ 2 | { 3 | id: 1, 4 | dish: "punjabi", 5 | imgdata: "https://b.zmtcdn.com/data/pictures/9/18857339/8f53919f1175c08cf0f0371b73704f9b_o2_featured_v2.jpg?output-format=webp", 6 | address: "North Indian, Biryani, Mughlai", 7 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 8 | somedata: " 1175 + order placed from here recently", 9 | price: 350, 10 | rating: "3.8", 11 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 12 | qnty:0 13 | }, 14 | { 15 | id: 2, 16 | dish: "Jugaadi Adda vadapav", 17 | imgdata: "https://b.zmtcdn.com/data/pictures/chains/5/19295245/089cbcf1d3307542c72f77272556b28b_o2_featured_v2.jpg?output-format=webp", 18 | address: "Street Food", 19 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 20 | somedata: " 2525 + order placed from here recently", 21 | price: 25, 22 | rating: "3.9", 23 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 24 | qnty:0 25 | }, 26 | { 27 | id: 3, 28 | dish: "La Milano Pizza", 29 | imgdata: "https://b.zmtcdn.com/data/pictures/chains/1/19708611/10f90d4a69678d98662514d173b29665_o2_featured_v2.jpg", 30 | address: "Pizza, Fast Food, Pasta", 31 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 32 | somedata: " 650 + order placed from here recently", 33 | price: 70, 34 | rating: "4.2", 35 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 36 | qnty:0 37 | }, 38 | { 39 | id: 4, 40 | dish: "Momoman Momos", 41 | imgdata: "https://b.zmtcdn.com/data/pictures/chains/1/113401/59f29399060caefcc575d59dc9402ce8_o2_featured_v2.jpg", 42 | address: "Momos", 43 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 44 | somedata: " 300 + order placed from here recently", 45 | price: 70, 46 | rating: "3.8", 47 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 48 | qnty:0 49 | }, 50 | { 51 | id: 5, 52 | dish: "Jassi De Parathe", 53 | imgdata: "https://b.zmtcdn.com/data/pictures/chains/5/110225/3978e28854b7496dbef9496546734811_o2_featured_v2.jpg", 54 | address: "North Indian", 55 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 56 | somedata: "1050 + order placed from here recently", 57 | price: 210, 58 | rating: "4.0", 59 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 60 | qnty:0 61 | }, 62 | { 63 | id: 6, 64 | dish: "Spring Rolls", 65 | imgdata: "https://b.zmtcdn.com/data/pictures/5/113895/3c06f6fbb8f667a2537dfdb6f060dc8b_o2_featured_v2.jpg", 66 | address: "Wraps FastFood, Chines", 67 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 68 | somedata: " 1100 + order placed from here recently", 69 | price: 100, 70 | rating: "3.8", 71 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 72 | qnty:0 73 | }, 74 | { 75 | id: 7, 76 | dish: "Hocco Eatery", 77 | imgdata: "https://b.zmtcdn.com/data/pictures/chains/5/110155/811c01a5430d50d3260f77917da99e12_o2_featured_v2.jpg", 78 | address: "North Indian, Fast Food", 79 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 80 | somedata: "500 + order placed from here recently", 81 | price: 300, 82 | rating: "3.8", 83 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 84 | qnty:0 85 | }, 86 | { 87 | id: 8, 88 | dish: "Chai Wai", 89 | imgdata: "https://b.zmtcdn.com/data/pictures/3/18514413/0a17b72e9fec52a3ca736f4c2ea3646f_o2_featured_v2.jpg", 90 | address: "Tea, Coffee, Shake, Beverages", 91 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 92 | somedata: "500 + order placed from here recently", 93 | price: 100, 94 | rating: "3.2", 95 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 96 | qnty:0 97 | }, 98 | { 99 | id: 9, 100 | dish: "HL Frankie", 101 | imgdata: "https://b.zmtcdn.com/data/pictures/7/19639627/94c0a4cf15c02d3982d154e2c5dd8cbb_o2_featured_v2.jpg", 102 | address: "Burger, Sandwich, Fast Food", 103 | delimg: "https://b.zmtcdn.com/data/o2_assets/0b07ef18234c6fdf9365ad1c274ae0631612687510.png?output-format=webp", 104 | somedata: "2525 + order placed from here recently", 105 | price: 100, 106 | rating: "3.8", 107 | arrimg: "https://b.zmtcdn.com/data/o2_assets/4bf016f32f05d26242cea342f30d47a31595763089.png?output-format=webp", 108 | qnty:0 109 | }, 110 | ]; 111 | 112 | export default Cardsdata; -------------------------------------------------------------------------------- /client/src/components/CartDetails.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | import "./cartstyle.css" 3 | import { useDispatch, useSelector } from 'react-redux'; 4 | import { addToCart,removeToCart ,removeSingleIteams,emptycartIteam} from '../redux/features/cartSlice'; 5 | import toast from 'react-hot-toast'; 6 | import {loadStripe} from '@stripe/stripe-js'; 7 | 8 | 9 | const CartDetails = () => { 10 | 11 | const {carts} = useSelector((state)=>state.allCart); 12 | console.log(carts) 13 | 14 | const [totalprice,setPrice] = useState(0); 15 | const [totalquantity,setTotalQuantity] = useState(0); 16 | 17 | const dispatch = useDispatch(); 18 | 19 | // add to cart 20 | const handleIncrement = (e)=>{ 21 | dispatch(addToCart(e)) 22 | } 23 | 24 | // remove to cart 25 | const handleDecrement = (e)=>{ 26 | dispatch(removeToCart(e)); 27 | toast.success("Item Remove From Your Cart") 28 | } 29 | 30 | // remove single item 31 | const handleSingleDecrement = (e)=>{ 32 | dispatch(removeSingleIteams(e)) 33 | } 34 | 35 | // empty cart 36 | const emptycart = ()=>{ 37 | dispatch(emptycartIteam()) 38 | toast.success("Your Cart is Empty") 39 | 40 | } 41 | 42 | // count total price 43 | const total = ()=>{ 44 | let totalprice = 0 45 | carts.map((ele,ind)=>{ 46 | totalprice = ele.price * ele.qnty + totalprice 47 | }); 48 | setPrice(totalprice) 49 | } 50 | 51 | 52 | // count total quantity 53 | const countquantity = ()=>{ 54 | let totalquantity = 0 55 | carts.map((ele,ind)=>{ 56 | totalquantity = ele.qnty + totalquantity 57 | }); 58 | setTotalQuantity(totalquantity) 59 | } 60 | 61 | useEffect(()=>{ 62 | total() 63 | },[total]) 64 | 65 | useEffect(()=>{ 66 | countquantity() 67 | },[countquantity]); 68 | 69 | // payment integration 70 | const makePayment = async()=>{ 71 | const stripe = await loadStripe("ENTER YOUR PUBLISHABLE KEY"); 72 | 73 | const body = { 74 | products:carts 75 | } 76 | const headers = { 77 | "Content-Type":"application/json" 78 | } 79 | const response = await fetch("http://localhost:7000/api/create-checkout-session",{ 80 | method:"POST", 81 | headers:headers, 82 | body:JSON.stringify(body) 83 | }); 84 | 85 | const session = await response.json(); 86 | 87 | const result = stripe.redirectToCheckout({ 88 | sessionId:session.id 89 | }); 90 | 91 | if(result.error){ 92 | console.log(result.error); 93 | } 94 | } 95 | 96 | 97 | return ( 98 | <> 99 |
100 |
101 |
102 |
103 |
104 |
Cart Calculation{carts.length >0 ? `(${carts.length})`:""}
105 | { 106 | carts.length > 0 ? 109 | : "" 110 | } 111 |
112 | 113 |
114 |
115 | { 116 | carts.length === 0 ? 117 | 118 | 119 | 125 | 126 | 127 |
120 |
121 | 122 |

Your Cart Is Empty

123 |
124 |
: 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | { 141 | carts.map((data,index)=>{ 142 | return ( 143 | <> 144 | 145 | 150 | 151 | 152 | 153 | 166 | 167 | 168 | 169 | ) 170 | }) 171 | } 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 |
ActionProductNamePriceQty Total Amount
146 | 149 |

{data.dish}

{data.price} 154 |
155 | 160 | 161 | 164 |
165 |
₹ {data.qnty * data.price}
  Items In Cart :{totalquantity}Total Price:₹ {totalprice}
183 | } 184 |
185 |
186 |
187 |
188 | 189 | ) 190 | } 191 | 192 | export default CartDetails 193 | 194 | 195 | -------------------------------------------------------------------------------- /client/src/components/Headers.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Container from 'react-bootstrap/Container'; 3 | import Navbar from 'react-bootstrap/Navbar'; 4 | import { useSelector } from 'react-redux'; 5 | import { NavLink } from 'react-router-dom'; 6 | 7 | const Headers = () => { 8 | const {carts} = useSelector((state)=>state.allCart); 9 | 10 | 11 | return ( 12 | <> 13 | 14 | 15 | 16 |

Ecommerce

17 |
18 | 19 |
20 | 21 | 22 | 23 |
24 |
25 | 26 |
27 |
28 | 29 | ) 30 | } 31 | 32 | export default Headers -------------------------------------------------------------------------------- /client/src/components/Home.js: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import "./style.css" 3 | import Button from 'react-bootstrap/Button'; 4 | import Card from 'react-bootstrap/Card'; 5 | import CardsData from "./CardData"; 6 | import { addToCart } from '../redux/features/cartSlice'; 7 | import { useDispatch } from 'react-redux'; 8 | import toast from 'react-hot-toast'; 9 | 10 | 11 | const Home = () => { 12 | const [cartData, setCartData] = useState(CardsData); 13 | const dispatch = useDispatch(); 14 | 15 | 16 | // add to cart 17 | const send = (e)=>{ 18 | dispatch(addToCart(e)) 19 | toast.success("Item added In Your Cart") 20 | } 21 | return ( 22 | <> 23 |
24 |

Restaurants in Ahmedabad Open now

25 |
26 | { 27 | cartData.map((element, index) => { 28 | return ( 29 | <> 30 | 31 | 32 | 33 |
34 |
35 |

{element.dish}

36 | {element.rating} ★ 37 |
38 | 39 |
40 |
{element.address}
41 | ₹ {element.price} 42 |
43 |
44 | 45 |
46 | 47 | 51 | 52 | 53 |
54 |
55 |
56 | 57 | ) 58 | }) 59 | } 60 | 61 |
62 |
63 | 64 | ) 65 | } 66 | 67 | export default Home -------------------------------------------------------------------------------- /client/src/components/Sucess.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Sucess = () => { 4 | return ( 5 |
Sucess
6 | ) 7 | } 8 | 9 | export default Sucess -------------------------------------------------------------------------------- /client/src/components/cartstyle.css: -------------------------------------------------------------------------------- 1 | @import url(https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css); 2 | @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css); 3 | @import url("https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap"); 4 | 5 | /* body { 6 | background-color: #e0e3e8; 7 | font-family: "Rubik", sans-serif; 8 | font-size: 15px; 9 | font-weight: 400; 10 | line-height: 24px; 11 | color: #727E8C; 12 | } */ 13 | 14 | .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { 15 | color: #475F7B; 16 | } 17 | /* 18 | a, a:hover, a:focus { 19 | text-decoration: none; 20 | transition: 0.5s; 21 | outline: none; 22 | } */ 23 | 24 | /* ------------ */ 25 | 26 | .card { 27 | box-shadow: 0px 4px 8px rgb(0 0 0 / 16%); 28 | border-radius: 6px; 29 | overflow: hidden; 30 | margin-bottom: 30px; 31 | background-color: #fff; 32 | border: none; 33 | } 34 | .card-body { 35 | padding: 30px; 36 | } 37 | .btn-primary { 38 | border-color: #5a8dee !important; 39 | background-color: #5a8dee !important; 40 | color: #fff; 41 | } 42 | .btn-danger { 43 | border-color: #FF2829!important; 44 | background-color: #FF5B5C!important; 45 | color: #FFF; 46 | } 47 | .form-submit{ 48 | padding: 13px 30px; 49 | font-size: 15px; 50 | letter-spacing: 0.3px; 51 | font-weight: 400; 52 | } 53 | .card-header-flex { 54 | display: flex; 55 | align-items: center; 56 | justify-content: space-between; 57 | } 58 | .prdct-qty-container { 59 | display: flex; 60 | align-items: center; 61 | } 62 | 63 | .qty-input-box { 64 | max-width: 70px; 65 | padding: 0px 5px; 66 | min-height: 40px; 67 | border-radius: 4px; 68 | text-align: center; 69 | display: inline-block; 70 | margin: 0px 5px; 71 | color: #475F7B; 72 | background-color: #FFF; 73 | border: 1px solid #DFE3E7; 74 | transition: 0.3s; 75 | } 76 | 77 | .qty-input-box:focus { 78 | color: #475F7B; 79 | background-color: #FFF; 80 | border-color: #5A8DEE; 81 | outline: 0; 82 | box-shadow: 0 3px 8px 0 rgb(0 0 0 / 10%); 83 | } 84 | 85 | .prdct-qty-btn { 86 | width: 40px; 87 | height: 40px; 88 | border: none; 89 | border-radius: 4px; 90 | background-color: #5a8dee2e; 91 | color: #5a8dee; 92 | font-size: 11px; 93 | transition: 0.3s; 94 | } 95 | 96 | .prdct-qty-btn:hover { 97 | background-color: #5a8dee; 98 | color: #fff; 99 | } 100 | 101 | .product-img img { 102 | width: 40px; 103 | height: 40px; 104 | border-radius: 4px; 105 | } 106 | .card-header-flex{ 107 | display: flex; 108 | align-items: center; 109 | justify-content: space-between; 110 | } 111 | .prdct-delete { 112 | width: 40px; 113 | height: 40px; 114 | border: none; 115 | border-radius: 4px; 116 | background-color: #fde6e7; 117 | color: #ff5b5c; 118 | font-size: 15px; 119 | transition: 0.3s; 120 | } 121 | 122 | .prdct-delete:hover { 123 | background-color: #ff5b5c; 124 | color: #fff; 125 | } 126 | 127 | .cart-empty { 128 | text-align: center; 129 | padding: 30px; 130 | } 131 | 132 | .cart-empty i { 133 | font-size: 45px; 134 | color: #d5d6d8; 135 | margin-bottom: 10px; 136 | display: inline-block; 137 | } 138 | 139 | .cart-empty p { 140 | margin-bottom: 0; 141 | color: #bdbdbd; 142 | font-size: 16px; 143 | } 144 | 145 | .cart-table td, .cart-table th { 146 | vertical-align: middle; 147 | } -------------------------------------------------------------------------------- /client/src/components/style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,500;0,600;0,700;1,400;1,600&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,500&display=swap'); 2 | 3 | 4 | body{ 5 | font-family: 'Roboto', sans-serif; 6 | } 7 | 8 | .hove{ 9 | border-radius: 10px; 10 | cursor: pointer; 11 | } 12 | 13 | .hove:hover{ 14 | box-shadow: 0 0 10px 2px rgba(0,0,0,0.1); 15 | transition: .2s; 16 | } 17 | 18 | .cd{ 19 | border-radius: 16px; 20 | margin-top: 20px; 21 | height: 16rem; 22 | } 23 | 24 | .upper_data h4{ 25 | font-size: 18px; 26 | color: rgba(17,17,17,0.849); 27 | letter-spacing: .5px; 28 | font-weight: 500; 29 | } 30 | 31 | .upper_data span{ 32 | background-color: rgb(36,150,63); 33 | border-radius: 6px; 34 | color: #fff; 35 | text-align: center; 36 | font-size: 13px; 37 | font-weight: 600; 38 | padding: 2px 1px; 39 | width: 45px; 40 | } 41 | 42 | .lower_data h5{ 43 | font-size: 15px; 44 | letter-spacing: .4px; 45 | font-weight: 400; 46 | color:rgba(17,17,17,0.849) ; 47 | } 48 | 49 | .lower_data span{ 50 | font-size: 15px; 51 | letter-spacing: .4px; 52 | color:rgba(17,17,17,0.849) ; 53 | } 54 | 55 | .extra{ 56 | border-bottom: 1px solid rgba(17,17,17,0.449); 57 | } 58 | 59 | .last_data .limg{ 60 | width: 18px; 61 | } 62 | 63 | .last_data p{ 64 | font-size: 14px; 65 | margin-top: 18px; 66 | letter-spacing: .2px; 67 | color: rgba(17,17,17,0.849); 68 | } 69 | 70 | .last_data .laimg{ 71 | width: 45px; 72 | } 73 | 74 | #ex4 .p1[data-count]:after{ 75 | position:absolute; 76 | right:10%; 77 | top:8%; 78 | content: attr(data-count); 79 | font-size:40%; 80 | padding:.2em; 81 | border-radius:50%; 82 | line-height:1em; 83 | color: white; 84 | background:rgba(255,0,0,.85); 85 | text-align:center; 86 | min-width: 18px; 87 | } 88 | 89 | #ex4 .fa-stack{ 90 | width: 1.5em; 91 | } 92 | 93 | @media (max-width:600px){ 94 | .con{ 95 | flex-direction: column; 96 | align-items: center; 97 | } 98 | .last_data p{ 99 | font-size: 12px; 100 | } 101 | 102 | } -------------------------------------------------------------------------------- /client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /client/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import { BrowserRouter } from "react-router-dom" 6 | import { Provider } from 'react-redux'; 7 | import { store } from './redux/app/store'; 8 | 9 | const root = ReactDOM.createRoot(document.getElementById('root')); 10 | root.render( 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ); 19 | 20 | -------------------------------------------------------------------------------- /client/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/src/redux/app/store.js: -------------------------------------------------------------------------------- 1 | import { configureStore } from "@reduxjs/toolkit"; 2 | import cartSlice from "../features/cartSlice"; 3 | 4 | // create store 5 | export const store = configureStore({ 6 | reducer:{ 7 | allCart:cartSlice 8 | } 9 | }) -------------------------------------------------------------------------------- /client/src/redux/features/cartSlice.js: -------------------------------------------------------------------------------- 1 | import { createSlice } from "@reduxjs/toolkit" 2 | 3 | const initialState = { 4 | carts: [] 5 | } 6 | 7 | // card slice 8 | const cartSlice = createSlice({ 9 | name: "cartslice", 10 | initialState, 11 | reducers: { 12 | 13 | // add to cart 14 | addToCart: (state, action) => { 15 | 16 | const IteamIndex = state.carts.findIndex((iteam) => iteam.id === action.payload.id); 17 | 18 | if (IteamIndex >= 0) { 19 | state.carts[IteamIndex].qnty += 1 20 | } else { 21 | const temp = { ...action.payload, qnty: 1 } 22 | state.carts = [...state.carts, temp] 23 | 24 | } 25 | }, 26 | 27 | // remove perticular iteams 28 | removeToCart:(state,action)=>{ 29 | const data = state.carts.filter((ele)=>ele.id !== action.payload); 30 | state.carts = data 31 | }, 32 | 33 | // remove single iteams 34 | removeSingleIteams:(state,action)=>{ 35 | const IteamIndex_dec = state.carts.findIndex((iteam) => iteam.id === action.payload.id); 36 | 37 | if(state.carts[IteamIndex_dec].qnty >=1){ 38 | state.carts[IteamIndex_dec].qnty -= 1 39 | } 40 | 41 | }, 42 | 43 | // clear cart 44 | emptycartIteam:(state,action)=>{ 45 | state.carts = [] 46 | } 47 | } 48 | }); 49 | 50 | export const { addToCart,removeToCart,removeSingleIteams ,emptycartIteam} = cartSlice.actions; 51 | 52 | export default cartSlice.reducer; 53 | 54 | 55 | -------------------------------------------------------------------------------- /client/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /client/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | .env -------------------------------------------------------------------------------- /server/app.js: -------------------------------------------------------------------------------- 1 | require("dotenv").config(); 2 | const express = require("express"); 3 | const app = express(); 4 | const cors = require("cors"); 5 | const stripe = require("stripe")(process.env.STRIPE_SECRET); 6 | 7 | app.use(express.json()); 8 | app.use(cors()); 9 | 10 | // checkout api 11 | app.post("/api/create-checkout-session",async(req,res)=>{ 12 | const {products} = req.body; 13 | 14 | 15 | const lineItems = products.map((product)=>({ 16 | price_data:{ 17 | currency:"inr", 18 | product_data:{ 19 | name:product.dish, 20 | images:[product.imgdata] 21 | }, 22 | unit_amount:product.price * 100, 23 | }, 24 | quantity:product.qnty 25 | })); 26 | 27 | const session = await stripe.checkout.sessions.create({ 28 | payment_method_types:["card"], 29 | line_items:lineItems, 30 | mode:"payment", 31 | success_url:"http://localhost:3000/sucess", 32 | cancel_url:"http://localhost:3000/cancel", 33 | }); 34 | 35 | res.json({id:session.id}) 36 | 37 | }) 38 | 39 | 40 | app.listen(7000,()=>{ 41 | console.log("server start") 42 | }) -------------------------------------------------------------------------------- /server/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/node": { 8 | "version": "20.5.0", 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.0.tgz", 10 | "integrity": "sha512-Mgq7eCtoTjT89FqNoTzzXg2XvCi5VMhRV6+I2aYanc6kQCBImeNaAYRs/DyoVqk1YEUJK5gN9VO7HRIdz4Wo3Q==" 11 | }, 12 | "accepts": { 13 | "version": "1.3.8", 14 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 15 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 16 | "requires": { 17 | "mime-types": "~2.1.34", 18 | "negotiator": "0.6.3" 19 | } 20 | }, 21 | "array-flatten": { 22 | "version": "1.1.1", 23 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 24 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 25 | }, 26 | "body-parser": { 27 | "version": "1.20.1", 28 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 29 | "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", 30 | "requires": { 31 | "bytes": "3.1.2", 32 | "content-type": "~1.0.4", 33 | "debug": "2.6.9", 34 | "depd": "2.0.0", 35 | "destroy": "1.2.0", 36 | "http-errors": "2.0.0", 37 | "iconv-lite": "0.4.24", 38 | "on-finished": "2.4.1", 39 | "qs": "6.11.0", 40 | "raw-body": "2.5.1", 41 | "type-is": "~1.6.18", 42 | "unpipe": "1.0.0" 43 | } 44 | }, 45 | "bytes": { 46 | "version": "3.1.2", 47 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 48 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" 49 | }, 50 | "call-bind": { 51 | "version": "1.0.2", 52 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 53 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 54 | "requires": { 55 | "function-bind": "^1.1.1", 56 | "get-intrinsic": "^1.0.2" 57 | } 58 | }, 59 | "content-disposition": { 60 | "version": "0.5.4", 61 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 62 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 63 | "requires": { 64 | "safe-buffer": "5.2.1" 65 | } 66 | }, 67 | "content-type": { 68 | "version": "1.0.5", 69 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 70 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" 71 | }, 72 | "cookie": { 73 | "version": "0.5.0", 74 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", 75 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" 76 | }, 77 | "cookie-signature": { 78 | "version": "1.0.6", 79 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 80 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 81 | }, 82 | "cors": { 83 | "version": "2.8.5", 84 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 85 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 86 | "requires": { 87 | "object-assign": "^4", 88 | "vary": "^1" 89 | } 90 | }, 91 | "debug": { 92 | "version": "2.6.9", 93 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 94 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 95 | "requires": { 96 | "ms": "2.0.0" 97 | } 98 | }, 99 | "depd": { 100 | "version": "2.0.0", 101 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 102 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" 103 | }, 104 | "destroy": { 105 | "version": "1.2.0", 106 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 107 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" 108 | }, 109 | "dotenv": { 110 | "version": "16.3.1", 111 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", 112 | "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==" 113 | }, 114 | "ee-first": { 115 | "version": "1.1.1", 116 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 117 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" 118 | }, 119 | "encodeurl": { 120 | "version": "1.0.2", 121 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 122 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" 123 | }, 124 | "escape-html": { 125 | "version": "1.0.3", 126 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 127 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" 128 | }, 129 | "etag": { 130 | "version": "1.8.1", 131 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 132 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" 133 | }, 134 | "express": { 135 | "version": "4.18.2", 136 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", 137 | "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", 138 | "requires": { 139 | "accepts": "~1.3.8", 140 | "array-flatten": "1.1.1", 141 | "body-parser": "1.20.1", 142 | "content-disposition": "0.5.4", 143 | "content-type": "~1.0.4", 144 | "cookie": "0.5.0", 145 | "cookie-signature": "1.0.6", 146 | "debug": "2.6.9", 147 | "depd": "2.0.0", 148 | "encodeurl": "~1.0.2", 149 | "escape-html": "~1.0.3", 150 | "etag": "~1.8.1", 151 | "finalhandler": "1.2.0", 152 | "fresh": "0.5.2", 153 | "http-errors": "2.0.0", 154 | "merge-descriptors": "1.0.1", 155 | "methods": "~1.1.2", 156 | "on-finished": "2.4.1", 157 | "parseurl": "~1.3.3", 158 | "path-to-regexp": "0.1.7", 159 | "proxy-addr": "~2.0.7", 160 | "qs": "6.11.0", 161 | "range-parser": "~1.2.1", 162 | "safe-buffer": "5.2.1", 163 | "send": "0.18.0", 164 | "serve-static": "1.15.0", 165 | "setprototypeof": "1.2.0", 166 | "statuses": "2.0.1", 167 | "type-is": "~1.6.18", 168 | "utils-merge": "1.0.1", 169 | "vary": "~1.1.2" 170 | } 171 | }, 172 | "finalhandler": { 173 | "version": "1.2.0", 174 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 175 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 176 | "requires": { 177 | "debug": "2.6.9", 178 | "encodeurl": "~1.0.2", 179 | "escape-html": "~1.0.3", 180 | "on-finished": "2.4.1", 181 | "parseurl": "~1.3.3", 182 | "statuses": "2.0.1", 183 | "unpipe": "~1.0.0" 184 | } 185 | }, 186 | "forwarded": { 187 | "version": "0.2.0", 188 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 189 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" 190 | }, 191 | "fresh": { 192 | "version": "0.5.2", 193 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 194 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" 195 | }, 196 | "function-bind": { 197 | "version": "1.1.1", 198 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 199 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 200 | }, 201 | "get-intrinsic": { 202 | "version": "1.2.1", 203 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", 204 | "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", 205 | "requires": { 206 | "function-bind": "^1.1.1", 207 | "has": "^1.0.3", 208 | "has-proto": "^1.0.1", 209 | "has-symbols": "^1.0.3" 210 | } 211 | }, 212 | "has": { 213 | "version": "1.0.3", 214 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 215 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 216 | "requires": { 217 | "function-bind": "^1.1.1" 218 | } 219 | }, 220 | "has-proto": { 221 | "version": "1.0.1", 222 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", 223 | "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" 224 | }, 225 | "has-symbols": { 226 | "version": "1.0.3", 227 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 228 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" 229 | }, 230 | "http-errors": { 231 | "version": "2.0.0", 232 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 233 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 234 | "requires": { 235 | "depd": "2.0.0", 236 | "inherits": "2.0.4", 237 | "setprototypeof": "1.2.0", 238 | "statuses": "2.0.1", 239 | "toidentifier": "1.0.1" 240 | } 241 | }, 242 | "iconv-lite": { 243 | "version": "0.4.24", 244 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 245 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 246 | "requires": { 247 | "safer-buffer": ">= 2.1.2 < 3" 248 | } 249 | }, 250 | "inherits": { 251 | "version": "2.0.4", 252 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 253 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 254 | }, 255 | "ipaddr.js": { 256 | "version": "1.9.1", 257 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 258 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 259 | }, 260 | "media-typer": { 261 | "version": "0.3.0", 262 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 263 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" 264 | }, 265 | "merge-descriptors": { 266 | "version": "1.0.1", 267 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 268 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" 269 | }, 270 | "methods": { 271 | "version": "1.1.2", 272 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 273 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" 274 | }, 275 | "mime": { 276 | "version": "1.6.0", 277 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 278 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 279 | }, 280 | "mime-db": { 281 | "version": "1.52.0", 282 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 283 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" 284 | }, 285 | "mime-types": { 286 | "version": "2.1.35", 287 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 288 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 289 | "requires": { 290 | "mime-db": "1.52.0" 291 | } 292 | }, 293 | "ms": { 294 | "version": "2.0.0", 295 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 296 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" 297 | }, 298 | "negotiator": { 299 | "version": "0.6.3", 300 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 301 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" 302 | }, 303 | "object-assign": { 304 | "version": "4.1.1", 305 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 306 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" 307 | }, 308 | "object-inspect": { 309 | "version": "1.12.3", 310 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", 311 | "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" 312 | }, 313 | "on-finished": { 314 | "version": "2.4.1", 315 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 316 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 317 | "requires": { 318 | "ee-first": "1.1.1" 319 | } 320 | }, 321 | "parseurl": { 322 | "version": "1.3.3", 323 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 324 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 325 | }, 326 | "path-to-regexp": { 327 | "version": "0.1.7", 328 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 329 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 330 | }, 331 | "proxy-addr": { 332 | "version": "2.0.7", 333 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 334 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 335 | "requires": { 336 | "forwarded": "0.2.0", 337 | "ipaddr.js": "1.9.1" 338 | } 339 | }, 340 | "qs": { 341 | "version": "6.11.0", 342 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 343 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 344 | "requires": { 345 | "side-channel": "^1.0.4" 346 | } 347 | }, 348 | "range-parser": { 349 | "version": "1.2.1", 350 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 351 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 352 | }, 353 | "raw-body": { 354 | "version": "2.5.1", 355 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", 356 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", 357 | "requires": { 358 | "bytes": "3.1.2", 359 | "http-errors": "2.0.0", 360 | "iconv-lite": "0.4.24", 361 | "unpipe": "1.0.0" 362 | } 363 | }, 364 | "safe-buffer": { 365 | "version": "5.2.1", 366 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 367 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 368 | }, 369 | "safer-buffer": { 370 | "version": "2.1.2", 371 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 372 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 373 | }, 374 | "send": { 375 | "version": "0.18.0", 376 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 377 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 378 | "requires": { 379 | "debug": "2.6.9", 380 | "depd": "2.0.0", 381 | "destroy": "1.2.0", 382 | "encodeurl": "~1.0.2", 383 | "escape-html": "~1.0.3", 384 | "etag": "~1.8.1", 385 | "fresh": "0.5.2", 386 | "http-errors": "2.0.0", 387 | "mime": "1.6.0", 388 | "ms": "2.1.3", 389 | "on-finished": "2.4.1", 390 | "range-parser": "~1.2.1", 391 | "statuses": "2.0.1" 392 | }, 393 | "dependencies": { 394 | "ms": { 395 | "version": "2.1.3", 396 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 397 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 398 | } 399 | } 400 | }, 401 | "serve-static": { 402 | "version": "1.15.0", 403 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 404 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 405 | "requires": { 406 | "encodeurl": "~1.0.2", 407 | "escape-html": "~1.0.3", 408 | "parseurl": "~1.3.3", 409 | "send": "0.18.0" 410 | } 411 | }, 412 | "setprototypeof": { 413 | "version": "1.2.0", 414 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 415 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 416 | }, 417 | "side-channel": { 418 | "version": "1.0.4", 419 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 420 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 421 | "requires": { 422 | "call-bind": "^1.0.0", 423 | "get-intrinsic": "^1.0.2", 424 | "object-inspect": "^1.9.0" 425 | } 426 | }, 427 | "statuses": { 428 | "version": "2.0.1", 429 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 430 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" 431 | }, 432 | "stripe": { 433 | "version": "13.1.0", 434 | "resolved": "https://registry.npmjs.org/stripe/-/stripe-13.1.0.tgz", 435 | "integrity": "sha512-pA35HaqLP29xDzPR5RfJxTTa3ke4tj6DuH2YKq2MXPKEQzTyUzTfawDqkqs6fcJkv8nhyOQWb87KEjSRYgaUUQ==", 436 | "requires": { 437 | "@types/node": ">=8.1.0", 438 | "qs": "^6.11.0" 439 | } 440 | }, 441 | "toidentifier": { 442 | "version": "1.0.1", 443 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 444 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" 445 | }, 446 | "type-is": { 447 | "version": "1.6.18", 448 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 449 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 450 | "requires": { 451 | "media-typer": "0.3.0", 452 | "mime-types": "~2.1.24" 453 | } 454 | }, 455 | "unpipe": { 456 | "version": "1.0.0", 457 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 458 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" 459 | }, 460 | "utils-merge": { 461 | "version": "1.0.1", 462 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 463 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" 464 | }, 465 | "vary": { 466 | "version": "1.1.2", 467 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 468 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" 469 | } 470 | } 471 | } 472 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cors": "^2.8.5", 14 | "dotenv": "^16.3.1", 15 | "express": "^4.18.2", 16 | "stripe": "^13.1.0" 17 | } 18 | } 19 | --------------------------------------------------------------------------------