├── .DS_Store ├── .gitignore ├── README.md ├── app.js ├── bin └── www ├── config └── default.json ├── controllers ├── .DS_Store ├── admin_controller.js ├── login_controller.js └── sockect_controller.js ├── groceries.sql ├── helpers ├── db_helpers.js └── helpers.js ├── online_groceries.postman_collection.json ├── package-lock.json ├── package.json ├── public ├── .DS_Store ├── img │ ├── 202307271540184018GfPWltDhf7.png │ ├── 202307271540184018zTiLmW8DLh.png │ ├── 202307271541334133BWr6HpS5XM.png │ ├── 202307271541334133FB4SiUmser.png │ ├── 202307271542144214H4v0ZRggMF.png │ ├── 202307271542144214HqC7fMRTIY.png │ ├── 20230727154318431880O0w5WjdS.png │ ├── 202307271543184318ziFG4JXVxl.png │ ├── category │ │ ├── 20230726155407547qM5gSxkrCh.png │ │ ├── 202307261554435443I62l071lLA.png │ │ ├── 202307261555485548dKi8yJisIn.png │ │ ├── 20230731100233233AOuWmq6r64.png │ │ ├── 20230731100257257bPdXFaneYu.png │ │ ├── 20230731100322322vK4gHfIwCI.png │ │ └── 20230731100347347lrk8CyW57u.png │ ├── product │ │ ├── 20230727161106116DsCP0Lq5md.png │ │ ├── 202307310947354735xuruflIucc.png │ │ ├── 202307310951365136W6nJvPCdzQ.png │ │ ├── 202307310958175817ytVf7AVIOl.png │ │ ├── 202307311010091094RZ1nWHTug.png │ │ ├── 202307311011551155pIjIPWIb4w.png │ │ ├── 20230731101409149FomkojOsMt.png │ │ ├── 202307311018321832QsO9noUdBS.png │ │ └── 202307311022232223jrsJiejIQu.png │ └── type │ │ ├── 20230726160935935fZ46tYHZrf.png │ │ ├── 202307261610181018aVOpgmY1W1.png │ │ ├── 202307310959535953siLWeCJ71I.png │ │ └── 202307311000160168a0737aEiC.png └── stylesheets │ └── style.css ├── routes ├── index.js └── users.js └── views ├── error.ejs └── index.ejs /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ultimate Online Groceries Shop App Node.js Express Js REST Api With MySQL & Socket.io - Shop Smart, Save Time 2 | 3 | # codeforany @codeforany 4 | 5 | - [Youtube Channel: @codeforany](https://www.youtube.com/channel/UCdQTp9wRK5vAOlEQZf9PHSg) 6 | - [Youtube Channel Subscribe: @codeforany](https://www.youtube.com/channel/UCdQTp9wRK5vAOlEQZf9PHSg?sub_confirmation=1) 7 | 8 | Welcome to this comprehensive tutorial where we'll build an efficient and user-friendly Online Groceries Shop App called "Shop Smart, Save Time." In this tutorial, we'll cover everything you need to know about developing the backend of the app using Node.js, Express.js, MySQL, and Socket.io. With this powerful combination, we'll create a robust REST API to handle user interactions and real-time updates, making the shopping experience seamless and engaging. 9 | 10 | ⚙️ Technologies used: Node.js, Express.js, MySQL, Socket.io 11 | 12 | 🚀 Key Features of the Online Groceries Shop App: 13 | 14 | User Registration & Authentication: Create an account and securely log in. 15 | Browse Grocery Products: Explore a wide range of grocery items with detailed information. 16 | Add to Cart & Checkout: Easily add items to your cart and proceed to checkout. 17 | Real-Time Updates: Stay informed with real-time order status and updates. 18 | Secure Payment: Make hassle-free and secure payments. 19 | Order Tracking: Track your orders for better convenience. 20 | 🔥 Follow this step-by-step tutorial to learn how to develop the backend of the Online Groceries Shop App. Whether you're a beginner or an experienced developer, this tutorial will guide you through building a powerful and scalable REST API with Node.js, Express.js, MySQL, and Socket.io. 21 | 22 | 👍 Don't forget to like the video, subscribe to the channel, and hit the notification bell to stay updated on more exciting tutorials. 23 | 24 | 🙏 Thank you for joining us on this learning journey! We're thrilled to have you with us as we create an innovative shopping app together. 25 | 26 | - [Youtube Full Playlist: Online Grocery Shopping Node REST Api Playlist](https://www.youtube.com/playlist?list=PLzcRC7PA0xWQiIgIL526ZAxxVdSZMwx3l) 27 | 28 | - [Youtube Video - 1: Online Groceries Shop App Database And Table Create, Login Api & SignUp Api ](https://youtu.be/d61iFh0mTBI) 29 | - [Youtube Video - 2: Online Groceries Shop App Product Management & Admin APIs ](https://youtu.be/V5y4Km9890c) 30 | - [Youtube Video - 3: Build an Online Groceries Shop App | Node.js Express REST API | Product Management & Admin APIs ](https://youtu.be/9CUk-CJC9Uc) 31 | - [Youtube Video - 4: Zone/Area Management APIs ](https://youtu.be/ifAlKg9p4Wk) 32 | - [Youtube Video - 5: Admin APIs Product Offer Api & App APIs Home Screen , Product Details Api ](https://youtu.be/1mEsFL_G6ZI) 33 | - [Youtube Video - 6: App APIs Favorite Operations & Explore Screen APIs ](https://youtu.be/y3XPzlkwAu4) 34 | - [Youtube Video - 7: App APIs Cart Management APIs ](https://youtu.be/POh4OQyplpQ) 35 | - [Youtube Video - 8: App APIs Delivery Address Add,Update,Remove,Mark Default And List APIs ](https://youtu.be/SQ-Bae-EoeU) 36 | - [Youtube Video - 9: Promo Code Management Admin & App APIs](https://youtu.be/KhLntWV2Vo4) 37 | - [Youtube Video - 10: User Payment Methods & App APIs](https://youtu.be/gR5UG4r2mL0) 38 | - [Youtube Video - 11: User Order Place & Payment Verification App APIs](https://youtu.be/wnYROZAXd1w) 39 | - [Youtube Video - 12: My Order List & Order Detail App APIs](https://youtu.be/fvr5doOnMoU) 40 | - [Youtube Video - 13: New Order List, Complete Order List, Cancel Order List, Order Detail & Order Status Change with User Notification Admin APIs](https://youtu.be/YXBUmLL-Gyk) 41 | - [Youtube Video - 14: Notification & User Account Management App APIs](https://youtu.be/ZutxwvDBJWQ) 42 | 43 | ## Node.js Express Js Api Base Setup With MySQL & Socket.io 44 | - [Youtube Full Playlist: Node.js Express Js With REST Api & Socket.io Api ](https://www.youtube.com/playlist?list=PLzcRC7PA0xWRlYXalCqTqoC6csqUIJWCa) 45 | - [Youtube Video - 1: Node Express Api Base Setup With MySQL Connection POST Method Api ](https://youtu.be/kmcd231SVIo) 46 | - [Youtube Video - 2: Socket Connection & Socket Emit & Event On Listen Api With Flutter Mobile App ](https://youtu.be/FWKYqs-eaAE) 47 | - [Youtube Video - 3: Node Express Create Multipart/Form-Data Api With Multiple Image Upload Api ](https://youtu.be/ec2_v1zXbiQ) 48 | 49 | ## Ultimate Online Groceries Shop App Convent Into Flutter - Shop Smart, Save Time 50 | - [Youtube Full Playlist: Online Grocery Shopping Flutter Code Playlist](https://www.youtube.com/playlist?list=PLzcRC7PA0xWR2TZ4f34X8Q_fvdwwRvm9I) 51 | - [Youtube Video Part-1: App Induction, Welcome UI](https://youtu.be/1oV3BCOmOyE) 52 | - [Youtube Video Part-2: Sign Up, Sign In, Select Location & Verification ](https://youtu.be/0A9q0olE99w) 53 | - [Youtube Video Part-3: Home Tab, Search Shop & Product Detail UI](https://youtu.be/kqHjP2NVttQ) 54 | - [Youtube Video Part-4: Explore, Search, Filter & List UI ](https://youtu.be/gW33JfWXMSI) 55 | - [Youtube Video Part-5: My Cart, Checkout, Favorite UI ](https://youtu.be/6vQfWiz3Uwc) 56 | - [Youtube Video Part-6: Account, Order Accept, Order Place Error UI ](https://youtu.be/IdngLomODh4) 57 | 58 | #OnlineGroceriesShop #NodeJS #ExpressJS #MySQL #SocketIO #RESTAPI #ShopSmartSaveTime #BackendDevelopment #WebDevelopment #ProgrammingTutorial #MobileAppDevelopment #OnlineShoppingApp #WebAppDevelopment #BackendAPI #NodeExpressMySQL #RealTimeUpdates #SecurePayment #OrderTracking #WebAPI #NodeJSExpressTutorial #SocketIOTutorial #NodeJSMySQL #ShopSmart #SaveTime #BackendDeveloper #CodingInNodeJS #ExpressJSTutorial #RESTfulAPI #ThankYouMessage 59 | 60 | 61 | A new node express project. 62 | ## Getting Started 63 | 64 | [Node.js Download](https://nodejs.org/en) & [Node.js installing](https://nodejs.org/en/docs/guides/getting-started-guide) 65 | 66 | [Express Installing & generator](https://expressjs.com/en/starter/generator.html): 67 | sudo npm install -g express-generator 68 | 69 | # Node App Create: 70 | 71 | 1) express --view=ejs (app_name) 72 | 2) sudo npm audit fix --force 73 | 74 | ## Install dependencies: 75 | 1) npm i -s config 76 | 2) npm i -s cors 77 | 3) npm i -s moment-timezone 78 | 4) npm i -s multiparty 79 | 5) npm i -s socket.io 80 | 6) npm i -s uuid 81 | 82 | ## Node app run: 83 | node app.js -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var createError = require('http-errors'); 2 | var express = require('express'); 3 | var path = require('path'); 4 | var cookieParser = require('cookie-parser'); 5 | var logger = require('morgan'); 6 | 7 | const cors = require('cors'); 8 | var fs = require('fs'); 9 | 10 | var indexRouter = require('./routes/index'); 11 | var usersRouter = require('./routes/users'); 12 | 13 | var app = express(); 14 | var server = require('http').createServer(app); 15 | var io = require('socket.io')(server, { 16 | cors: { 17 | origin: "http://localhost:4200", 18 | methods: ["GET", "POST"] 19 | } 20 | }) 21 | var serverPort = 3001; 22 | 23 | var user_socket_connect_list = []; 24 | 25 | // view engine setup 26 | app.set('views', path.join(__dirname, 'views')); 27 | app.set('view engine', 'ejs'); 28 | 29 | app.use(logger('dev')); 30 | app.use(express.json({ limit: '100mb' })); 31 | app.use(express.urlencoded({ extended: true, limit: '100mb' })); 32 | app.use(cookieParser()); 33 | app.use(express.static(path.join(__dirname, 'public'))); 34 | 35 | app.use('/', indexRouter); 36 | app.use('/users', usersRouter); 37 | 38 | const corsOptions = { 39 | origin: "http://localhost:4200", 40 | } 41 | 42 | app.use(cors(corsOptions)); 43 | 44 | // import express inside dynamic added. 45 | fs.readdirSync('./controllers').forEach((file) => { 46 | if (file.substr(-3) == ".js") { 47 | route = require('./controllers/' + file); 48 | route.controller(app, io, user_socket_connect_list); 49 | } 50 | }) 51 | 52 | // catch 404 and forward to error handler 53 | app.use(function (req, res, next) { 54 | next(createError(404)); 55 | }); 56 | 57 | // error handler 58 | app.use(function (err, req, res, next) { 59 | // set locals, only providing error in development 60 | res.locals.message = err.message; 61 | res.locals.error = req.app.get('env') === 'development' ? err : {}; 62 | 63 | // render the error page 64 | res.status(err.status || 500); 65 | res.render('error'); 66 | }); 67 | 68 | module.exports = app; 69 | 70 | server.listen(serverPort); 71 | 72 | console.log("Server Start : " + serverPort ); 73 | 74 | Array.prototype.swap = (x, y) => { 75 | var b = this[x]; 76 | this[x] = this[y]; 77 | this[y] = b; 78 | return this; 79 | } 80 | 81 | Array.prototype.insert = (index, item) => { 82 | this.splice(index, 0, item); 83 | } 84 | 85 | Array.prototype.replace_null = (replace = '""') => { 86 | return JSON.parse(JSON.stringify(this).replace(/null/g, replace)); 87 | } 88 | 89 | String.prototype.replaceAll = (search, replacement) => { 90 | var target = this; 91 | return target.replace(new RegExp(search, 'g'), replacement); 92 | } 93 | -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('food-delivery:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "dbConfig": { 3 | "host":"localhost", 4 | "user":"root", 5 | "password":"", 6 | "database":"groceries", 7 | "multipleStatements": true, 8 | "timezone":"utc+5:30", 9 | "charset":"utf8mb4" 10 | } 11 | } -------------------------------------------------------------------------------- /controllers/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/controllers/.DS_Store -------------------------------------------------------------------------------- /controllers/login_controller.js: -------------------------------------------------------------------------------- 1 | var db = require('./../helpers/db_helpers') 2 | var helper = require('./../helpers/helpers') 3 | // var multiparty = require(multiparty) 4 | var imageSavePath = "./public/img/" 5 | var image_base_url = helper.ImagePath(); 6 | 7 | var deliver_price = 2.0 8 | 9 | module.exports.controller = (app, io, socket_list) => { 10 | 11 | const msg_success = "successfully"; 12 | const msg_fail = "fail"; 13 | const msg_invalidUser = "invalid username and password"; 14 | const msg_already_register = "this email already register "; 15 | const msg_added_favorite = "add favorite list successfully"; 16 | const msg_removed_favorite = "removed favorite list successfully"; 17 | const msg_invalid_item = "invalid product item"; 18 | const msg_add_to_item = "item added into cart successfully "; 19 | const msg_remove_to_cart = "item remove form cart successfully" 20 | const msg_add_address = "address added successfully" 21 | const msg_update_address = "address updated successfully" 22 | const msg_remove_address = "address removed successfully" 23 | 24 | const msg_add_payment_method = "payment method added successfully" 25 | const msg_remove_payment_method = "payment method removed successfully" 26 | 27 | app.post('/api/app/login', (req, res) => { 28 | helper.Dlog(req.body); 29 | var reqObj = req.body; 30 | 31 | helper.CheckParameterValid(res, reqObj, ["email", "password", "dervice_token"], () => { 32 | 33 | var auth_token = helper.createRequestToken(); 34 | db.query("UPDATE `user_detail` SET `auth_token`= ?,`dervice_token`=?,`modify_date`= NOW() WHERE `user_type` = ? AND `email` = ? AND `password` = ? AND `status` = ?", [auth_token, reqObj.dervice_token, "1", reqObj.email, reqObj.password, "1"], (err, result) => { 35 | 36 | if (err) { 37 | helper.ThrowHtmlError(err, res); 38 | return 39 | } 40 | 41 | if (result.affectedRows > 0) { 42 | 43 | 44 | db.query('SELECT `user_id`, `username`, `name`, `email`, `mobile`, `mobile_code`,`auth_token`, `status`, `created_date` FROM `user_detail` WHERE `email` = ? AND `password` = ? AND `status` = "1" ', [reqObj.email, reqObj.password], (err, result) => { 45 | 46 | if (err) { 47 | helper.ThrowHtmlError(err, res); 48 | return 49 | } 50 | 51 | if (result.length > 0) { 52 | res.json({ "status": "1", "payload": result[0], "message": msg_success }) 53 | } else { 54 | res.json({ "status": "0", "message": msg_invalidUser }) 55 | } 56 | }) 57 | } else { 58 | res.json({ "status": "0", "message": msg_invalidUser }) 59 | } 60 | 61 | }) 62 | }) 63 | }) 64 | 65 | app.post('/api/app/sign_up', (req, res) => { 66 | helper.Dlog(req.body); 67 | var reqObj = req.body; 68 | 69 | helper.CheckParameterValid(res, reqObj, ["username", "email", "password", "dervice_token"], () => { 70 | 71 | db.query('SELECT `user_id`, `status` FROM `user_detail` WHERE `email` = ? ', [reqObj.email], (err, result) => { 72 | 73 | if (err) { 74 | helper.ThrowHtmlError(err, res); 75 | return 76 | } 77 | 78 | if (result.length > 0) { 79 | res.json({ "status": "1", "payload": result[0], "message": msg_already_register }) 80 | } else { 81 | 82 | var auth_token = helper.createRequestToken(); 83 | db.query("INSERT INTO `user_detail`( `username`, `email`, `password`, `auth_token`, `dervice_token`, `created_date`, `modify_date`) VALUES (?,?,?, ?,?, NOW(), NOW())", [reqObj.username, reqObj.email, reqObj.password, auth_token, reqObj.dervice_token], (err, result) => { 84 | if (err) { 85 | helper.ThrowHtmlError(err, res); 86 | return 87 | } 88 | 89 | if (result) { 90 | db.query('SELECT `user_id`, `username`, `name`, `email`, `mobile`, `mobile_code`, `password`, `auth_token`, `status`, `created_date` FROM `user_detail` WHERE `user_id` = ? AND `status` = "1" ', [result.insertId], (err, result) => { 91 | 92 | if (err) { 93 | helper.ThrowHtmlError(err, res); 94 | return 95 | } 96 | 97 | if (result.length > 0) { 98 | res.json({ "status": "1", "payload": result[0], "message": msg_success }) 99 | } else { 100 | res.json({ "status": "0", "message": msg_invalidUser }) 101 | } 102 | }) 103 | } else { 104 | res.json({ "status": "0", "message": msg_fail }) 105 | } 106 | }) 107 | 108 | } 109 | }) 110 | }) 111 | }) 112 | 113 | app.post('/api/app/get_zone_area', (req, res) => { 114 | helper.Dlog(req.body); 115 | var reqObj = req.body; 116 | 117 | db.query("SELECT `zone_id`, `name` FROM `zone_detail` WHERE `status`= ? ;" + 118 | "SELECT `ad`.`area_id`, `ad`.`zone_id` , `ad`.`name`, `zd`.`name` AS `zone_name` FROM `area_detail` AS `ad` " + 119 | "INNER JOIN `zone_detail` AS `zd` ON `zd`.`zone_id` = `ad`.`zone_id` AND `zd`.`status` = '1' " + 120 | "WHERE `ad`.`status`= ?", ["1", "1"], (err, result) => { 121 | 122 | if (err) { 123 | helper.ThrowHtmlError(err, res); 124 | return; 125 | } 126 | 127 | result[0].forEach(zObj => { 128 | zObj.area_list = result[1].filter((aObj) => { 129 | return aObj.zone_id == zObj.zone_id 130 | }); 131 | }); 132 | 133 | res.json({ "status": "1", "payload": result[0], "message": msg_success }) 134 | 135 | }) 136 | 137 | }) 138 | 139 | app.post('/api/app/home', (req, res) => { 140 | helper.Dlog(req.body); 141 | var reqObj = req.body; 142 | checkAccessToken(req.headers, res, (uObj) => { 143 | 144 | db.query("SELECT `od`.`price` as `offer_price`, `od`.`start_date`, `od`.`end_date`, `pd`.`prod_id`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`,(CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image` , `cd`.`cat_name`, `td`.`type_name`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav`, AVG( CASE WHEN `rd`.`rate` IS NOT NULL THEN `rd`.`rate` ELSE 0 END ) AS `avg_rating` FROM `offer_detail` AS `od` " + 145 | "INNER JOIN `product_detail` AS `pd` ON `pd`.`prod_id` = `od`.`prod_id` AND `pd`.`status` = ? " + 146 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 147 | "INNER JOIN `category_detail` AS `cd` ON `cd`.`cat_id` = `pd`.`cat_id` AND `cd`.`status` = 1 " + 148 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`user_id` = ? AND `fd`.`status`= 1 " + 149 | "LEFT JOIN `review_detail` AS `rd` ON `rd`.`prod_id` = `pd`.`prod_id` " + 150 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` AND `td`.`status` = 1 " + 151 | "WHERE `od`.`status` = ? AND `od`.`start_date` <= NOW() AND `od`.`end_date` >= NOW() GROUP BY `pd`.`prod_id` ;" + 152 | 153 | "SELECT `pd`.`prod_id`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image`, `cd`.`cat_name`, `td`.`type_name`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav`, AVG( CASE WHEN `rd`.`rate` IS NOT NULL THEN `rd`.`rate` ELSE 0 END ) AS `avg_rating` FROM `product_detail` AS `pd` " + 154 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`user_id` = ? AND `fd`.`status`= 1 " + 155 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 156 | "INNER JOIN `category_detail` AS `cd` ON `cd`.`cat_id` = `pd`.`cat_id` AND `cd`.`status` = 1 " + 157 | "LEFT JOIN `review_detail` AS `rd` ON `rd`.`prod_id` = `pd`.`prod_id` " + 158 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` AND `td`.`status` = 1 " + 159 | "WHERE `pd`.`status` = ? AND `pd`.`cat_id` = ? GROUP BY `pd`.`prod_id` ;" + 160 | 161 | "SELECT `type_id`, `type_name`, (CASE WHEN `image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `image` ) ELSE '' END) AS `image` , `color` FROM `type_detail` WHERE `status` = ? ;" + 162 | 163 | "SELECT `pd`.`prod_id`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image`, `cd`.`cat_name`, `td`.`type_name`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav`, AVG( CASE WHEN `rd`.`rate` IS NOT NULL THEN `rd`.`rate` ELSE 0 END ) AS `avg_rating` FROM `product_detail` AS `pd` " + 164 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`user_id` = ? AND `fd`.`status`= 1 " + 165 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 166 | "INNER JOIN `category_detail` AS `cd` ON `cd`.`cat_id` = `pd`.`cat_id` AND `cd`.`status` = 1 " + 167 | "LEFT JOIN `review_detail` AS `rd` ON `rd`.`prod_id` = `pd`.`prod_id` " + 168 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` AND `td`.`status` = 1 " + 169 | "WHERE `pd`.`status` = ? GROUP BY `pd`.`prod_id` ORDER BY `pd`.`prod_id` DESC LIMIT 4 ;", [ 170 | 171 | "1", uObj.user_id, "1", 172 | uObj.user_id, "1", "1", 173 | "1", 174 | uObj.user_id, "1" 175 | ], (err, result) => { 176 | if (err) { 177 | helper.ThrowHtmlError(err, res); 178 | return; 179 | } 180 | 181 | res.json({ 182 | "status": "1", "payload": { 183 | "offer_list": result[0], 184 | "best_sell_list": result[1], 185 | "type_list": result[2], 186 | "list": result[3], 187 | }, "message": msg_success 188 | }) 189 | }) 190 | 191 | }, "1") 192 | }) 193 | 194 | app.post('/api/app/product_detail', (req, res) => { 195 | helper.Dlog(req.body); 196 | var reqObj = req.body; 197 | checkAccessToken(req.headers, res, (uObj) => { 198 | helper.CheckParameterValid(res, reqObj, ["prod_id"], () => { 199 | 200 | getProductDetail(res, reqObj.prod_id, uObj.user_id); 201 | 202 | }) 203 | }, "1") 204 | 205 | }) 206 | 207 | app.post('/api/app/add_remove_favorite', (req, res) => { 208 | helper.Dlog(req.body) 209 | var reqObj = req.body; 210 | 211 | checkAccessToken(req.headers, res, (userObj) => { 212 | helper.CheckParameterValid(res, reqObj, ["prod_id"], () => { 213 | db.query("SELECT `fav_id`, `prod_id` FROM `favorite_detail` WHERE `prod_id` = ? AND `user_id` = ? AND `status` = '1' ", [reqObj.prod_id, userObj.user_id], (err, result) => { 214 | if (err) { 215 | helper.ThrowHtmlError(err, res); 216 | return 217 | } 218 | 219 | if (result.length > 0) { 220 | // Already add Favorite List To Delete Fave 221 | db.query("DELETE FROM `favorite_detail` WHERE `prod_id` = ? AND `user_id` = ? ", [reqObj.prod_id, userObj.user_id], (err, result) => { 222 | 223 | if (err) { 224 | helper.ThrowHtmlError(err, res); 225 | return 226 | } else { 227 | res.json({ 228 | "status": "1", 229 | "message": msg_removed_favorite 230 | }) 231 | } 232 | }) 233 | 234 | } else { 235 | // Not Added Favorite List TO Add 236 | db.query("INSERT INTO `favorite_detail`(`prod_id`, `user_id`) VALUES (?,?) ", [ 237 | reqObj.prod_id, userObj.user_id 238 | ], (err, result) => { 239 | if (err) { 240 | helper.ThrowHtmlError(err, res); 241 | return 242 | } 243 | 244 | if (result) { 245 | res.json({ 246 | "status": "1", 247 | "message": msg_added_favorite 248 | }) 249 | } else { 250 | res.json({ 251 | "status": "0", 252 | "message": msg_fail 253 | }) 254 | } 255 | }) 256 | 257 | } 258 | }) 259 | }) 260 | }, '1') 261 | }) 262 | 263 | app.post('/api/app/favorite_list', (req, res) => { 264 | helper.Dlog(req.body) 265 | var reqObj = req.body; 266 | 267 | checkAccessToken(req.headers, res, (userObj) => { 268 | 269 | db.query("SELECT `fd`.`fav_id`, `pd`.`prod_id`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, `pd`.`created_date`, `pd`.`modify_date`, `cd`.`cat_name`, IFNULL( `bd`.`brand_name`, '' ) AS `brand_name` , `td`.`type_name`, IFNULL(`od`.`price`, `pd`.`price` ) as `offer_price`, IFNULL(`od`.`start_date`,'') as `start_date`, IFNULL(`od`.`end_date`,'') as `end_date`, (CASE WHEN `od`.`offer_id` IS NOT NULL THEN 1 ELSE 0 END) AS `is_offer_active`, 1 AS `is_fav`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image` FROM `favorite_detail` AS `fd` " + 270 | "INNER JOIN `product_detail` AS `pd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `pd`.`status` = 1 " + 271 | "INNER JOIN `category_detail` AS `cd` ON `pd`.`cat_id` = `cd`.`cat_id` " + 272 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 273 | "LEFT JOIN `brand_detail` AS `bd` ON `pd`.`brand_id` = `bd`.`brand_id` " + 274 | "LEFT JOIN `offer_detail` AS `od` ON `pd`.`prod_id` = `od`.`prod_id` AND `od`.`status` = 1 AND `od`.`start_date` <= NOW() AND `od`.`end_date` >= NOW() " + 275 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` " + 276 | " WHERE `fd`.`user_id` = ? AND `fd`.`status` = '1' GROUP BY `pd`.`prod_id` ", [userObj.user_id], (err, result) => { 277 | if (err) { 278 | helper.ThrowHtmlError(err, res); 279 | return 280 | } 281 | 282 | res.json({ 283 | "status": "1", 284 | "payload": result, 285 | "message": msg_success 286 | }) 287 | 288 | }) 289 | }, '1') 290 | }) 291 | 292 | app.post('/api/app/explore_category_list', (req, res) => { 293 | helper.Dlog(req.body) 294 | var reqObj = req.body; 295 | 296 | checkAccessToken(req.headers, res, (userObj) => { 297 | 298 | db.query("SELECT `cat_id`, `cat_name`, (CASE WHEN `image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `image` ) ELSE '' END) AS `image` , `color` FROM `category_detail` WHERE `status` = 1 ", [], (err, result) => { 299 | if (err) { 300 | helper.ThrowHtmlError(err, res); 301 | return 302 | } 303 | 304 | res.json({ 305 | "status": "1", 306 | "payload": result, 307 | "message": msg_success 308 | }) 309 | 310 | }) 311 | }, '1') 312 | }) 313 | 314 | app.post('/api/app/explore_category_items_list', (req, res) => { 315 | helper.Dlog(req.body) 316 | var reqObj = req.body; 317 | 318 | checkAccessToken(req.headers, res, (userObj) => { 319 | helper.CheckParameterValid(res, reqObj, ["cat_id"], () => { 320 | 321 | 322 | db.query("SELECT `pd`.`prod_id`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, `pd`.`created_date`, `pd`.`modify_date`, `cd`.`cat_name`, IFNULL( `bd`.`brand_name`, '' ) AS `brand_name` , `td`.`type_name`, IFNULL(`od`.`price`, `pd`.`price` ) as `offer_price`, IFNULL(`od`.`start_date`,'') as `start_date`, IFNULL(`od`.`end_date`,'') as `end_date`, (CASE WHEN `od`.`offer_id` IS NOT NULL THEN 1 ELSE 0 END) AS `is_offer_active`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image`, AVG( CASE WHEN `rd`.`rate` IS NOT NULL THEN `rd`.`rate` ELSE 0 END ) AS `avg_rating` FROM `product_detail` AS `pd` " + 323 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`status` = 1 " + 324 | "INNER JOIN `category_detail` AS `cd` ON `pd`.`cat_id` = `cd`.`cat_id` AND `pd`.`status` = 1 " + 325 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 326 | "LEFT JOIN `brand_detail` AS `bd` ON `pd`.`brand_id` = `bd`.`brand_id` " + 327 | "LEFT JOIN `offer_detail` AS `od` ON `pd`.`prod_id` = `od`.`prod_id` AND `od`.`status` = 1 AND `od`.`start_date` <= NOW() AND `od`.`end_date` >= NOW() " + 328 | 329 | "LEFT JOIN `review_detail` AS `rd` ON `rd`.`prod_id` = `pd`.`prod_id` " + 330 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` " + 331 | " WHERE `cd`.`cat_id` = ? AND `cd`.`status` = '1' GROUP BY `pd`.`prod_id` ", [reqObj.cat_id], (err, result) => { 332 | if (err) { 333 | helper.ThrowHtmlError(err, res); 334 | return 335 | } 336 | 337 | res.json({ 338 | "status": "1", 339 | "payload": result, 340 | "message": msg_success 341 | }) 342 | 343 | }) 344 | }) 345 | }, '1') 346 | }) 347 | 348 | app.post('/api/app/add_to_cart', (req, res) => { 349 | helper.Dlog(req.body) 350 | var reqObj = req.body 351 | 352 | checkAccessToken(req.headers, res, (userObj) => { 353 | helper.CheckParameterValid(res, reqObj, ["prod_id", "qty"], () => { 354 | 355 | db.query("Select `prod_id` FROM `product_detail` WHERE `prod_id` = ? AND `status` = 1 ", [reqObj.prod_id], (err, result) => { 356 | if (err) { 357 | helper.ThrowHtmlError(err, res) 358 | return; 359 | } 360 | 361 | if (result.length > 0) { 362 | //Valid Item 363 | 364 | db.query("INSERT INTO `cart_detail`(`user_id`, `prod_id`, `qty`) VALUES (?,?,?) ", [userObj.user_id, reqObj.prod_id, reqObj.qty], (err, result) => { 365 | if (err) { 366 | helper.ThrowHtmlError(err, res) 367 | return 368 | } 369 | 370 | if (result) { 371 | res.json({ 372 | "status": "1", 373 | "message": msg_add_to_item 374 | }) 375 | } else { 376 | res.json({ 377 | "status": "0", 378 | "message": msg_fail 379 | }) 380 | } 381 | }) 382 | } else { 383 | //Invalid Item 384 | res.json({ 385 | "status": "0", 386 | "message": msg_invalid_item 387 | }) 388 | } 389 | }) 390 | }) 391 | }) 392 | }) 393 | 394 | app.post('/api/app/update_cart', (req, res) => { 395 | helper.Dlog(req.body) 396 | var reqObj = req.body 397 | 398 | checkAccessToken(req.headers, res, (userObj) => { 399 | helper.CheckParameterValid(res, reqObj, ["cart_id", "prod_id", "new_qty"], () => { 400 | 401 | // Valid 402 | var status = "1" 403 | 404 | if (reqObj.new_qty == "0") { 405 | status = "2" 406 | } 407 | db.query("UPDATE `cart_detail` SET `qty`= ? , `status`= ?, `modify_date`= NOW() WHERE `cart_id` = ? AND `prod_id` = ? AND `user_id` = ? AND `status` = ? ", [reqObj.new_qty, status, reqObj.cart_id, reqObj.prod_id, userObj.user_id, "1"], (err, result) => { 408 | 409 | if (err) { 410 | helper.ThrowHtmlError(err, res) 411 | return 412 | } 413 | 414 | if (result.affectedRows > 0) { 415 | res.json({ 416 | "status": "1", 417 | "message": msg_success 418 | }) 419 | } else { 420 | res.json({ 421 | "status": "0", 422 | "message": msg_fail 423 | }) 424 | } 425 | }) 426 | 427 | }) 428 | }) 429 | }) 430 | 431 | app.post('/api/app/remove_cart', (req, res) => { 432 | helper.Dlog(req.body) 433 | var reqObj = req.body 434 | 435 | checkAccessToken(req.headers, res, (userObj) => { 436 | helper.CheckParameterValid(res, reqObj, ["cart_id", "prod_id"], () => { 437 | 438 | 439 | db.query("UPDATE `cart_detail` SET `status`= '2', `modify_date`= NOW() WHERE `cart_id` = ? AND `prod_id` = ? AND `user_id` = ? AND `status` = ? ", [reqObj.cart_id, reqObj.prod_id, userObj.user_id, "1"], (err, result) => { 440 | 441 | if (err) { 442 | helper.ThrowHtmlError(err, res) 443 | return 444 | } 445 | 446 | if (result.affectedRows > 0) { 447 | res.json({ 448 | "status": "1", 449 | "message": msg_remove_to_cart 450 | }) 451 | } else { 452 | res.json({ 453 | "status": "0", 454 | "message": msg_fail 455 | }) 456 | } 457 | }) 458 | 459 | }) 460 | }) 461 | }) 462 | 463 | app.post('/api/app/cart_list', (req, res) => { 464 | helper.Dlog(req.body) 465 | var reqObj = req.body 466 | 467 | checkAccessToken(req.headers, res, (userObj) => { 468 | getUserCart(res, userObj.user_id, (result, total) => { 469 | 470 | var promo_code_id = reqObj.promo_code_id; 471 | if (promo_code_id == undefined || promo_code_id == null) { 472 | promo_code_id = "" 473 | } 474 | 475 | var deliver_type = reqObj.deliver_type; 476 | if (deliver_type == undefined || deliver_type == null) { 477 | deliver_type = "1" 478 | } 479 | 480 | db.query( 481 | 'SELECT `promo_code_id`, `min_order_amount`, `max_discount_amount`, `offer_price` FROM `promo_code_detail` WHERE `start_date` <= NOW() AND `end_date` >= NOW() AND `status` = 1 AND `promo_code_id` = ? ;' 482 | , [reqObj.promo_code_id], (err, pResult) => { 483 | if (err) { 484 | helper.ThrowHtmlError(err, res) 485 | return 486 | } 487 | 488 | 489 | 490 | var deliver_price_amount = 0.0 491 | 492 | if (deliver_type == "1") { 493 | deliver_price_amount = deliver_price 494 | } else { 495 | deliver_price_amount = 0.0; 496 | } 497 | 498 | 499 | var final_total = total 500 | var discountAmount = 0.0 501 | 502 | if (promo_code_id != "") { 503 | if (pResult.length > 0) { 504 | //Promo Code Apply & Valid 505 | 506 | if (final_total > pResult[0].min_order_amount) { 507 | 508 | if (pResult[0].type == 2) { 509 | // Fixed Discount 510 | discountAmount = pResult[0].offer_price 511 | } else { 512 | //% Per 513 | 514 | var disVal = final_total * (pResult[0].offer_price / 100) 515 | 516 | helper.Dlog("disVal: " + disVal); 517 | 518 | if (pResult[0].max_discount_amount <= disVal) { 519 | //Max discount is more then disVal 520 | discountAmount = pResult[0].max_discount_amount 521 | } else { 522 | //Max discount is Small then disVal 523 | discountAmount = disVal 524 | } 525 | } 526 | 527 | 528 | } else { 529 | res.json({ 530 | 'status': "0", 531 | "payload": result, 532 | "total": total.toFixed(2), 533 | "deliver_price_amount": deliver_price_amount.toFixed(2), 534 | "discount_amount": 0, 535 | "user_pay_price": (final_total + deliver_price_amount).toFixed(2), 536 | 'message': "Promo Code not apply need min order: $" + pResult[0].min_order_amount 537 | }) 538 | return 539 | } 540 | 541 | } else { 542 | //Promo Code Apply not Valid 543 | res.json({ 544 | 'status': "0", 545 | "payload": result, 546 | "total": total.toFixed(2), 547 | "deliver_price_amount": deliver_price_amount.toFixed(2), 548 | "discount_amount": 0, 549 | "user_pay_price": (final_total + deliver_price_amount).toFixed(2), 550 | 'message': "Invalid Promo Code" 551 | }) 552 | return 553 | } 554 | } 555 | 556 | var user_pay_price = final_total + deliver_price_amount + - discountAmount; 557 | res.json({ 558 | "status": "1", 559 | "payload": result, 560 | "total": total.toFixed(2), 561 | "deliver_price_amount": deliver_price_amount.toFixed(2), 562 | "discount_amount": discountAmount.toFixed(2), 563 | "user_pay_price": user_pay_price.toFixed(2), 564 | "message": msg_success 565 | }) 566 | 567 | }) 568 | 569 | 570 | }) 571 | }) 572 | }) 573 | 574 | app.post('/api/app/add_delivery_address', (req, res) => { 575 | helper.Dlog(req.body); 576 | var reqObj = req.body; 577 | checkAccessToken(req.headers, res, (userObj) => { 578 | helper.CheckParameterValid(res, reqObj, ["name", "type_name", "phone", "address", "city", "state", "postal_code"], () => { 579 | db.query("INSERT INTO `address_detail`(`user_id`, `name`, `phone`, `address`, `city`, `state`, `type_name`, `postal_code`) VALUES (?,?,?, ?,?,?, ?,?) ", [userObj.user_id, reqObj.name, reqObj.phone, reqObj.address, reqObj.city, reqObj.state, reqObj.type_name, reqObj.postal_code], (err, result) => { 580 | if (err) { 581 | helper.ThrowHtmlError(err, res); 582 | return 583 | } 584 | 585 | if (result) { 586 | res.json({ 587 | "status": "1", 588 | "message": msg_add_address 589 | }) 590 | } else { 591 | res.json({ 592 | "status": "0", 593 | "message": msg_fail 594 | }) 595 | } 596 | }) 597 | }) 598 | }) 599 | }) 600 | 601 | app.post('/api/app/update_delivery_address', (req, res) => { 602 | helper.Dlog(req.body); 603 | var reqObj = req.body; 604 | checkAccessToken(req.headers, res, (userObj) => { 605 | helper.CheckParameterValid(res, reqObj, ["address_id", "name", "type_name", "phone", "address", "city", "state", "postal_code"], () => { 606 | db.query("UPDATE `address_detail` SET `name`=? ,`phone`=? ,`address`=? ,`city`=? ,`state`=? ,`type_name`=? ,`postal_code`=?, `modify_date`= NOW() WHERE `user_id` = ? AND `address_id` = ? AND `status` = 1 ", [reqObj.name, reqObj.phone, reqObj.address, reqObj.city, reqObj.state, reqObj.type_name, reqObj.postal_code, userObj.user_id, reqObj.address_id], (err, result) => { 607 | if (err) { 608 | helper.ThrowHtmlError(err, res); 609 | return 610 | } 611 | 612 | if (result.affectedRows > 0) { 613 | res.json({ 614 | "status": "1", 615 | "message": msg_update_address 616 | }) 617 | } else { 618 | res.json({ 619 | "status": "0", 620 | "message": msg_fail 621 | }) 622 | } 623 | }) 624 | }) 625 | }) 626 | }) 627 | 628 | app.post('/api/app/delete_delivery_address', (req, res) => { 629 | helper.Dlog(req.body); 630 | var reqObj = req.body; 631 | checkAccessToken(req.headers, res, (userObj) => { 632 | helper.CheckParameterValid(res, reqObj, ["address_id"], () => { 633 | db.query("UPDATE `address_detail` SET `status`=2, `modify_date`= NOW() WHERE `user_id` = ? AND `address_id` = ? AND `status` = 1 ", [userObj.user_id, reqObj.address_id], (err, result) => { 634 | if (err) { 635 | helper.ThrowHtmlError(err, res); 636 | return 637 | } 638 | 639 | if (result.affectedRows > 0) { 640 | res.json({ 641 | "status": "1", 642 | "message": msg_remove_address 643 | }) 644 | } else { 645 | res.json({ 646 | "status": "0", 647 | "message": msg_fail 648 | }) 649 | } 650 | }) 651 | }) 652 | }) 653 | }) 654 | 655 | app.post('/api/app/mark_default_delivery_address', (req, res) => { 656 | helper.Dlog(req.body); 657 | var reqObj = req.body; 658 | checkAccessToken(req.headers, res, (userObj) => { 659 | helper.CheckParameterValid(res, reqObj, ["address_id"], () => { 660 | db.query("UPDATE `address_detail` SET `is_default` = (CASE WHEN `address_id` = ? THEN 1 ELSE 0 END) , `modify_date`= NOW() WHERE `user_id` = ? AND `status` = 1 ", [reqObj.address_id, userObj.user_id], (err, result) => { 661 | if (err) { 662 | helper.ThrowHtmlError(err, res); 663 | return 664 | } 665 | 666 | if (result.affectedRows > 0) { 667 | res.json({ 668 | "status": "1", 669 | "message": msg_success 670 | }) 671 | } else { 672 | res.json({ 673 | "status": "0", 674 | "message": msg_fail 675 | }) 676 | } 677 | }) 678 | }) 679 | }) 680 | }) 681 | 682 | app.post('/api/app/delivery_address', (req, res) => { 683 | helper.Dlog(req.body); 684 | var reqObj = req.body; 685 | checkAccessToken(req.headers, res, (userObj) => { 686 | 687 | db.query("SELECT `address_id`, `name`, `phone`, `address`, `city`, `state`, `type_name`, `postal_code`, `is_default` FROM `address_detail` WHERE `user_id` = ? AND `status` = 1 ", [userObj.user_id], (err, result) => { 688 | if (err) { 689 | helper.ThrowHtmlError(err, res); 690 | return 691 | } 692 | 693 | res.json({ 694 | "status": "1", 695 | "payload": result, 696 | "message": msg_success 697 | }) 698 | }) 699 | 700 | }) 701 | }) 702 | 703 | app.post('/api/app/promo_code_list', (req, res) => { 704 | helper.Dlog(req.body) 705 | var reqObj = req.body 706 | 707 | checkAccessToken(req.headers, res, (userObj) => { 708 | 709 | 710 | db.query("SELECT `promo_code_id`, `code`, `title`, `description`, `type`, `min_order_amount`, `max_discount_amount`, `offer_price`, `start_date`, `end_date`, `created_date`, `modify_date` FROM `promo_code_detail` WHERE `start_date` <= NOW() AND `end_date` >= NOW() AND `status` = 1 ORDER BY `start_date` ", [], (err, result) => { 711 | 712 | if (err) { 713 | helper.ThrowHtmlError(err, res) 714 | return 715 | } 716 | 717 | res.json({ 718 | 'status': '1', 719 | 'payload': result, 720 | 'message': msg_success 721 | }) 722 | }) 723 | 724 | 725 | }, "1") 726 | }) 727 | 728 | app.post('/api/app/add_payment_method', (req, res) => { 729 | helper.Dlog(req.body); 730 | var reqObj = req.body; 731 | 732 | checkAccessToken(req.headers, res, (userObj) => { 733 | helper.CheckParameterValid(res, reqObj, ["name", "card_number", "card_month", "card_year"], () => { 734 | db.query("INSERT INTO `payment_method_detail` (`user_id`, `name`, `card_number`, `card_month`, `card_year`) VALUES (?,?,?, ?,? )", [ 735 | userObj.user_id, reqObj.name, reqObj.card_number, reqObj.card_month, reqObj.card_year 736 | ], (err, result) => { 737 | if (err) { 738 | helper.ThrowHtmlError(err, res); 739 | return 740 | } 741 | 742 | if (result) { 743 | res.json({ 744 | "status": "1", 745 | "message": msg_add_payment_method 746 | }) 747 | } else { 748 | res.json({ 749 | "status": "1", 750 | "message": msg_fail 751 | }) 752 | } 753 | }) 754 | }) 755 | }) 756 | }) 757 | 758 | app.post('/api/app/remove_payment_method', (req, res) => { 759 | helper.Dlog(req.body); 760 | var reqObj = req.body; 761 | 762 | checkAccessToken(req.headers, res, (userObj) => { 763 | helper.CheckParameterValid(res, reqObj, ["pay_id"], () => { 764 | db.query("UPDATE `payment_method_detail` SET `status`= 2 WHERE `pay_id` = ? AND `user_id` = ? AND `status` = 1 ", [ 765 | reqObj.pay_id, userObj.user_id 766 | ], (err, result) => { 767 | if (err) { 768 | helper.ThrowHtmlError(err, res); 769 | return 770 | } 771 | 772 | if (result.affectedRows > 0) { 773 | res.json({ 774 | "status": "1", 775 | "message": msg_remove_payment_method 776 | }) 777 | } else { 778 | res.json({ 779 | "status": "1", 780 | "message": msg_fail 781 | }) 782 | } 783 | }) 784 | }) 785 | }) 786 | }) 787 | 788 | app.post('/api/app/payment_method', (req, res) => { 789 | helper.Dlog(req.body); 790 | var reqObj = req.body; 791 | 792 | checkAccessToken(req.headers, res, (userObj) => { 793 | 794 | db.query("SELECT `pay_id`, `name`, RIGHT( `card_number`, 4) AS `card_number` , `card_month`, `card_year` FROM `payment_method_detail` WHERE `user_id` = ? AND `status` = 1 ", [ 795 | userObj.user_id 796 | ], (err, result) => { 797 | if (err) { 798 | helper.ThrowHtmlError(err, res); 799 | return 800 | } 801 | 802 | res.json({ 803 | "status": "1", 804 | "payload": result, 805 | "message": msg_success 806 | }) 807 | }) 808 | 809 | }) 810 | }) 811 | 812 | app.post('/api/app/order_place', (req, res) => { 813 | helper.Dlog(req.body); 814 | var reqObj = req.body; 815 | 816 | checkAccessToken(req.headers, res, (userObj) => { 817 | helper.CheckParameterValid(res, reqObj, ["address_id", "payment_type", "deliver_type", "pay_id", "promo_code_id"], () => { 818 | getUserCart(res, userObj.user_id, (result, total) => { 819 | if (result.length > 0) { 820 | 821 | db.query('SELECT `pay_id`, `user_id`, `card_month`, `card_year` FROM `payment_method_detail` WHERE `pay_id` = ? AND `status` = 1; ' + 822 | 'SELECT `promo_code_id`, `min_order_amount`, `max_discount_amount`, `offer_price` FROM `promo_code_detail` WHERE `start_date` <= NOW() AND `end_date` >= NOW() AND `status` = 1 AND `promo_code_id` = ? ; ' + 823 | 'SELECT `address_id`, `user_id` FROM `address_detail` WHERE `address_id` = ? AND `user_id` = ? AND `status` = 1 ;', [reqObj.pay_id, reqObj.promo_code_id, reqObj.address_id, userObj.user_id], (err, pResult) => { 824 | if (err) { 825 | helper.ThrowHtmlError(err, res) 826 | return 827 | } 828 | 829 | 830 | 831 | var deliver_price_amount = 0.0 832 | 833 | if ((reqObj.deliver_type == "1" && pResult[2].length == 0)) { 834 | res.json({ 835 | 'status': "0" 836 | , 'message': "Please select address" 837 | }) 838 | return 839 | } 840 | 841 | if (reqObj.deliver_type == "1") { 842 | deliver_price_amount = deliver_price 843 | } else { 844 | deliver_price_amount = 0.0; 845 | } 846 | 847 | 848 | var final_total = total 849 | var discountAmount = 0.0 850 | 851 | if (reqObj.promo_code_id != "") { 852 | if (pResult[1].length > 0) { 853 | //Promo Code Apply & Valid 854 | 855 | if (final_total > pResult[1][0].min_order_amount) { 856 | 857 | if (pResult[1][0].type == 2) { 858 | // Fixed Discount 859 | discountAmount = pResult[1][0].offer_price 860 | } else { 861 | //% Per 862 | 863 | var disVal = final_total * (pResult[1][0].offer_price / 100) 864 | 865 | helper.Dlog("disVal: " + disVal); 866 | 867 | if (pResult[1][0].max_discount_amount <= disVal) { 868 | //Max discount is more then disVal 869 | discountAmount = pResult[1][0].max_discount_amount 870 | } else { 871 | //Max discount is Small then disVal 872 | discountAmount = disVal 873 | } 874 | } 875 | 876 | 877 | } else { 878 | res.json({ 879 | 'status': "0" 880 | , 'message': "Promo Code not apply need min order: $" + pResult[1][0].min_order_amount 881 | }) 882 | return 883 | } 884 | 885 | } else { 886 | //Promo Code Apply not Valid 887 | res.json({ 888 | 'status': "0" 889 | , 'message': "Sorry, Promo Code not apply" 890 | }) 891 | return 892 | } 893 | } 894 | 895 | if (reqObj.payment_type == "1" || (reqObj.payment_type == "2" && pResult[0].length > 0)) { 896 | 897 | var cartId = result.map((cObj) => { 898 | return cObj.cart_id 899 | }) 900 | 901 | var user_pay_price = final_total + deliver_price_amount + - discountAmount; 902 | helper.Dlog("user_pay_price: " + user_pay_price); 903 | helper.Dlog(cartId.toString()) 904 | 905 | db.query("INSERT INTO `order_detail`(`cart_id`, `user_id`, `address_id`, `total_price`, `user_pay_price`, `discount_price`, `deliver_price`, `promo_code_id`, `deliver_type`, `payment_type`) VALUES (?,?,?, ?,?,?, ?,?,?, ? )", [ 906 | cartId.toString(), userObj.user_id, reqObj.address_id, total, user_pay_price, discountAmount, deliver_price_amount, reqObj.promo_code_id, reqObj.deliver_type, reqObj.payment_type 907 | 908 | ], (err, result) => { 909 | if (err) { 910 | helper.ThrowHtmlError(err, res) 911 | return 912 | } 913 | 914 | if (result) { 915 | 916 | if (reqObj.payment_type == "1") { 917 | 918 | db.query("INSERT INTO `notification_detail`( `ref_id`, `user_id`, `title`, `message`, `notification_type`) VALUES (?,?,?, ?,?)", [result.insertId, userObj.user_id, 919 | "Order Placed", "your order #" + result.insertId + " placed.", "2"], (err, iResult) => { 920 | if (err) { 921 | helper.ThrowHtmlError(err); 922 | return 923 | } 924 | 925 | if (iResult) { 926 | helper.Dlog("Notification Added Done") 927 | } else { 928 | helper.Dlog("Notification Fail") 929 | } 930 | }) 931 | } 932 | 933 | db.query("UPDATE `cart_detail` SET `status`= 2 ,`modify_date`= NOW() WHERE `user_id` = ? AND `status`= 1 ", [userObj.user_id], (err, cResult) => { 934 | if (err) { 935 | helper.ThrowHtmlError(err); 936 | return 937 | } 938 | 939 | if (cResult.affectedRows > 0) { 940 | helper.Dlog("user card clear done") 941 | } else { 942 | helper.Dlog("user card clear fail") 943 | } 944 | }) 945 | 946 | res.json({ 947 | 'status': "1", 948 | 'payload': { 949 | 'order_id': result.insertId, 950 | 'user_pay_price': user_pay_price, 951 | 'deliver_price': discountAmount, 952 | 'discount_price': deliver_price_amount, 953 | 'total_price': total 954 | } 955 | , 'message': "your order place successfully" 956 | }) 957 | } else { 958 | res.json({ 959 | 'status': "0" 960 | , 'message': msg_fail 961 | }) 962 | } 963 | }) 964 | } else { 965 | res.json({ 966 | 'status': "0" 967 | , 'message': msg_fail 968 | }) 969 | } 970 | }) 971 | 972 | } else { 973 | res.json({ 974 | 'status': "0" 975 | , 'message': "cart is empty" 976 | }) 977 | } 978 | }) 979 | }) 980 | }) 981 | }) 982 | 983 | app.post('/api/app/order_payment_transaction', (req, res) => { 984 | helper.Dlog(req.body) 985 | var reqObj = req.body 986 | 987 | checkAccessToken(req.headers, res, (userObj) => { 988 | helper.CheckParameterValid(res, reqObj, ["order_id", "payment_transaction_id", "payment_status", "transaction_payload"], () => { 989 | db.query('INSERT INTO `order_payment_detail`( `order_id`, `transaction_payload`, `payment_transaction_id`, `status`) VALUES ( ?,?,?, ? )', [reqObj.order_id, reqObj.transaction_payload, reqObj.payment_transaction_id, reqObj.payment_status], (err, result) => { 990 | if (err) { 991 | helper.ThrowHtmlError(err, res) 992 | return 993 | } 994 | 995 | if (result) { 996 | 997 | var message = reqObj.payment_status == "2" ? "successfully" : "fail" 998 | 999 | db.query("INSERT INTO `notification_detail`( `ref_id`, `user_id`, `title`, `message`, `notification_type`) VALUES (?,?,?, ?,?)", [reqObj.order_id, userObj.user_id, 1000 | "Order payment " + message, "your order #" + reqObj.order_id + " payment " + message + ".", "2"], (err, iResult) => { 1001 | if (err) { 1002 | helper.ThrowHtmlError(err); 1003 | return 1004 | } 1005 | 1006 | if (iResult) { 1007 | helper.Dlog("Notification Added Done") 1008 | } else { 1009 | helper.Dlog("Notification Fail") 1010 | } 1011 | }) 1012 | 1013 | db.query("UPDATE `order_detail` SET `payment_status`=?,`modify_date`= NOW() WHERE `order_id` = ? AND `user_id` = ? AND `status` = 1", [reqObj.payment_status == "1" ? "2" : "3", reqObj.order_id, userObj.user_id], (err, uResult) => { 1014 | if (err) { 1015 | helper.ThrowHtmlError(err); 1016 | return 1017 | } 1018 | 1019 | if (uResult.affectedRows > 0) { 1020 | 1021 | 1022 | 1023 | helper.Dlog("order payment status update done") 1024 | } else { 1025 | helper.Dlog("order payment status update fail") 1026 | } 1027 | }) 1028 | res.json({ 1029 | 'status': "1" 1030 | , 'message': "your order place successfully" 1031 | }) 1032 | } else { 1033 | res.json({ 1034 | 'status': "0" 1035 | , 'message': msg_fail 1036 | }) 1037 | } 1038 | }) 1039 | }) 1040 | }) 1041 | }) 1042 | 1043 | app.post('/api/app/my_order', (req, res) => { 1044 | helper.Dlog(req.body) 1045 | var reqObj = req.body 1046 | 1047 | checkAccessToken(req.headers, res, (userObj) => { 1048 | db.query("SELECT `od`.`order_id`, `od`.`cart_id`, `od`.`total_price`, `od`.`user_pay_price`, `od`.`discount_price`, `od`.`deliver_price`, `od`.`deliver_type`, `od`.`payment_type`, `od`.`payment_status`, `od`.`order_status`, `od`.`status`, `od`.`created_date`, GROUP_CONCAT(DISTINCT `pd`.`name` SEPARATOR ',') AS `names`, GROUP_CONCAT(DISTINCT (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) SEPARATOR ',') AS `images`, `ad`.`name` as `user_name`, `ad`.`phone`, `ad`.`address`, `ad`.`city`, `ad`.`state`, `ad`.`postal_code` FROM `order_detail` AS `od` " + 1049 | "INNER JOIN `cart_detail` AS `cd` ON FIND_IN_SET(`cd`.`cart_id`, `od`.`cart_id`) > 0 " + 1050 | "INNER JOIN `product_detail` AS `pd` ON `cd`.`prod_id` = `pd`.`prod_id` " + 1051 | "INNER JOIN `address_detail` AS `ad` ON `od`.`address_id` = `ad`.`address_id` " + 1052 | "INNER JOIN `image_detail` AS `imd` ON `imd`.`prod_id` = `pd`.`prod_id` " + 1053 | "WHERE `od`.`user_id` = ? GROUP BY `od`.`order_id` ", [userObj.user_id], (err, result) => { 1054 | if (err) { 1055 | helper.ThrowHtmlError(err, res) 1056 | return 1057 | } 1058 | 1059 | res.json({ 1060 | "status": "1", 1061 | "payload": result, 1062 | "message": msg_success 1063 | }) 1064 | }) 1065 | }) 1066 | }) 1067 | 1068 | app.post('/api/app/my_order_detail', (req, res) => { 1069 | helper.Dlog(req.body) 1070 | var reqObj = req.body 1071 | 1072 | checkAccessToken(req.headers, res, (userObj) => { 1073 | helper.CheckParameterValid(res, reqObj, ["order_id"], () => { 1074 | 1075 | 1076 | db.query("SELECT `od`.`order_id`, `od`.`cart_id`, `od`.`total_price`, `od`.`user_pay_price`, `od`.`discount_price`, `od`.`deliver_price`, `od`.`deliver_type`, `od`.`payment_type`, `od`.`payment_status`, `od`.`order_status`, `od`.`status`, `ad`.`name` as `user_name`, `ad`.`phone`, `ad`.`address`, `ad`.`city`, `ad`.`state`, `ad`.`postal_code`, `od`.`created_date` FROM `order_detail` AS `od` " + 1077 | "INNER JOIN `address_detail` AS `ad` ON `od`.`address_id` = `ad`.`address_id` " + 1078 | "WHERE `od`.`user_id` = ? AND `od`.`order_id` = ? ;" + 1079 | 1080 | "SELECT `uod`.`order_id`, `ucd`.`cart_id`, `ucd`.`user_id`, `ucd`.`prod_id`, `ucd`.`qty`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, `pd`.`created_date`, `pd`.`modify_date`, `cd`.`cat_name`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav` , IFNULL( `bd`.`brand_name`, '' ) AS `brand_name` , `td`.`type_name`, IFNULL(`od`.`price`, `pd`.`price` ) as `offer_price`, IFNULL(`od`.`start_date`,'') as `start_date`, IFNULL(`od`.`end_date`,'') as `end_date`, (CASE WHEN `od`.`offer_id` IS NOT NULL THEN 1 ELSE 0 END) AS `is_offer_active`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image`, (CASE WHEN `od`.`price` IS NULL THEN `pd`.`price` ELSE `od`.`price` END) as `item_price`, ( (CASE WHEN `od`.`price` IS NULL THEN `pd`.`price` ELSE `od`.`price` END) * `ucd`.`qty`) AS `total_price`, IFNULL( `rd`.`rate`, 0) AS `rating`, IFNULL( `rd`.`message`, '') AS `review_message` FROM `order_detail` AS `uod` " + 1081 | "INNER JOIN `cart_detail` AS `ucd` ON FIND_IN_SET(`ucd`.`cart_id`, `uod`.`cart_id`) > 0 " + 1082 | "INNER JOIN `product_detail` AS `pd` ON `pd`.`prod_id` = `ucd`.`prod_id` " + 1083 | "INNER JOIN `category_detail` AS `cd` ON `pd`.`cat_id` = `cd`.`cat_id` " + 1084 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`user_id` = ? AND `fd`.`status`= 1 " + 1085 | "LEFT JOIN `brand_detail` AS `bd` ON `pd`.`brand_id` = `bd`.`brand_id` " + 1086 | "LEFT JOIN `offer_detail` AS `od` ON `pd`.`prod_id` = `od`.`prod_id` AND `od`.`status` = 1 AND `od`.`start_date` <= NOW() AND `od`.`end_date` >= NOW() " + 1087 | 1088 | "LEFT JOIN `review_detail` AS `rd` ON `uod`.`order_id` = `rd`.`order_id` " + 1089 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 1090 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` " + 1091 | "WHERE `uod`.`order_id` = ? AND `ucd`.`user_id` = ? GROUP BY `ucd`.`cart_id`, `pd`.`prod_id`", [userObj.user_id, reqObj.order_id, userObj.user_id, reqObj.order_id, userObj.user_id], (err, result) => { 1092 | if (err) { 1093 | helper.ThrowHtmlError(err, res) 1094 | return 1095 | } 1096 | 1097 | if (result[0].length > 0) { 1098 | 1099 | result[0][0].cart_list = result[1] 1100 | 1101 | res.json({ 1102 | "status": "1", 1103 | "payload": result[0][0], 1104 | "message": msg_success 1105 | }) 1106 | } else { 1107 | res.json({ 1108 | 'status': '0', 1109 | 'message': 'invalid order' 1110 | }) 1111 | } 1112 | 1113 | 1114 | }) 1115 | }) 1116 | }) 1117 | }) 1118 | 1119 | app.post('/api/app/order_product_review_add', (req, res) => { 1120 | helper.Dlog(req.body) 1121 | var reqObj = req.body; 1122 | 1123 | checkAccessToken(req.headers, res, (uObj) => { 1124 | helper.CheckParameterValid(res, reqObj, ["prod_id", "order_id", "rating", "review_message"], () => { 1125 | 1126 | db.query("SELECT `od`.`order_id` FROM `order_detail` AS `od` " + 1127 | "INNER JOIN`cart_detail` AS`cd` ON FIND_IN_SET(`cd`.`cart_id`, `od`.`cart_id`) > 0 AND`od`.`order_id` = ? AND `od`.`user_id` = ? " + 1128 | "INNER JOIN`product_detail` AS`pd` ON `cd`.`prod_id` = `pd`.`prod_id` AND `pd`.`prod_id` = ?; " 1129 | 1130 | + 1131 | "SELECT `review_id` FROM `review_detail` WHERE `order_id` = ? AND `prod_id`= ? AND `user_id` = ? AND `status` = 1 ;" 1132 | , [reqObj.order_id, uObj.user_id, reqObj.prod_id, reqObj.order_id, reqObj.prod_id, uObj.user_id], (err, result) => { 1133 | 1134 | if (err) { 1135 | helper.ThrowHtmlError(err, res); 1136 | return 1137 | } 1138 | 1139 | if (result[0].length > 0) { 1140 | 1141 | if (result[1].length > 0) { 1142 | res.json({ 1143 | 'status': '0', 1144 | 'message': 'already given review' 1145 | }) 1146 | } else { 1147 | db.query("INSERT INTO `review_detail`( `order_id`, `prod_id`, `user_id`, `rate`, `message`) VALUES (?,?,?, ?,?)", [reqObj.order_id, reqObj.prod_id, uObj.user_id, reqObj.rating, reqObj.review_message], (err, result) => { 1148 | 1149 | if (err) { 1150 | helper.ThrowHtmlError(err, res); 1151 | return 1152 | } 1153 | 1154 | if (result) { 1155 | res.json({ 1156 | 'status': '1', 1157 | 'message': 'review given successfully' 1158 | }) 1159 | } else { 1160 | res.json({ 1161 | 'status': '0', 1162 | 'message': 'fail' 1163 | }) 1164 | } 1165 | }) 1166 | } 1167 | 1168 | } else { 1169 | res.json({ 1170 | 'status': '0', 1171 | 'message': 'invalid order' 1172 | }) 1173 | } 1174 | 1175 | 1176 | }) 1177 | 1178 | 1179 | }) 1180 | }) 1181 | 1182 | }) 1183 | 1184 | app.post('/api/app/notification_list', (req, res) => { 1185 | helper.Dlog(req.body); 1186 | var reqObj = req.body 1187 | 1188 | checkAccessToken(req.headers, res, (userObj) => { 1189 | db.query("SELECT `notification_id`, `ref_id`, `title`, `message`, `notification_type`, `is_read`, `created_date` FROM `notification_detail` WHERE `user_id` = ? AND `status` = 1", [userObj.user_id], (err, result) => { 1190 | if (err) { 1191 | helper.ThrowHtmlError(err, res); 1192 | return 1193 | } 1194 | 1195 | res.json({ 1196 | "status": "1", 1197 | "payload": result, 1198 | "message": msg_success 1199 | }) 1200 | }) 1201 | }, "1") 1202 | }) 1203 | 1204 | app.post('/api/app/notification_read_all', (req, res) => { 1205 | helper.Dlog(req.body); 1206 | var reqObj = req.body 1207 | 1208 | checkAccessToken(req.headers, res, (userObj) => { 1209 | db.query("UPDATE `notification_detail` SET `is_read` = '2', `modify_date` = NOW() WHERE `user_id` = ? AND `status` = 1", [userObj.user_id], (err, result) => { 1210 | if (err) { 1211 | helper.ThrowHtmlError(err, res); 1212 | return 1213 | } 1214 | 1215 | if (result.affectedRows > 0) { 1216 | res.json({ 1217 | "status": "1", 1218 | "message": msg_success 1219 | }) 1220 | } else { 1221 | res.json({ 1222 | "status": "0", 1223 | "message": msg_fail 1224 | }) 1225 | } 1226 | 1227 | }) 1228 | }, "1") 1229 | }) 1230 | 1231 | app.post('/api/app/update_profile', (req, res) => { 1232 | helper.Dlog(req.body); 1233 | var reqObj = req.body 1234 | 1235 | checkAccessToken(req.headers, res, (userObj) => { 1236 | helper.CheckParameterValid(res, reqObj, ["username", "name", "mobile", "mobile_code"], () => { 1237 | db.query("UPDATE `user_detail` SET `username`=?,`name`=?,`mobile`=?,`mobile_code`=?,`modify_date`=NOW() WHERE `user_id` = ? AND `status` = 1", [reqObj.username, reqObj.name, reqObj.mobile, reqObj.mobile_code, userObj.user_id], (err, result) => { 1238 | if (err) { 1239 | helper.ThrowHtmlError(err, res) 1240 | return 1241 | } 1242 | 1243 | if (result.affectedRows > 0) { 1244 | db.query('SELECT `user_id`, `username`, `name`, `email`, `mobile`, `mobile_code`, `password`, `auth_token`, `status`, `created_date` FROM `user_detail` WHERE `user_id` = ? AND `status` = "1" ', [userObj.user_id], (err, result) => { 1245 | 1246 | if (err) { 1247 | helper.ThrowHtmlError(err, res); 1248 | return 1249 | } 1250 | 1251 | if (result.length > 0) { 1252 | res.json({ "status": "1", "payload": result[0], "message": msg_success }) 1253 | } else { 1254 | res.json({ "status": "0", "message": msg_invalidUser }) 1255 | } 1256 | }) 1257 | } else { 1258 | res.json({ 1259 | "status": "0", 1260 | "message": msg_fail 1261 | }) 1262 | } 1263 | }) 1264 | }) 1265 | 1266 | }) 1267 | }) 1268 | 1269 | app.post('/api/app/change_password', (req, res) => { 1270 | helper.Dlog(req.body); 1271 | var reqObj = req.body 1272 | 1273 | checkAccessToken(req.headers, res, (userObj) => { 1274 | helper.CheckParameterValid(res, reqObj, ["current_password", "new_password"], () => { 1275 | db.query("UPDATE `user_detail` SET `password`=?, `modify_date`=NOW() WHERE `user_id` = ? AND `password` = ?", [reqObj.new_password, userObj.user_id, reqObj.current_password], (err, result) => { 1276 | if (err) { 1277 | helper.ThrowHtmlError(err, res) 1278 | return 1279 | } 1280 | 1281 | if (result.affectedRows > 0) { 1282 | res.json({ "status": "1", "message": msg_success }) 1283 | } else { 1284 | res.json({ 1285 | "status": "0", 1286 | "message": msg_fail 1287 | }) 1288 | } 1289 | }) 1290 | }) 1291 | 1292 | }, "1") 1293 | }) 1294 | 1295 | app.post('/api/app/forgot_password_request', (req, res) => { 1296 | helper.Dlog(req.body); 1297 | var reqObj = req.body 1298 | 1299 | helper.CheckParameterValid(res, reqObj, ["email"], () => { 1300 | db.query("SELECT `user_id` FROM `user_detail` WHERE `email` = ? ", [reqObj.email], (err, result) => { 1301 | if (err) { 1302 | helper.ThrowHtmlError(err, res) 1303 | return 1304 | } 1305 | 1306 | if (result.length > 0) { 1307 | var reset_code = helper.createNumber() 1308 | db.query("UPDATE `user_detail` SET `reset_code` = ? WHERE `user_id` = ? ", [reset_code, result[0].user_id], (err, uResult) => { 1309 | if (err) { 1310 | helper.ThrowHtmlError(err, res) 1311 | return 1312 | } 1313 | 1314 | 1315 | if (uResult.affectedRows > 0) { 1316 | res.json({ "status": "1", "message": msg_success }) 1317 | } else { 1318 | res.json({ 1319 | "status": "0", 1320 | "message": msg_fail 1321 | }) 1322 | } 1323 | }) 1324 | 1325 | } else { 1326 | res.json({ 1327 | "status": "0", 1328 | "message": "user not exits" 1329 | }) 1330 | } 1331 | }) 1332 | }) 1333 | }) 1334 | 1335 | 1336 | app.post('/api/app/forgot_password_verify', (req, res) => { 1337 | helper.Dlog(req.body); 1338 | var reqObj = req.body 1339 | 1340 | helper.CheckParameterValid(res, reqObj, ["email", "reset_code"], () => { 1341 | db.query("SELECT `user_id` FROM `user_detail` WHERE `email` = ? AND `reset_code` ", [reqObj.email, reqObj.reset_code], (err, result) => { 1342 | if (err) { 1343 | helper.ThrowHtmlError(err, res) 1344 | return 1345 | } 1346 | 1347 | if (result.length > 0) { 1348 | var reset_code = helper.createNumber() 1349 | db.query("UPDATE `user_detail` SET `reset_code` = ? WHERE `user_id` = ? ", [reset_code, result[0].user_id], (err, uResult) => { 1350 | if (err) { 1351 | helper.ThrowHtmlError(err, res) 1352 | return 1353 | } 1354 | 1355 | 1356 | if (uResult.affectedRows > 0) { 1357 | res.json({ "status": "1", "payload": { "user_id": result[0].user_id, "reset_code": reset_code }, "message": msg_success }) 1358 | } else { 1359 | res.json({ 1360 | "status": "0", 1361 | "message": msg_fail 1362 | }) 1363 | } 1364 | }) 1365 | 1366 | } else { 1367 | res.json({ 1368 | "status": "0", 1369 | "message": "user not exits" 1370 | }) 1371 | } 1372 | }) 1373 | }) 1374 | 1375 | 1376 | }) 1377 | 1378 | app.post('/api/app/forgot_password_set_password', (req, res) => { 1379 | helper.Dlog(req.body); 1380 | var reqObj = req.body 1381 | 1382 | helper.CheckParameterValid(res, reqObj, ["user_id", "reset_code", "new_password"], () => { 1383 | 1384 | var reset_code = helper.createNumber() 1385 | db.query("UPDATE `user_detail` SET `password` = ? , `reset_code` = ? WHERE `user_id` = ? AND `reset_code` = ? ", [reqObj.new_password, reset_code, reqObj.user_id, reqObj.reset_code], (err, uResult) => { 1386 | if (err) { 1387 | helper.ThrowHtmlError(err, res) 1388 | return 1389 | } 1390 | 1391 | 1392 | if (uResult.affectedRows > 0) { 1393 | res.json({ "status": "1", "message": "update password successfully" }) 1394 | } else { 1395 | res.json({ 1396 | "status": "0", 1397 | "message": msg_fail 1398 | }) 1399 | } 1400 | }) 1401 | }) 1402 | 1403 | 1404 | }) 1405 | 1406 | 1407 | function getProductDetail(res, prod_id, user_id) { 1408 | db.query("SELECT `pd`.`prod_id`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, `pd`.`created_date`, `pd`.`modify_date`, `cd`.`cat_name`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav` , IFNULL( `bd`.`brand_name`, '' ) AS `brand_name` , `td`.`type_name`, IFNULL(`od`.`price`, `pd`.`price` ) as `offer_price`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image`, IFNULL(`od`.`start_date`,'') as `start_date`, IFNULL(`od`.`end_date`,'') as `end_date`, (CASE WHEN `od`.`offer_id` IS NOT NULL THEN 1 ELSE 0 END) AS `is_offer_active`, AVG( CASE WHEN `rd`.`rate` IS NOT NULL THEN `rd`.`rate` ELSE 0 END ) AS `avg_rating` FROM `product_detail` AS `pd` " + 1409 | "INNER JOIN `category_detail` AS `cd` ON `pd`.`cat_id` = `cd`.`cat_id` " + 1410 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 1411 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`user_id` = ? AND `fd`.`status`= 1 " + 1412 | "LEFT JOIN `brand_detail` AS `bd` ON `pd`.`brand_id` = `bd`.`brand_id` " + 1413 | "LEFT JOIN `offer_detail` AS `od` ON `pd`.`prod_id` = `od`.`prod_id` AND `od`.`status` = 1 AND `od`.`start_date` <= NOW() AND `od`.`end_date` >= NOW() " + 1414 | "LEFT JOIN `review_detail` AS `rd` ON `rd`.`prod_id` = `pd`.`prod_id` " + 1415 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` " + 1416 | " WHERE `pd`.`status` = ? AND `pd`.`prod_id` = ? GROUP BY `pd`.`prod_id`; " + 1417 | 1418 | " SELECT `nutrition_id`, `prod_id`, `nutrition_name`, `nutrition_value` FROM `nutrition_detail` WHERE `prod_id` = ? AND `status` = ? ORDER BY `nutrition_name`;" + 1419 | 1420 | "SELECT `img_id`, `prod_id`, (CASE WHEN `image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `image` ) ELSE '' END) AS `image` FROM `image_detail` WHERE `prod_id` = ? AND `status` = ? ;" + 1421 | 1422 | "SELECT `rd`.`review_id`, `rd`.`prod_id`, `rd`.`user_id`, `rd`.`rate`, `rd`.`message`, `rd`.`created_date`, `ud`.`name` FROM `review_detail` AS `rd` " + 1423 | "INNER JOIN `user_detail` AS `ud` ON `ud`.`user_id` = `rd`.`user_id` AND `rd`.`prod_id` = ? ORDER BY `rd`.`review_id` DESC LIMIT 5", [ 1424 | 1425 | 1426 | user_id, "1", prod_id, prod_id, "1", prod_id, "1", prod_id 1427 | 1428 | ], (err, result) => { 1429 | 1430 | if (err) { 1431 | helper.ThrowHtmlError(err, res); 1432 | return; 1433 | } 1434 | 1435 | // result = result.replace_null() 1436 | 1437 | // helper.Dlog(result); 1438 | 1439 | if (result[0].length > 0) { 1440 | 1441 | result[0][0].nutrition_list = result[1]; 1442 | result[0][0].images = result[2]; 1443 | result[0][0].review_list = result[3]; 1444 | 1445 | res.json({ 1446 | "status": "1", "payload": result[0][0] 1447 | }); 1448 | } else { 1449 | res.json({ "status": "0", "message": "invalid item" }) 1450 | } 1451 | 1452 | 1453 | 1454 | }) 1455 | } 1456 | 1457 | function getUserCart(res, user_id, callback) { 1458 | db.query( 1459 | "SELECT `ucd`.`cart_id`, `ucd`.`user_id`, `ucd`.`prod_id`, `ucd`.`qty`, `pd`.`cat_id`, `pd`.`brand_id`, `pd`.`type_id`, `pd`.`name`, `pd`.`detail`, `pd`.`unit_name`, `pd`.`unit_value`, `pd`.`nutrition_weight`, `pd`.`price`, `pd`.`created_date`, `pd`.`modify_date`, `cd`.`cat_name`, ( CASE WHEN `fd`.`fav_id` IS NOT NULL THEN 1 ELSE 0 END ) AS `is_fav` , IFNULL( `bd`.`brand_name`, '' ) AS `brand_name` , `td`.`type_name`, IFNULL(`od`.`price`, `pd`.`price` ) as `offer_price`, IFNULL(`od`.`start_date`,'') as `start_date`, IFNULL(`od`.`end_date`,'') as `end_date`, (CASE WHEN `od`.`offer_id` IS NOT NULL THEN 1 ELSE 0 END) AS `is_offer_active`, (CASE WHEN `imd`.`image` != '' THEN CONCAT( '" + image_base_url + "' ,'', `imd`.`image` ) ELSE '' END) AS `image`, (CASE WHEN `od`.`price` IS NULL THEN `pd`.`price` ELSE `od`.`price` END) as `item_price`, ( (CASE WHEN `od`.`price` IS NULL THEN `pd`.`price` ELSE `od`.`price` END) * `ucd`.`qty`) AS `total_price` FROM `cart_detail` AS `ucd` " + 1460 | "INNER JOIN `product_detail` AS `pd` ON `pd`.`prod_id` = `ucd`.`prod_id` AND `pd`.`status` = 1 " + 1461 | "INNER JOIN `category_detail` AS `cd` ON `pd`.`cat_id` = `cd`.`cat_id` " + 1462 | "LEFT JOIN `favorite_detail` AS `fd` ON `pd`.`prod_id` = `fd`.`prod_id` AND `fd`.`user_id` = ? AND `fd`.`status`= 1 " + 1463 | "LEFT JOIN `brand_detail` AS `bd` ON `pd`.`brand_id` = `bd`.`brand_id` " + 1464 | "LEFT JOIN `offer_detail` AS `od` ON `pd`.`prod_id` = `od`.`prod_id` AND `od`.`status` = 1 AND `od`.`start_date` <= NOW() AND `od`.`end_date` >= NOW() " + 1465 | "INNER JOIN `image_detail` AS `imd` ON `pd`.`prod_id` = `imd`.`prod_id` AND `imd`.`status` = 1 " + 1466 | "INNER JOIN `type_detail` AS `td` ON `pd`.`type_id` = `td`.`type_id` " + 1467 | "WHERE `ucd`.`user_id` = ? AND `ucd`.`status` = ? GROUP BY `ucd`.`cart_id`, `pd`.`prod_id` ", [user_id, user_id, "1"], (err, result) => { 1468 | if (err) { 1469 | helper.ThrowHtmlError(err, res) 1470 | return 1471 | } 1472 | 1473 | var total = result.map((cObj) => { 1474 | return cObj.total_price 1475 | }).reduce((patSum, a) => patSum + a, 0) 1476 | 1477 | 1478 | return callback(result, total) 1479 | }) 1480 | } 1481 | } 1482 | 1483 | function checkAccessToken(headerObj, res, callback, require_type = "") { 1484 | helper.Dlog(headerObj.access_token); 1485 | helper.CheckParameterValid(res, headerObj, ["access_token"], () => { 1486 | db.query("SELECT `user_id`, `username`, `user_type`, `name`, `email`, `mobile`, `mobile_code`, `auth_token`, `dervice_token`, `status` FROM `user_detail` WHERE `auth_token` = ? AND `status` = ? ", [headerObj.access_token, "1"], (err, result) => { 1487 | if (err) { 1488 | helper.ThrowHtmlError(err, res); 1489 | return 1490 | } 1491 | 1492 | helper.Dlog(result); 1493 | 1494 | if (result.length > 0) { 1495 | if (require_type != "") { 1496 | if (require_type == result[0].user_type) { 1497 | return callback(result[0]); 1498 | } else { 1499 | res.json({ "status": "0", "code": "404", "message": "Access denied. Unauthorized user access." }) 1500 | } 1501 | } else { 1502 | return callback(result[0]); 1503 | } 1504 | } else { 1505 | res.json({ "status": "0", "code": "404", "message": "Access denied. Unauthorized user access." }) 1506 | } 1507 | }) 1508 | }) 1509 | } -------------------------------------------------------------------------------- /controllers/sockect_controller.js: -------------------------------------------------------------------------------- 1 | var helper = require('./../helpers/helpers') 2 | var db = require('./../helpers/db_helpers') 3 | 4 | module.exports.controller = (app, io, socket_list) => { 5 | var response = ''; 6 | 7 | const msg_success = "successfully"; 8 | const msg_fail = "fail"; 9 | const msg_invalidUser = "invalid username and password"; 10 | 11 | io.on('connection', (client) => { 12 | client.on('UpdateSocket', (data) => { 13 | helper.Dlog('UpdateSocket :- ' + data); 14 | var jsonObj = JSON.parse(data); 15 | 16 | helper.CheckParameterValidSocket(client, "UpdateSocket", jsonObj, ['user_id'], () => { 17 | db.query("SELECT `user_id`, `email` FROM `user_detail` WHERE `user_id` = ?;", [jsonObj.user_id], (err, result) => { 18 | 19 | if(err) { 20 | helper.ThrowSocketError(err, client, "UpdateSocket") 21 | return; 22 | } 23 | 24 | if(result.length > 0) { 25 | socket_list['us_' + jsonObj.user_id] = { 'socket_id': client.id} 26 | 27 | helper.Dlog(socket_list); 28 | response = { "success": "true", "status": "1", "message": msg_success } 29 | }else{ 30 | response = {"success":"false", "status":"0", "message": msg_invalidUser} 31 | } 32 | client.emit('UpdateSocket', response) 33 | }) 34 | }) 35 | 36 | }) 37 | }) 38 | 39 | 40 | } -------------------------------------------------------------------------------- /groceries.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.2.1 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: localhost 6 | -- Generation Time: Jun 24, 2024 at 08:54 PM 7 | -- Server version: 10.4.28-MariaDB 8 | -- PHP Version: 8.2.4 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- Database: `groceries` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- Table structure for table `address_detail` 28 | -- 29 | 30 | CREATE TABLE `address_detail` ( 31 | `address_id` int(11) NOT NULL, 32 | `user_id` int(11) NOT NULL DEFAULT 0, 33 | `name` varchar(50) NOT NULL DEFAULT '', 34 | `phone` varchar(20) NOT NULL DEFAULT '', 35 | `address` varchar(200) NOT NULL DEFAULT '', 36 | `city` varchar(75) NOT NULL DEFAULT '', 37 | `state` varchar(75) NOT NULL DEFAULT '', 38 | `type_name` varchar(50) NOT NULL DEFAULT '', 39 | `postal_code` varchar(20) NOT NULL DEFAULT '', 40 | `is_default` int(1) NOT NULL DEFAULT 0, 41 | `status` int(1) NOT NULL DEFAULT 1, 42 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 43 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 44 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 45 | 46 | -- 47 | -- Dumping data for table `address_detail` 48 | -- 49 | 50 | INSERT INTO `address_detail` (`address_id`, `user_id`, `name`, `phone`, `address`, `city`, `state`, `type_name`, `postal_code`, `is_default`, `status`, `created_date`, `modify_date`) VALUES 51 | (1, 2, 'My Home', '9876543211', 'New Nat Stge Bldg, S Bapat Marg, Mahim', 'Mumbai', 'Maharashtra', 'Home', '400016', 0, 1, '2023-08-07 10:33:23', '2023-08-07 23:29:54'), 52 | (2, 2, 'My Home', '98765432102', '246/ A, Dhutpeshwar Bldg, Girgaon Road, Near Gai Wadi, Girgaon', 'Mumbai', 'Maharashtra', 'Home', '400004', 1, 1, '2023-08-07 10:38:58', '2023-08-07 23:29:00'), 53 | (3, 2, '1', '123', 'asd', 'asdasd', 'dsfsdfsf', 'Office', '987654123', 0, 2, '2023-08-07 23:15:27', '2023-08-07 23:17:23'), 54 | (4, 2, 'Office1', '9875222', 'Shop 15, Dda Shopping Complex, Azadpur', 'Delhi', 'Delhi', 'Office', '110033', 0, 1, '2023-08-07 23:18:09', '2023-08-10 11:43:16'), 55 | (5, 2, 'Add', '986565635225', '444 ASD ASD asdasdasd', 'Surat', 'Gujarat', 'Home', '456546', 0, 1, '2023-08-10 11:39:37', '2023-08-10 11:39:37'); 56 | 57 | -- -------------------------------------------------------- 58 | 59 | -- 60 | -- Table structure for table `area_detail` 61 | -- 62 | 63 | CREATE TABLE `area_detail` ( 64 | `area_id` int(11) NOT NULL, 65 | `zone_id` int(11) NOT NULL DEFAULT 0, 66 | `name` varchar(100) NOT NULL DEFAULT '', 67 | `status` int(1) NOT NULL DEFAULT 1, 68 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 69 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 70 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 71 | 72 | -- 73 | -- Dumping data for table `area_detail` 74 | -- 75 | 76 | INSERT INTO `area_detail` (`area_id`, `zone_id`, `name`, `status`, `created_date`, `modify_date`) VALUES 77 | (1, 2, 'Area 1', 1, '2023-07-28 16:32:06', '2023-07-28 16:33:46'), 78 | (2, 2, 'Area 2', 1, '2023-07-28 16:37:51', '2023-07-28 16:37:51'), 79 | (3, 1, 'Area 2', 1, '2023-07-28 16:37:55', '2023-07-28 16:37:55'), 80 | (4, 1, 'Area 1', 1, '2023-07-28 16:37:59', '2023-07-28 16:37:59'), 81 | (5, 1, 'Area 3', 1, '2023-07-28 16:38:02', '2023-07-28 16:38:02'), 82 | (6, 1, 'Area4', 2, '2024-05-16 01:18:59', '2024-05-16 01:19:25'), 83 | (7, 1, 'Area', 2, '2024-05-17 08:21:59', '2024-05-17 08:22:58'); 84 | 85 | -- -------------------------------------------------------- 86 | 87 | -- 88 | -- Table structure for table `brand_detail` 89 | -- 90 | 91 | CREATE TABLE `brand_detail` ( 92 | `brand_id` int(11) NOT NULL, 93 | `brand_name` varchar(150) NOT NULL DEFAULT '', 94 | `status` int(1) NOT NULL DEFAULT 1 COMMENT '1: active, 2: deleted', 95 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 96 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 97 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 98 | 99 | -- 100 | -- Dumping data for table `brand_detail` 101 | -- 102 | 103 | INSERT INTO `brand_detail` (`brand_id`, `brand_name`, `status`, `created_date`, `modify_date`) VALUES 104 | (1, 'bigs', 1, '2023-07-26 15:16:50', '2024-05-13 10:11:34'), 105 | (2, 'Amul', 1, '2024-05-10 22:21:21', '2024-05-10 22:21:21'), 106 | (3, 'Balaji', 2, '2024-05-10 22:21:54', '2024-05-10 22:54:34'), 107 | (4, '1', 2, '2024-05-10 22:22:39', '2024-05-10 22:54:32'), 108 | (5, '2', 2, '2024-05-10 22:27:58', '2024-05-10 22:54:33'), 109 | (6, '31', 2, '2024-05-10 22:41:51', '2024-05-10 22:54:33'), 110 | (7, '4', 2, '2024-05-10 22:47:37', '2024-05-10 22:54:15'), 111 | (8, 'Balaji', 1, '2024-05-11 00:26:25', '2024-05-11 00:26:25'), 112 | (9, '1', 2, '2024-05-11 00:27:59', '2024-05-11 00:28:29'), 113 | (10, 'B1', 2, '2024-05-13 10:06:49', '2024-05-13 10:13:04'), 114 | (11, 'B2', 2, '2024-05-13 10:11:56', '2024-05-13 10:12:53'), 115 | (12, 'b2', 2, '2024-05-13 10:43:26', '2024-05-13 10:43:43'), 116 | (13, 'Zone3', 1, '2024-05-14 00:12:11', '2024-05-14 00:12:11'); 117 | 118 | -- -------------------------------------------------------- 119 | 120 | -- 121 | -- Table structure for table `cart_detail` 122 | -- 123 | 124 | CREATE TABLE `cart_detail` ( 125 | `cart_id` int(11) NOT NULL, 126 | `user_id` int(11) NOT NULL DEFAULT 0, 127 | `prod_id` int(11) NOT NULL DEFAULT 0, 128 | `qty` int(11) NOT NULL DEFAULT 1, 129 | `status` int(1) NOT NULL DEFAULT 1, 130 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 131 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 132 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 133 | 134 | -- 135 | -- Dumping data for table `cart_detail` 136 | -- 137 | 138 | INSERT INTO `cart_detail` (`cart_id`, `user_id`, `prod_id`, `qty`, `status`, `created_date`, `modify_date`) VALUES 139 | (1, 2, 5, 0, 2, '2023-08-06 16:50:58', '2023-08-06 16:53:08'), 140 | (2, 2, 6, 1, 2, '2023-08-06 16:52:48', '2023-08-06 16:54:53'), 141 | (3, 2, 5, 1, 2, '2023-08-08 08:18:57', '2023-08-08 08:19:29'), 142 | (4, 2, 5, 3, 2, '2023-08-08 09:37:44', '2023-08-08 10:12:44'), 143 | (5, 2, 11, 1, 2, '2023-08-08 09:38:01', '2023-08-08 10:12:45'), 144 | (6, 2, 10, 3, 2, '2023-08-08 09:38:02', '2023-08-08 10:12:47'), 145 | (7, 2, 5, 1, 2, '2023-08-08 10:13:04', '2023-08-08 11:45:08'), 146 | (8, 2, 6, 1, 2, '2023-08-08 10:13:06', '2023-08-08 11:45:09'), 147 | (9, 2, 6, 1, 2, '2023-08-08 10:13:08', '2023-08-08 10:13:14'), 148 | (10, 7, 5, 1, 2, '2023-08-08 11:18:33', '2023-08-08 11:31:27'), 149 | (11, 7, 5, 4, 2, '2023-08-08 11:19:31', '2023-08-08 11:44:17'), 150 | (12, 7, 6, 1, 2, '2023-08-08 11:19:55', '2023-08-08 11:37:50'), 151 | (13, 7, 7, 0, 2, '2023-08-08 11:21:24', '2023-08-08 11:32:58'), 152 | (14, 7, 5, 1, 2, '2023-08-08 11:46:21', '2023-08-08 11:47:03'), 153 | (15, 7, 5, 1, 2, '2023-08-08 11:47:08', '2023-08-08 11:47:13'), 154 | (16, 7, 5, 2, 1, '2023-08-08 11:50:56', '2023-08-08 11:59:41'), 155 | (17, 7, 6, 3, 1, '2023-08-08 11:51:03', '2023-08-08 11:51:03'), 156 | (18, 2, 5, 1, 2, '2023-08-08 11:53:14', '2023-08-10 10:26:51'), 157 | (19, 7, 5, 1, 1, '2023-08-10 10:37:12', '2023-08-10 10:37:12'), 158 | (20, 7, 6, 1, 1, '2023-08-10 10:37:14', '2023-08-10 10:37:14'), 159 | (21, 7, 6, 1, 1, '2023-08-10 10:37:16', '2023-08-10 10:37:16'), 160 | (22, 2, 5, 3, 2, '2023-08-10 10:38:03', '2023-08-10 10:39:14'), 161 | (23, 2, 6, 2, 2, '2023-08-10 10:38:10', '2023-08-10 10:39:14'), 162 | (24, 2, 5, 1, 2, '2023-08-10 17:56:55', '2023-08-10 19:23:38'), 163 | (25, 2, 6, 1, 2, '2023-08-10 17:56:57', '2023-08-10 19:23:38'), 164 | (26, 2, 5, 1, 2, '2023-08-10 19:24:33', '2023-08-10 19:25:02'), 165 | (27, 2, 6, 1, 2, '2023-08-10 19:24:35', '2023-08-10 19:25:02'), 166 | (28, 2, 6, 1, 2, '2023-08-10 19:24:37', '2023-08-10 19:25:02'), 167 | (29, 2, 5, 1, 2, '2023-08-10 19:27:56', '2023-08-10 19:28:26'), 168 | (30, 2, 5, 1, 2, '2023-08-10 19:28:53', '2023-08-10 19:29:26'), 169 | (31, 2, 5, 1, 2, '2023-08-10 19:31:36', '2023-08-10 19:32:02'), 170 | (32, 2, 5, 1, 2, '2023-08-10 19:34:46', '2023-08-10 19:34:55'), 171 | (33, 2, 5, 2, 2, '2023-08-10 19:35:51', '2023-08-10 19:41:14'), 172 | (34, 2, 6, 2, 2, '2023-08-10 19:35:54', '2023-08-10 19:41:14'), 173 | (35, 2, 7, 1, 2, '2023-08-10 19:36:04', '2023-08-10 19:41:14'), 174 | (36, 2, 5, 1, 1, '2023-08-11 16:32:23', '2023-08-11 16:32:23'); 175 | 176 | -- -------------------------------------------------------- 177 | 178 | -- 179 | -- Table structure for table `category_detail` 180 | -- 181 | 182 | CREATE TABLE `category_detail` ( 183 | `cat_id` int(11) NOT NULL, 184 | `cat_name` varchar(100) NOT NULL DEFAULT '', 185 | `image` varchar(75) NOT NULL DEFAULT '', 186 | `color` varchar(10) NOT NULL DEFAULT '000000', 187 | `status` int(1) NOT NULL DEFAULT 1 COMMENT '1 = active, 2 = delete', 188 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 189 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 190 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 191 | 192 | -- 193 | -- Dumping data for table `category_detail` 194 | -- 195 | 196 | INSERT INTO `category_detail` (`cat_id`, `cat_name`, `image`, `color`, `status`, `created_date`, `modify_date`) VALUES 197 | (1, 'Frash Fruits & Vegetable', 'category/20230726155407547qM5gSxkrCh.png', '53B175', 1, '2023-07-26 15:54:07', '2024-05-20 21:40:56'), 198 | (2, 'Cooking Oil & Ghee', 'category/202307261555485548dKi8yJisIn.png', 'F8A44C', 1, '2023-07-26 15:54:43', '2024-05-20 21:43:35'), 199 | (3, 'Meat & Fish', 'category/20230731100233233AOuWmq6r64.png', 'F7A593', 1, '2023-07-31 10:02:33', '2024-05-19 11:12:13'), 200 | (4, 'Bakery & Snacks', 'category/20230731100257257bPdXFaneYu.png', 'D3B0E0', 1, '2023-07-31 10:02:57', '2023-07-31 10:02:57'), 201 | (5, 'Dairy & Eggs', 'category/20230731100322322vK4gHfIwCI.png', 'FDE598', 1, '2023-07-31 10:03:22', '2023-07-31 10:03:22'), 202 | (6, 'Beverages', 'category/20230731100347347lrk8CyW57u.png', 'B7DFF5', 1, '2023-07-31 10:03:47', '2023-07-31 10:03:47'), 203 | (7, 'Test', 'category/2024051910342234221rKJDZK8LT.jpg', 'BBBBBB', 2, '2024-05-19 10:34:22', '2024-05-19 11:12:20'), 204 | (8, 'Test', 'category/2024051912282128211JZe1U6Tok.jpg', 'BBBB00', 2, '2024-05-19 12:26:55', '2024-05-19 12:28:27'), 205 | (9, 'Test', 'category/202405202144454445ZK82l7oL5u.jpg', 'BBBBBB', 2, '2024-05-20 21:44:45', '2024-05-20 21:44:49'), 206 | (10, 'Test2', 'category/20240520220642642T9QUS0dY8q.jpg', 'BBBBBB', 2, '2024-05-20 22:06:42', '2024-05-20 22:07:25'); 207 | 208 | -- -------------------------------------------------------- 209 | 210 | -- 211 | -- Table structure for table `favorite_detail` 212 | -- 213 | 214 | CREATE TABLE `favorite_detail` ( 215 | `fav_id` int(11) NOT NULL, 216 | `prod_id` int(11) NOT NULL DEFAULT 0, 217 | `user_id` int(11) NOT NULL DEFAULT 0, 218 | `status` int(1) NOT NULL DEFAULT 1, 219 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 220 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 221 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 222 | 223 | -- 224 | -- Dumping data for table `favorite_detail` 225 | -- 226 | 227 | INSERT INTO `favorite_detail` (`fav_id`, `prod_id`, `user_id`, `status`, `created_date`, `modify_date`) VALUES 228 | (1, 5, 5, 1, '2023-08-02 15:19:57', '2023-08-02 15:19:57'), 229 | (9, 10, 2, 1, '2023-08-03 00:57:23', '2023-08-03 00:57:23'), 230 | (11, 6, 2, 1, '2023-08-06 17:19:23', '2023-08-06 17:19:23'), 231 | (12, 5, 2, 1, '2023-08-06 19:09:56', '2023-08-06 19:09:56'), 232 | (13, 7, 2, 1, '2023-08-06 19:15:55', '2023-08-06 19:15:55'); 233 | 234 | -- -------------------------------------------------------- 235 | 236 | -- 237 | -- Table structure for table `image_detail` 238 | -- 239 | 240 | CREATE TABLE `image_detail` ( 241 | `img_id` int(11) NOT NULL, 242 | `prod_id` int(11) NOT NULL DEFAULT 0, 243 | `image` varchar(75) NOT NULL DEFAULT '', 244 | `status` int(1) NOT NULL DEFAULT 1 COMMENT '1 = active, 2 = delete', 245 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 246 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 247 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 248 | 249 | -- 250 | -- Dumping data for table `image_detail` 251 | -- 252 | 253 | INSERT INTO `image_detail` (`img_id`, `prod_id`, `image`, `status`, `created_date`, `modify_date`) VALUES 254 | (4, 5, 'product/202307310947354735xuruflIucc.png', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 255 | (5, 6, 'product/202307310951365136W6nJvPCdzQ.png', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 256 | (6, 7, 'product/202307310958175817ytVf7AVIOl.png', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 257 | (7, 8, 'product/202307311010091094RZ1nWHTug.png', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 258 | (8, 9, 'product/202307311011551155pIjIPWIb4w.png', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 259 | (9, 10, 'product/20230731101409149FomkojOsMt.png', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 260 | (10, 11, 'product/202307311018321832QsO9noUdBS.png', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 261 | (11, 12, 'product/202307311022232223jrsJiejIQu.png', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 262 | (12, 13, 'product/202406021212161216LnEfo5VCnx.jpg', 1, '2024-06-02 12:12:16', '2024-06-02 12:12:16'), 263 | (13, 13, 'product/202406021212161216MHnvjgq6uq.jpg', 1, '2024-06-02 12:12:16', '2024-06-02 12:12:16'), 264 | (14, 14, 'product/202406021215321532VPJoK5fHBk.jpg', 1, '2024-06-02 12:15:32', '2024-06-02 12:15:32'), 265 | (15, 14, 'product/202406021215321532nKS51PEsy5.jpg', 1, '2024-06-02 12:15:32', '2024-06-02 12:15:32'), 266 | (16, 15, 'product/20240602130723723IIkwJyojaY.jpg', 1, '2024-06-02 13:07:23', '2024-06-02 13:07:23'), 267 | (17, 15, 'product/20240602130723723vjCwZpK6K5.jpg', 2, '2024-06-02 13:07:23', '2024-06-05 00:19:36'), 268 | (18, 15, 'product/202406050017381738zePjm9xxj2.jpg', 2, '2024-06-05 00:17:38', '2024-06-05 00:19:33'), 269 | (19, 15, 'product/202406050053265326xul4BNZRwz.jpg', 2, '2024-06-05 00:53:26', '2024-06-05 00:53:44'), 270 | (20, 16, 'product/202406090317291729bFZqIlK9oA.jpg', 1, '2024-06-09 03:17:29', '2024-06-09 03:17:29'), 271 | (21, 16, 'product/202406090317291729uJuCj02bxA.jpg', 1, '2024-06-09 03:17:29', '2024-06-09 03:17:29'), 272 | (22, 16, 'product/202406090317291729bwCAfv9SHS.jpg', 1, '2024-06-09 03:17:29', '2024-06-09 03:17:29'), 273 | (23, 16, 'product/20240609110133133wkXoq0tTxW.jpg', 2, '2024-06-09 11:01:33', '2024-06-09 11:01:37'), 274 | (24, 16, 'product/2024060911030636LovgnWApSV.jpg', 2, '2024-06-09 11:03:06', '2024-06-09 11:03:11'); 275 | 276 | -- -------------------------------------------------------- 277 | 278 | -- 279 | -- Table structure for table `notification_detail` 280 | -- 281 | 282 | CREATE TABLE `notification_detail` ( 283 | `notification_id` int(11) NOT NULL, 284 | `user_id` int(11) NOT NULL DEFAULT 0, 285 | `ref_id` int(11) NOT NULL DEFAULT 0, 286 | `title` varchar(100) NOT NULL DEFAULT '', 287 | `message` varchar(500) NOT NULL DEFAULT '', 288 | `notification_type` int(1) NOT NULL DEFAULT 1, 289 | `status` int(1) NOT NULL DEFAULT 1, 290 | `is_read` int(1) NOT NULL DEFAULT 1 COMMENT '1 = new, 2 = read', 291 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 292 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 293 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 294 | 295 | -- 296 | -- Dumping data for table `notification_detail` 297 | -- 298 | 299 | INSERT INTO `notification_detail` (`notification_id`, `user_id`, `ref_id`, `title`, `message`, `notification_type`, `status`, `is_read`, `created_date`, `modify_date`) VALUES 300 | (1, 2, 2, 'Order Accepted', 'your order #2 accepted.', 2, 1, 1, '2023-08-12 10:35:43', '2023-08-12 10:35:43'), 301 | (2, 2, 2, 'Order Accepted', 'your order #2 accepted.', 2, 1, 1, '2023-08-12 10:36:02', '2023-08-12 10:36:02'), 302 | (3, 2, 3, 'Order Delivered', 'your order #3 delivered.', 2, 1, 1, '2023-08-12 10:36:34', '2023-08-12 10:36:34'), 303 | (4, 2, 3, 'Order Delivered', 'your order #3 delivered.', 2, 1, 1, '2023-08-12 10:37:29', '2023-08-12 10:37:29'), 304 | (5, 2, 2, 'Order Delivered', 'your order #2 delivered.', 2, 1, 1, '2023-08-12 10:38:17', '2023-08-12 10:38:17'), 305 | (6, 2, 4, 'Order Accepted', 'your order #4 accepted.', 2, 1, 1, '2024-06-17 18:05:09', '2024-06-17 18:05:09'), 306 | (7, 2, 4, 'Order Delivered', 'your order #4 delivered.', 2, 1, 1, '2024-06-17 18:09:21', '2024-06-17 18:09:21'), 307 | (8, 2, 6, 'Order Declined', 'your order #6 declined.', 2, 1, 1, '2024-06-17 18:10:58', '2024-06-17 18:10:58'), 308 | (9, 2, 7, 'Order Accepted', 'your order #7 accepted.', 2, 1, 1, '2024-06-17 18:11:03', '2024-06-17 18:11:03'), 309 | (10, 2, 7, 'Order Cancel', 'your order #7 canceled.', 2, 1, 1, '2024-06-17 18:11:06', '2024-06-17 18:11:06'), 310 | (11, 2, 8, 'Order Accepted', 'your order #8 accepted.', 2, 1, 1, '2024-06-17 18:11:12', '2024-06-17 18:11:12'), 311 | (12, 2, 8, 'Order Delivered', 'your order #8 delivered.', 2, 1, 1, '2024-06-17 18:11:17', '2024-06-17 18:11:17'), 312 | (13, 2, 4, 'Order Accepted', 'your order #4 accepted.', 2, 1, 1, '2024-06-17 20:04:09', '2024-06-17 20:04:09'), 313 | (14, 2, 4, 'Order Cancel', 'your order #4 canceled.', 2, 1, 1, '2024-06-17 20:04:23', '2024-06-17 20:04:23'), 314 | (15, 2, 6, 'Order Declined', 'your order #6 declined.', 2, 1, 1, '2024-06-17 20:04:42', '2024-06-17 20:04:42'), 315 | (16, 2, 7, 'Order Accepted', 'your order #7 accepted.', 2, 1, 1, '2024-06-17 20:05:41', '2024-06-17 20:05:41'), 316 | (17, 2, 7, 'Order Delivered', 'your order #7 delivered.', 2, 1, 1, '2024-06-17 20:05:43', '2024-06-17 20:05:43'), 317 | (18, 2, 8, 'Order Accepted', 'your order #8 accepted.', 2, 1, 1, '2024-06-22 12:10:52', '2024-06-22 12:10:52'), 318 | (19, 2, 8, 'Order Delivered', 'your order #8 delivered.', 2, 1, 1, '2024-06-22 12:10:58', '2024-06-22 12:10:58'), 319 | (20, 2, 9, 'Order Accepted', 'your order #9 accepted.', 2, 1, 1, '2024-06-22 13:16:23', '2024-06-22 13:16:23'), 320 | (21, 2, 9, 'Order Cancel', 'your order #9 canceled.', 2, 1, 1, '2024-06-22 13:16:35', '2024-06-22 13:16:35'), 321 | (22, 2, 10, 'Order Accepted', 'your order #10 accepted.', 2, 1, 1, '2024-06-22 13:16:50', '2024-06-22 13:16:50'), 322 | (23, 2, 10, 'Order Delivered', 'your order #10 delivered.', 2, 1, 1, '2024-06-22 13:16:54', '2024-06-22 13:16:54'); 323 | 324 | -- -------------------------------------------------------- 325 | 326 | -- 327 | -- Table structure for table `nutrition_detail` 328 | -- 329 | 330 | CREATE TABLE `nutrition_detail` ( 331 | `nutrition_id` int(11) NOT NULL, 332 | `prod_id` int(11) NOT NULL DEFAULT 0, 333 | `nutrition_name` varchar(120) NOT NULL DEFAULT '', 334 | `nutrition_value` varchar(50) NOT NULL DEFAULT '', 335 | `status` int(1) NOT NULL DEFAULT 1, 336 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 337 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 338 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 339 | 340 | -- 341 | -- Dumping data for table `nutrition_detail` 342 | -- 343 | 344 | INSERT INTO `nutrition_detail` (`nutrition_id`, `prod_id`, `nutrition_name`, `nutrition_value`, `status`, `created_date`, `modify_date`) VALUES 345 | (1, 4, 'Calories', '104', 1, '2023-07-27 15:43:18', '2023-07-27 15:43:18'), 346 | (2, 4, 'Fat', '0.3g', 1, '2023-07-27 15:43:18', '2023-07-27 15:43:18'), 347 | (3, 4, 'Sodium', '3mg', 2, '2023-07-27 16:06:59', '2023-07-27 16:09:58'), 348 | (4, 5, 'Calories', '89', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 349 | (5, 5, 'Fat', '0.3g', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 350 | (6, 5, 'Water', '75%', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 351 | (7, 5, 'Protein', '1.1g', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 352 | (8, 5, 'Carbs', '22.8g', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 353 | (9, 5, 'Sugar', '12.2g', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 354 | (10, 5, 'Fiber', '2.6g', 1, '2023-07-31 09:47:35', '2023-07-31 09:47:35'), 355 | (11, 6, 'Calories', '94.6', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 356 | (12, 6, 'Fat', '0.3g', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 357 | (13, 6, 'Water', '156g', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 358 | (14, 6, 'Protein', '0.43g', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 359 | (15, 6, 'Carbs', '25.1g', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 360 | (16, 6, 'Sugar', '18.9g', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 361 | (17, 6, 'Fiber', '4.37g', 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 362 | (18, 7, 'Calories', '66.6', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 363 | (19, 7, 'Fat', '0.2g', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 364 | (20, 7, 'Water', '86%', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 365 | (21, 7, 'Protein', '1.3g', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 366 | (22, 7, 'Carbs', '14.8g', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 367 | (23, 7, 'Sugar', '12g', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 368 | (24, 7, 'Fiber', '0.2g', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 369 | (25, 7, 'Vitamin C', '92% of the Daily Value (DV)', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 370 | (26, 7, 'Folate', '9% of the DV', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 371 | (27, 7, 'Calcium', '5% of the DV', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 372 | (28, 7, 'Potassium', '5% of the DV', 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 373 | (29, 8, 'Calories', '217', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 374 | (30, 8, 'Fat', '11.8g', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 375 | (31, 8, 'Water', '61%', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 376 | (32, 8, 'Protein', '26.1g', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 377 | (33, 8, 'Carbs', '0g', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 378 | (34, 8, 'Sugar', '0g', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 379 | (35, 8, 'Fiber', '0g', 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 380 | (36, 9, 'Calories', '284', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 381 | (37, 9, 'Fat', '6.2g', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 382 | (38, 9, 'Water', '61%', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 383 | (39, 9, 'Protein', '53.4g', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 384 | (40, 9, 'Carbs', '0g', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 385 | (41, 9, 'Sugar', '0g', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 386 | (42, 9, 'Fiber', '0g', 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 387 | (43, 10, 'Calories', '31', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 388 | (44, 10, 'Fat', '0.3g', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 389 | (45, 10, 'Water', '92%', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 390 | (46, 10, 'Protein', '1g', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 391 | (47, 10, 'Carbs', '6g', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 392 | (48, 10, 'Sugar', '4.2g', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 393 | (49, 10, 'Fiber', '2.1g', 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 394 | (50, 11, 'Calories', '9', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 395 | (51, 11, 'Fat', '0g', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 396 | (52, 11, 'Protein', '0.2g', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 397 | (53, 11, 'Carbs', '2g', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 398 | (54, 11, 'Sugar', '0.2g', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 399 | (55, 11, 'Fiber', '0.2g', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 400 | (56, 11, 'Sodium', '1.4mg', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 401 | (57, 11, 'Magnesium', '4.7mg', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 402 | (58, 11, 'Potassium', '45.6mg', 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 403 | (59, 12, 'Calories', '4.5', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 404 | (60, 12, 'Fat', '0g', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 405 | (61, 12, 'Protein', '0.2g', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 406 | (62, 12, 'Carbs', '1g', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 407 | (63, 12, 'Sugar', '0g', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 408 | (64, 12, 'Fiber', '0.1g', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 409 | (65, 12, 'Sodium', '0.5mg', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 410 | (66, 12, 'Zinc', '0.04mg', 1, '2023-07-31 10:22:23', '2023-07-31 10:22:23'), 411 | (67, 14, 'Fat', '10%', 1, '2024-06-02 12:15:32', '2024-06-02 12:15:32'), 412 | (68, 15, 'Flat', '10%', 2, '2024-06-02 13:07:23', '2024-06-05 00:13:51'), 413 | (69, 15, 'Sugar', '50%', 2, '2024-06-02 13:07:23', '2024-06-05 00:14:42'), 414 | (70, 15, 'Flat1', '10%', 1, '2024-06-05 00:12:28', '2024-06-05 00:12:28'), 415 | (71, 15, 'N1', '10', 2, '2024-06-05 00:15:10', '2024-06-05 00:15:12'), 416 | (72, 15, 'N2', '50', 2, '2024-06-05 00:53:16', '2024-06-05 00:53:33'), 417 | (73, 16, 'n1', '10%', 1, '2024-06-09 03:17:29', '2024-06-09 03:17:29'), 418 | (74, 16, 'n2', '15%', 2, '2024-06-09 03:17:29', '2024-06-09 11:00:00'), 419 | (75, 16, 'm3', '40%', 1, '2024-06-09 11:02:48', '2024-06-09 11:02:48'), 420 | (76, 16, 'm3', '40%', 2, '2024-06-09 11:02:48', '2024-06-09 11:02:56'); 421 | 422 | -- -------------------------------------------------------- 423 | 424 | -- 425 | -- Table structure for table `offer_detail` 426 | -- 427 | 428 | CREATE TABLE `offer_detail` ( 429 | `offer_id` int(11) NOT NULL, 430 | `prod_id` int(11) NOT NULL DEFAULT 0, 431 | `price` double NOT NULL DEFAULT 0, 432 | `start_date` datetime NOT NULL DEFAULT current_timestamp(), 433 | `end_date` datetime NOT NULL DEFAULT current_timestamp(), 434 | `status` int(11) NOT NULL DEFAULT 1, 435 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 436 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 437 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 438 | 439 | -- 440 | -- Dumping data for table `offer_detail` 441 | -- 442 | 443 | INSERT INTO `offer_detail` (`offer_id`, `prod_id`, `price`, `start_date`, `end_date`, `status`, `created_date`, `modify_date`) VALUES 444 | (1, 5, 2.49, '2023-07-31 00:00:00', '2023-08-30 00:00:00', 1, '2023-07-31 10:58:27', '2023-07-31 10:59:54'), 445 | (2, 6, 1.49, '2023-07-31 00:00:00', '2023-08-30 00:00:00', 1, '2023-07-31 10:59:08', '2023-07-31 10:59:08'), 446 | (3, 11, 1.99, '2024-06-12 00:00:00', '2024-06-18 00:00:00', 2, '2024-06-12 23:04:11', '2024-06-13 00:02:00'), 447 | (4, 11, 1.99, '2024-06-14 00:00:00', '2024-06-24 00:00:00', 2, '2024-06-14 00:02:27', '2024-06-14 00:04:10'), 448 | (5, 11, 1.49, '2024-06-14 00:00:00', '2024-06-17 00:00:00', 2, '2024-06-14 00:05:09', '2024-06-14 00:05:20'); 449 | 450 | -- -------------------------------------------------------- 451 | 452 | -- 453 | -- Table structure for table `order_detail` 454 | -- 455 | 456 | CREATE TABLE `order_detail` ( 457 | `order_id` int(11) NOT NULL, 458 | `cart_id` varchar(500) NOT NULL DEFAULT '' COMMENT '1,2,3,4,5', 459 | `user_id` int(11) NOT NULL DEFAULT 0, 460 | `address_id` int(11) NOT NULL DEFAULT 0, 461 | `total_price` double NOT NULL DEFAULT 0, 462 | `user_pay_price` double NOT NULL DEFAULT 0, 463 | `discount_price` double NOT NULL DEFAULT 0, 464 | `deliver_price` double NOT NULL DEFAULT 0, 465 | `promo_code_id` varchar(20) NOT NULL DEFAULT '', 466 | `deliver_type` int(1) NOT NULL DEFAULT 1 COMMENT '1: Deliver, 2: Collection', 467 | `payment_type` int(1) NOT NULL DEFAULT 1 COMMENT '1: COD, 2: Online', 468 | `payment_status` int(1) NOT NULL DEFAULT 1 COMMENT '1: waiting, 2: done, 3: fail, 4: refund', 469 | `order_status` int(1) NOT NULL DEFAULT 1 COMMENT '1: new, 2: order_accept, 3: order_delivered, 4: cancel, 5: order declined', 470 | `status` int(1) NOT NULL DEFAULT 1, 471 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 472 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 473 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 474 | 475 | -- 476 | -- Dumping data for table `order_detail` 477 | -- 478 | 479 | INSERT INTO `order_detail` (`order_id`, `cart_id`, `user_id`, `address_id`, `total_price`, `user_pay_price`, `discount_price`, `deliver_price`, `promo_code_id`, `deliver_type`, `payment_type`, `payment_status`, `order_status`, `status`, `created_date`, `modify_date`) VALUES 480 | (2, '18', 2, 2, 2.49, 4.2410000000000005, 0.24900000000000003, 2, '1', 1, 1, 1, 3, 1, '2023-08-10 10:22:46', '2023-08-12 10:38:17'), 481 | (3, '18', 2, 2, 2.49, 4.2410000000000005, 0.24900000000000003, 2, '1', 1, 1, 1, 3, 1, '2023-08-10 10:26:51', '2023-08-12 10:37:29'), 482 | (4, '22,23', 2, 2, 10.450000000000001, 11.405000000000001, 1.0450000000000002, 2, '1', 1, 2, 2, 4, 1, '2023-08-10 10:39:14', '2024-06-17 20:04:23'), 483 | (5, '24,25', 2, 1, 3.9800000000000004, 5.582000000000001, 0.3980000000000001, 2, '1', 1, 2, 1, 1, 1, '2023-08-10 19:23:38', '2023-08-10 19:23:38'), 484 | (6, '26,27,28', 2, 1, 5.470000000000001, 6.923000000000001, 0.547, 2, '1', 1, 1, 1, 5, 1, '2023-08-10 19:25:02', '2024-06-17 20:04:42'), 485 | (7, '29', 2, 1, 2.49, 4.49, 0, 2, '', 1, 1, 1, 3, 1, '2023-08-10 19:28:26', '2024-06-17 20:05:43'), 486 | (8, '30', 2, 1, 2.49, 4.49, 0, 2, '', 1, 1, 1, 3, 1, '2023-08-10 19:29:26', '2024-06-22 12:10:58'), 487 | (9, '31', 2, 1, 2.49, 4.2410000000000005, 0.24900000000000003, 2, '1', 1, 1, 1, 4, 1, '2023-08-10 19:32:02', '2024-06-22 13:16:35'), 488 | (10, '32', 2, 1, 2.49, 4.49, 0, 2, '', 1, 1, 1, 3, 1, '2023-08-10 19:34:55', '2024-06-22 13:16:54'), 489 | (11, '33,34,35', 2, 1, 8.950000000000001, 10.055000000000001, 0.8950000000000001, 2, '1', 1, 1, 1, 1, 1, '2023-08-10 19:41:14', '2023-08-10 19:41:14'); 490 | 491 | -- -------------------------------------------------------- 492 | 493 | -- 494 | -- Table structure for table `order_payment_detail` 495 | -- 496 | 497 | CREATE TABLE `order_payment_detail` ( 498 | `transaction_id` int(11) NOT NULL, 499 | `order_id` int(11) NOT NULL, 500 | `transaction_payload` varchar(5000) NOT NULL DEFAULT '', 501 | `payment_transaction_id` varchar(100) NOT NULL DEFAULT '', 502 | `status` int(11) NOT NULL DEFAULT 1, 503 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 504 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 505 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 506 | 507 | -- 508 | -- Dumping data for table `order_payment_detail` 509 | -- 510 | 511 | INSERT INTO `order_payment_detail` (`transaction_id`, `order_id`, `transaction_payload`, `payment_transaction_id`, `status`, `created_date`, `modify_date`) VALUES 512 | (1, 4, '{\"status\":\"1\",\"payment_transaction_id\":\"2122312312313\" }', '2122312312313', 1, '2023-08-10 10:41:55', '2023-08-10 10:41:55'), 513 | (2, 4, '{\"status\":\"1\",\"payment_transaction_id\":\"2122312312313\" }', '2122312312313', 1, '2023-08-10 10:42:48', '2023-08-10 10:42:48'), 514 | (3, 4, '{\"status\":\"1\",\"payment_transaction_id\":\"2122312312313\" }', '2122312312313', 1, '2023-08-10 10:43:38', '2023-08-10 10:43:38'); 515 | 516 | -- -------------------------------------------------------- 517 | 518 | -- 519 | -- Table structure for table `payment_method_detail` 520 | -- 521 | 522 | CREATE TABLE `payment_method_detail` ( 523 | `pay_id` int(11) NOT NULL, 524 | `user_id` int(11) NOT NULL, 525 | `name` varchar(100) NOT NULL DEFAULT '', 526 | `card_number` varchar(50) NOT NULL DEFAULT '', 527 | `card_month` varchar(3) NOT NULL DEFAULT '', 528 | `card_year` varchar(5) NOT NULL DEFAULT '', 529 | `status` int(1) NOT NULL DEFAULT 1, 530 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 531 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 532 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 533 | 534 | -- 535 | -- Dumping data for table `payment_method_detail` 536 | -- 537 | 538 | INSERT INTO `payment_method_detail` (`pay_id`, `user_id`, `name`, `card_number`, `card_month`, `card_year`, `status`, `created_date`, `modify_date`) VALUES 539 | (1, 2, 'Card1', '4242424242424242', '12', '28', 1, '2023-08-09 10:10:43', '2023-08-09 10:10:43'), 540 | (2, 2, 'Card1', '4242424242424243', '12', '28', 1, '2023-08-09 10:11:55', '2023-08-09 10:11:55'), 541 | (3, 2, 'Ca', '4242424242424242', '08', '2025', 1, '2023-08-09 20:58:35', '2023-08-09 20:58:35'); 542 | 543 | -- -------------------------------------------------------- 544 | 545 | -- 546 | -- Table structure for table `product_detail` 547 | -- 548 | 549 | CREATE TABLE `product_detail` ( 550 | `prod_id` int(11) NOT NULL, 551 | `cat_id` int(11) NOT NULL DEFAULT 0, 552 | `brand_id` int(11) NOT NULL DEFAULT 0, 553 | `type_id` int(11) NOT NULL DEFAULT 0, 554 | `name` varchar(200) NOT NULL DEFAULT '', 555 | `detail` varchar(5000) NOT NULL DEFAULT '', 556 | `unit_name` varchar(50) NOT NULL DEFAULT '', 557 | `unit_value` varchar(20) NOT NULL DEFAULT '', 558 | `nutrition_weight` varchar(20) NOT NULL DEFAULT '100g', 559 | `price` double NOT NULL DEFAULT 0, 560 | `status` int(1) NOT NULL DEFAULT 1 COMMENT '1: active, 2: delete', 561 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 562 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 563 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 564 | 565 | -- 566 | -- Dumping data for table `product_detail` 567 | -- 568 | 569 | INSERT INTO `product_detail` (`prod_id`, `cat_id`, `brand_id`, `type_id`, `name`, `detail`, `unit_name`, `unit_value`, `nutrition_weight`, `price`, `status`, `created_date`, `modify_date`) VALUES 570 | (5, 1, 1, 1, 'Organic Banana', 'banana, fruit of the genus Musa, of the family Musaceae, one of the most important fruit crops of the world. The banana is grown in the tropics, and, though it is most widely consumed in those regions, it is valued worldwide for its flavour, nutritional value, and availability throughout the year', 'pcs', '7', '200g', 2.99, 2, '2023-07-31 09:47:35', '2024-06-09 11:06:12'), 571 | (6, 1, 1, 1, 'Red Apple', 'Apples contain key nutrients, including fiber and antioxidants. They may offer health benefits, including lowering blood sugar levels and benefitting heart health.', 'kg', '1', '182g', 1.99, 1, '2023-07-31 09:51:36', '2023-07-31 09:51:36'), 572 | (7, 1, 1, 1, 'Oranges', 'Many types of oranges are high in fiber and beneficial vitamins, like vitamin C. They also contain antioxidants which can have various health benefits, including supporting immune function.', 'kg', '1', '140g', 0.99, 1, '2023-07-31 09:58:17', '2023-07-31 09:58:17'), 573 | (8, 3, 1, 1, 'Beef Bone', 'When consumed in moderation, beef can improve muscle growth and maintenance. It’s also rich in iron and zinc. But high consumption of beef has been linked to an increased risk for heart disease and cancer.', 'kg', '1', '100g', 3.99, 1, '2023-07-31 10:10:09', '2023-07-31 10:10:09'), 574 | (9, 3, 1, 1, 'Broiler Chicken', 'When consumed in moderation, beef can improve muscle growth and maintenance. It’s also rich in iron and zinc. But high consumption of beef has been linked to an increased risk for heart disease and cancer.', 'kg', '1', '100g', 3.99, 1, '2023-07-31 10:11:55', '2023-07-31 10:11:55'), 575 | (10, 1, 1, 1, 'Bell Peppers', 'Bell peppers (Capsicum annuum) are fruits that belong to the nightshade family. They are low in calories and rich in vitamin C and other antioxidants, making them an excellent addition to a healthy diet.', 'gm', '250', '100g', 1.99, 1, '2023-07-31 10:14:09', '2023-07-31 10:14:09'), 576 | (11, 1, 1, 1, 'Ginger', 'Ginger may have numerous health benefits due to its anti-inflammatory, anti-nausea, and other properties. It may help you lose weight, manage arthritis, reduce menstrual symptoms, and more.', 'gm', '250', '11g', 2.99, 1, '2023-07-31 10:18:32', '2023-07-31 10:18:32'), 577 | (15, 3, 2, 3, 'Apple1', 'Apple Detail 1', 'Kg', '2', '8', 2.25, 2, '2024-06-02 13:07:23', '2024-06-09 11:05:19'), 578 | (16, 1, 1, 1, 'Test Pro', 'Detail', 'Kg', '1', '-', 2.2, 2, '2024-06-09 03:17:29', '2024-06-09 11:04:56'); 579 | 580 | -- -------------------------------------------------------- 581 | 582 | -- 583 | -- Table structure for table `promo_code_detail` 584 | -- 585 | 586 | CREATE TABLE `promo_code_detail` ( 587 | `promo_code_id` int(11) NOT NULL, 588 | `code` varchar(20) NOT NULL DEFAULT '', 589 | `title` varchar(200) NOT NULL DEFAULT '', 590 | `description` varchar(5000) NOT NULL DEFAULT '', 591 | `type` int(1) NOT NULL DEFAULT 1 COMMENT '1 = Per% , 2 = Fix Amount', 592 | `min_order_amount` double NOT NULL DEFAULT 0, 593 | `max_discount_amount` double NOT NULL DEFAULT 500, 594 | `offer_price` decimal(10,0) NOT NULL DEFAULT 0, 595 | `start_date` datetime NOT NULL DEFAULT current_timestamp(), 596 | `end_date` datetime NOT NULL DEFAULT current_timestamp(), 597 | `status` int(1) NOT NULL DEFAULT 1, 598 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 599 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 600 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 601 | 602 | -- 603 | -- Dumping data for table `promo_code_detail` 604 | -- 605 | 606 | INSERT INTO `promo_code_detail` (`promo_code_id`, `code`, `title`, `description`, `type`, `min_order_amount`, `max_discount_amount`, `offer_price`, `start_date`, `end_date`, `status`, `created_date`, `modify_date`) VALUES 607 | (1, 'CGREFILL', 'UPTO 90% OFF', 'Now Explore Premium Dry Fruits & Nuts At Happilo. Flat 34% Off On Order. No Minimum Purchase Criteria. Explore Various Types Of Nuts, Dried Fruits, Seeds, Berries, Family Packs, Combos And More Starting From Rs.99 Only. Just Click On the Link And Visit The Offer Page To Explore More', 1, 2, 50, 10, '2023-08-08 00:00:00', '2023-09-08 00:00:00', 1, '2023-08-08 08:57:31', '2023-08-08 09:16:31'), 608 | (2, 'ADREFILL', 'UPTO 50% OFF', 'Now Explore Premium Dry Fruits & Nuts At Happilo. Flat 34% Off On Order. No Minimum Purchase Criteria. Explore Various Types Of Nuts, Dried Fruits, Seeds, Berries, Family Packs, Combos And More Starting From Rs.99 Only. Just Click On the Link And Visit The Offer Page To Explore More', 1, 10, 50, 10, '2023-08-08 00:00:00', '2023-09-08 00:00:00', 1, '2023-08-08 08:57:31', '2023-08-08 09:16:31'), 609 | (3, 'TEST10', 'Test Code1', 'Description', 1, 10, 50, 10, '2024-05-26 00:00:00', '2024-05-30 00:00:00', 2, '2024-05-26 10:09:22', '2024-05-26 10:12:57'), 610 | (4, 'TEST10', 'Test 10 per', 'Description', 1, 5, 50, 10, '2024-05-26 00:00:00', '2024-05-31 00:00:00', 2, '2024-05-26 11:03:16', '2024-05-26 11:20:29'), 611 | (5, 'TEST20', 'Test20 Fixed', 'Ds', 0, 200, 50, 50, '2024-05-26 00:00:00', '2024-05-30 00:00:00', 2, '2024-05-26 11:20:11', '2024-05-27 22:44:17'), 612 | (6, 'TEST20', 'Test20', 'Description', 0, 60, 60, 20, '2024-05-28 00:00:00', '2024-05-29 00:00:00', 2, '2024-05-27 22:46:03', '2024-05-27 22:46:17'), 613 | (7, 'TEST20', 'Test 20', 'Description', 0, 50, 50, 10, '2024-05-28 00:00:00', '2024-05-29 00:00:00', 2, '2024-05-27 23:41:52', '2024-05-27 23:43:15'); 614 | 615 | -- -------------------------------------------------------- 616 | 617 | -- 618 | -- Table structure for table `review_detail` 619 | -- 620 | 621 | CREATE TABLE `review_detail` ( 622 | `review_id` int(11) NOT NULL, 623 | `order_id` int(11) NOT NULL DEFAULT 0, 624 | `prod_id` int(11) NOT NULL DEFAULT 0, 625 | `user_id` int(11) NOT NULL DEFAULT 0, 626 | `rate` varchar(5) NOT NULL DEFAULT '', 627 | `message` varchar(1000) NOT NULL DEFAULT '', 628 | `status` int(1) NOT NULL DEFAULT 1, 629 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 630 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 631 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 632 | 633 | -- -------------------------------------------------------- 634 | 635 | -- 636 | -- Table structure for table `type_detail` 637 | -- 638 | 639 | CREATE TABLE `type_detail` ( 640 | `type_id` int(11) NOT NULL, 641 | `type_name` varchar(100) NOT NULL DEFAULT '', 642 | `image` varchar(75) NOT NULL DEFAULT '', 643 | `color` varchar(8) NOT NULL DEFAULT '000000', 644 | `status` int(1) NOT NULL DEFAULT 1 COMMENT '1 = active, 2 =delete', 645 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 646 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 647 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 648 | 649 | -- 650 | -- Dumping data for table `type_detail` 651 | -- 652 | 653 | INSERT INTO `type_detail` (`type_id`, `type_name`, `image`, `color`, `status`, `created_date`, `modify_date`) VALUES 654 | (1, 'Pulses', 'type/202307261610181018aVOpgmY1W1.png', 'F8A44C', 1, '2023-07-26 16:10:18', '2023-07-26 16:12:39'), 655 | (2, 'Pulses', 'type/202307310959535953siLWeCJ71I.png', 'F8A44C', 2, '2023-07-31 09:59:53', '2023-07-31 09:59:53'), 656 | (3, 'Rice', 'type/202307311000160168a0737aEiC.png', '53B175', 1, '2023-07-31 10:00:16', '2023-07-31 10:00:16'), 657 | (4, 'Test', 'type/202405211913091394DyHulmF7S.jpg', '777777', 2, '2024-05-21 19:12:41', '2024-05-21 19:13:14'), 658 | (5, 'Test', 'type/202405230721552155llwQXdWhLB.jpg', 'BBBB00', 2, '2024-05-23 07:21:55', '2024-05-23 07:22:24'); 659 | 660 | -- -------------------------------------------------------- 661 | 662 | -- 663 | -- Table structure for table `user_detail` 664 | -- 665 | 666 | CREATE TABLE `user_detail` ( 667 | `user_id` int(11) NOT NULL, 668 | `username` varchar(75) NOT NULL DEFAULT '', 669 | `user_type` int(1) NOT NULL DEFAULT 1 COMMENT '1= user , 2 = admin', 670 | `name` varchar(100) NOT NULL DEFAULT '', 671 | `email` varchar(100) NOT NULL DEFAULT '', 672 | `mobile` varchar(15) NOT NULL DEFAULT '', 673 | `mobile_code` varchar(6) NOT NULL DEFAULT '', 674 | `password` varchar(100) NOT NULL DEFAULT '', 675 | `area_id` int(11) NOT NULL DEFAULT 0, 676 | `auth_token` varchar(100) NOT NULL DEFAULT '', 677 | `dervice_token` varchar(150) NOT NULL DEFAULT '', 678 | `reset_code` varchar(6) NOT NULL DEFAULT '0000', 679 | `status` int(1) NOT NULL DEFAULT 1 COMMENT '1: active, 2 = delete', 680 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 681 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 682 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 683 | 684 | -- 685 | -- Dumping data for table `user_detail` 686 | -- 687 | 688 | INSERT INTO `user_detail` (`user_id`, `username`, `user_type`, `name`, `email`, `mobile`, `mobile_code`, `password`, `area_id`, `auth_token`, `dervice_token`, `reset_code`, `status`, `created_date`, `modify_date`) VALUES 689 | (1, 'admin', 2, 'admin', 'admin@admin.com', '', '', '123456', 0, '0ZbWMCJicXUFKfFh4JeM', '', '0000', 1, '2023-07-26 14:57:59', '2024-06-22 11:47:35'), 690 | (2, 'testuser', 1, '', 'test@gmail.com', '', '', '123456', 0, 'LGXcafMVxToL5jAKCNqk', '', '0000', 1, '2023-07-25 10:57:32', '2024-05-09 00:52:49'), 691 | (5, 'User1', 1, '', 'user1@gmail.com', '', '', '123456', 0, 'pJYFk5XGrCrGZl92K5qu', '', '0000', 1, '2023-07-29 16:55:36', '2023-07-29 16:55:36'), 692 | (6, 'user1', 1, '', 'user2@gmail.com', '', '', '123456', 0, 'g0mtdJJqF9Xn7iDjQmNN', '', '0000', 1, '2023-08-02 11:01:46', '2023-08-02 11:01:46'), 693 | (7, 'user6', 1, '', 'test7@gmail.com', '', '', '123456', 0, 'hNytj5vmrr9DmzaSXsyw', '', '0000', 1, '2023-08-02 11:33:19', '2023-08-06 23:42:01'); 694 | 695 | -- -------------------------------------------------------- 696 | 697 | -- 698 | -- Table structure for table `zone_detail` 699 | -- 700 | 701 | CREATE TABLE `zone_detail` ( 702 | `zone_id` int(11) NOT NULL, 703 | `name` varchar(50) NOT NULL DEFAULT '', 704 | `status` int(1) NOT NULL DEFAULT 1, 705 | `created_date` datetime NOT NULL DEFAULT current_timestamp(), 706 | `modify_date` datetime NOT NULL DEFAULT current_timestamp() 707 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 708 | 709 | -- 710 | -- Dumping data for table `zone_detail` 711 | -- 712 | 713 | INSERT INTO `zone_detail` (`zone_id`, `name`, `status`, `created_date`, `modify_date`) VALUES 714 | (1, 'Zone 1', 1, '2023-07-28 16:22:28', '2023-07-28 16:24:16'), 715 | (2, 'Zone 2', 1, '2023-07-28 16:22:34', '2023-07-28 16:22:34'), 716 | (3, 'Zone 4', 2, '2024-05-14 00:14:41', '2024-05-14 00:17:25'), 717 | (4, 'Zone4', 2, '2024-05-15 00:02:01', '2024-05-15 00:02:18'), 718 | (5, 'Zone 3', 2, '2024-05-15 00:19:11', '2024-05-15 00:19:33'); 719 | 720 | -- 721 | -- Indexes for dumped tables 722 | -- 723 | 724 | -- 725 | -- Indexes for table `address_detail` 726 | -- 727 | ALTER TABLE `address_detail` 728 | ADD PRIMARY KEY (`address_id`); 729 | 730 | -- 731 | -- Indexes for table `area_detail` 732 | -- 733 | ALTER TABLE `area_detail` 734 | ADD PRIMARY KEY (`area_id`); 735 | 736 | -- 737 | -- Indexes for table `brand_detail` 738 | -- 739 | ALTER TABLE `brand_detail` 740 | ADD PRIMARY KEY (`brand_id`); 741 | 742 | -- 743 | -- Indexes for table `cart_detail` 744 | -- 745 | ALTER TABLE `cart_detail` 746 | ADD PRIMARY KEY (`cart_id`); 747 | 748 | -- 749 | -- Indexes for table `category_detail` 750 | -- 751 | ALTER TABLE `category_detail` 752 | ADD PRIMARY KEY (`cat_id`); 753 | 754 | -- 755 | -- Indexes for table `favorite_detail` 756 | -- 757 | ALTER TABLE `favorite_detail` 758 | ADD PRIMARY KEY (`fav_id`); 759 | 760 | -- 761 | -- Indexes for table `image_detail` 762 | -- 763 | ALTER TABLE `image_detail` 764 | ADD PRIMARY KEY (`img_id`); 765 | 766 | -- 767 | -- Indexes for table `notification_detail` 768 | -- 769 | ALTER TABLE `notification_detail` 770 | ADD PRIMARY KEY (`notification_id`); 771 | 772 | -- 773 | -- Indexes for table `nutrition_detail` 774 | -- 775 | ALTER TABLE `nutrition_detail` 776 | ADD PRIMARY KEY (`nutrition_id`); 777 | 778 | -- 779 | -- Indexes for table `offer_detail` 780 | -- 781 | ALTER TABLE `offer_detail` 782 | ADD PRIMARY KEY (`offer_id`); 783 | 784 | -- 785 | -- Indexes for table `order_detail` 786 | -- 787 | ALTER TABLE `order_detail` 788 | ADD PRIMARY KEY (`order_id`); 789 | 790 | -- 791 | -- Indexes for table `order_payment_detail` 792 | -- 793 | ALTER TABLE `order_payment_detail` 794 | ADD PRIMARY KEY (`transaction_id`); 795 | 796 | -- 797 | -- Indexes for table `payment_method_detail` 798 | -- 799 | ALTER TABLE `payment_method_detail` 800 | ADD PRIMARY KEY (`pay_id`); 801 | 802 | -- 803 | -- Indexes for table `product_detail` 804 | -- 805 | ALTER TABLE `product_detail` 806 | ADD PRIMARY KEY (`prod_id`); 807 | 808 | -- 809 | -- Indexes for table `promo_code_detail` 810 | -- 811 | ALTER TABLE `promo_code_detail` 812 | ADD PRIMARY KEY (`promo_code_id`); 813 | 814 | -- 815 | -- Indexes for table `review_detail` 816 | -- 817 | ALTER TABLE `review_detail` 818 | ADD PRIMARY KEY (`review_id`); 819 | 820 | -- 821 | -- Indexes for table `type_detail` 822 | -- 823 | ALTER TABLE `type_detail` 824 | ADD PRIMARY KEY (`type_id`); 825 | 826 | -- 827 | -- Indexes for table `user_detail` 828 | -- 829 | ALTER TABLE `user_detail` 830 | ADD PRIMARY KEY (`user_id`); 831 | 832 | -- 833 | -- Indexes for table `zone_detail` 834 | -- 835 | ALTER TABLE `zone_detail` 836 | ADD PRIMARY KEY (`zone_id`); 837 | 838 | -- 839 | -- AUTO_INCREMENT for dumped tables 840 | -- 841 | 842 | -- 843 | -- AUTO_INCREMENT for table `address_detail` 844 | -- 845 | ALTER TABLE `address_detail` 846 | MODIFY `address_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 847 | 848 | -- 849 | -- AUTO_INCREMENT for table `area_detail` 850 | -- 851 | ALTER TABLE `area_detail` 852 | MODIFY `area_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; 853 | 854 | -- 855 | -- AUTO_INCREMENT for table `brand_detail` 856 | -- 857 | ALTER TABLE `brand_detail` 858 | MODIFY `brand_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; 859 | 860 | -- 861 | -- AUTO_INCREMENT for table `cart_detail` 862 | -- 863 | ALTER TABLE `cart_detail` 864 | MODIFY `cart_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37; 865 | 866 | -- 867 | -- AUTO_INCREMENT for table `category_detail` 868 | -- 869 | ALTER TABLE `category_detail` 870 | MODIFY `cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; 871 | 872 | -- 873 | -- AUTO_INCREMENT for table `favorite_detail` 874 | -- 875 | ALTER TABLE `favorite_detail` 876 | MODIFY `fav_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; 877 | 878 | -- 879 | -- AUTO_INCREMENT for table `image_detail` 880 | -- 881 | ALTER TABLE `image_detail` 882 | MODIFY `img_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; 883 | 884 | -- 885 | -- AUTO_INCREMENT for table `notification_detail` 886 | -- 887 | ALTER TABLE `notification_detail` 888 | MODIFY `notification_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; 889 | 890 | -- 891 | -- AUTO_INCREMENT for table `nutrition_detail` 892 | -- 893 | ALTER TABLE `nutrition_detail` 894 | MODIFY `nutrition_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=77; 895 | 896 | -- 897 | -- AUTO_INCREMENT for table `offer_detail` 898 | -- 899 | ALTER TABLE `offer_detail` 900 | MODIFY `offer_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 901 | 902 | -- 903 | -- AUTO_INCREMENT for table `order_detail` 904 | -- 905 | ALTER TABLE `order_detail` 906 | MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; 907 | 908 | -- 909 | -- AUTO_INCREMENT for table `order_payment_detail` 910 | -- 911 | ALTER TABLE `order_payment_detail` 912 | MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 913 | 914 | -- 915 | -- AUTO_INCREMENT for table `payment_method_detail` 916 | -- 917 | ALTER TABLE `payment_method_detail` 918 | MODIFY `pay_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 919 | 920 | -- 921 | -- AUTO_INCREMENT for table `product_detail` 922 | -- 923 | ALTER TABLE `product_detail` 924 | MODIFY `prod_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; 925 | 926 | -- 927 | -- AUTO_INCREMENT for table `promo_code_detail` 928 | -- 929 | ALTER TABLE `promo_code_detail` 930 | MODIFY `promo_code_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; 931 | 932 | -- 933 | -- AUTO_INCREMENT for table `review_detail` 934 | -- 935 | ALTER TABLE `review_detail` 936 | MODIFY `review_id` int(11) NOT NULL AUTO_INCREMENT; 937 | 938 | -- 939 | -- AUTO_INCREMENT for table `type_detail` 940 | -- 941 | ALTER TABLE `type_detail` 942 | MODIFY `type_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 943 | 944 | -- 945 | -- AUTO_INCREMENT for table `user_detail` 946 | -- 947 | ALTER TABLE `user_detail` 948 | MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; 949 | 950 | -- 951 | -- AUTO_INCREMENT for table `zone_detail` 952 | -- 953 | ALTER TABLE `zone_detail` 954 | MODIFY `zone_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; 955 | COMMIT; 956 | 957 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 958 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 959 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 960 | -------------------------------------------------------------------------------- /helpers/db_helpers.js: -------------------------------------------------------------------------------- 1 | var mysql = require('mysql') 2 | var config = require('config') 3 | var dbConfig = config.get('dbConfig') 4 | var db = mysql.createConnection(dbConfig); 5 | var helper = require('./helpers') 6 | 7 | if(config.has('optionalFeature.detail')) { 8 | var detail = config.get('optionalFeature.detail'); 9 | helper.Dlog('config: ' + detail); 10 | } 11 | 12 | reconnect(db, () => {}); 13 | 14 | function reconnect(connection, callback) { 15 | helper.Dlog("\n New connection tentative ... (" + helper.serverYYYYMMDDHHmmss() + ")" ) 16 | 17 | connection = mysql.createConnection(dbConfig); 18 | connection.connect((err) => { 19 | if(err) { 20 | helper.ThrowHtmlError(err); 21 | 22 | setTimeout(() => { 23 | helper.Dlog('----------------- DB ReConnecting Error (' + helper.serverYYYYMMDDHHmmss() + ') ....................' ); 24 | 25 | reconnect(connection, callback); 26 | }, 5 * 1000); 27 | }else{ 28 | helper.Dlog('\n\t ----- New Connection established with database. -------'); 29 | db = connection; 30 | return callback(); 31 | } 32 | } ) 33 | 34 | connection.on('error', (err) => { 35 | helper.Dlog('----- App is connection Crash DB Helper (' + helper.serverYYYYMMDDHHmmss() + ') -------'); 36 | 37 | if (err.code === "PROTOCOL_CONNECTION_LOST") { 38 | helper.Dlog("/!\\ PROTOCOL_CONNECTION_LOST Cannot establish a connection with the database. /!\\ (" + err.code + ")"); 39 | reconnect(db, callback); 40 | } else if (err.code === "PROTOCOL_ENQUEUE_AFTER_QUIT") { 41 | helper.Dlog("/!\\ PROTOCOL_ENQUEUE_AFTER_QUIT Cannot establish a connection with the database. /!\\ (" + err.code + ")"); 42 | reconnect(db, callback); 43 | } else if (err.code === "PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR") { 44 | helper.Dlog("/!\\ PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR Cannot establish a connection with the database. /!\\ (" + err.code + ")"); 45 | reconnect(db, callback); 46 | } else if (err.code === "PROTOCOL_ENQUEUE_HANDSHAKE_TWICE") { 47 | helper.Dlog("/!\\ PROTOCOL_ENQUEUE_HANDSHAKE_TWICE Cannot establish a connection with the database. /!\\ (" + err.code + ")"); 48 | reconnect(db, callback); 49 | } else if (err.code === "ECONNREFUSED") { 50 | helper.Dlog("/!\\ ECONNREFUSED Cannot establish a connection with the database. /!\\ (" + err.code + ")"); 51 | reconnect(db, callback); 52 | } else if (err.code === "PROTOCOL_PACKETS_OUT_OF_ORDER") { 53 | helper.Dlog("/!\\ PROTOCOL_PACKETS_OUT_OF_ORDER Cannot establish a connection with the database. /!\\ (" + err.code + ")"); 54 | reconnect(db, callback); 55 | } else { 56 | throw err; 57 | } 58 | }) 59 | 60 | } 61 | 62 | module.exports = { 63 | query: (sqlQuery, args, callback) => { 64 | 65 | if(db.state === 'authenticated' || db.state === "connected") { 66 | db.query(sqlQuery, args, (error, result) => { 67 | return callback(error, result); 68 | }) 69 | }else if ( db.state === "protocol_error" ) { 70 | reconnect(db, () => { 71 | db.query(sqlQuery, args, (error, result) => { 72 | return callback(error, result); 73 | }) 74 | }) 75 | }else{ 76 | reconnect(db, ()=>{ 77 | db.query(sqlQuery, args, (error, result ) => { 78 | return callback(error, result); 79 | } ) 80 | }) 81 | } 82 | 83 | } 84 | } 85 | 86 | process.on('uncaughtException', (err) => { 87 | 88 | helper.Dlog('------------------------ App is Crash DB helper (' + helper.serverYYYYMMDDHHmmss() + ')-------------------------' ); 89 | helper.Dlog(err.code); 90 | helper.ThrowHtmlError(err); 91 | }) 92 | -------------------------------------------------------------------------------- /helpers/helpers.js: -------------------------------------------------------------------------------- 1 | var moment = require('moment-timezone'); 2 | var fs = require('fs'); 3 | const { format } = require('path'); 4 | 5 | const app_debug_mode = true; 6 | const timezone_name = "Asia/Kolkata"; 7 | const msg_server_internal_error = "Server Internal Error" 8 | 9 | module.exports = { 10 | 11 | ImagePath: () => { 12 | return "http://localhost:3001/img/"; 13 | }, 14 | 15 | ThrowHtmlError: (err, res) => { 16 | 17 | Dlog("---------------------------- App is Helpers Throw Crash(" + serverYYYYMMDDHHmmss() + ") -------------------------" ) 18 | Dlog(err.stack); 19 | 20 | fs.appendFile('./crash_log/Crash' + serverDateTime('YYYY-MM-DD HH mm ss ms') + '.txt', err.stack, (err) => { 21 | if(err) { 22 | Dlog(err); 23 | } 24 | }) 25 | 26 | if(res) { 27 | res.json({'status': '0', "message": msg_server_internal_error }) 28 | return 29 | } 30 | }, 31 | 32 | ThrowSocketError: (err, client, eventName ) => { 33 | 34 | Dlog("---------------------------- App is Helpers Throw Crash(" + serverYYYYMMDDHHmmss() + ") -------------------------") 35 | Dlog(err.stack); 36 | 37 | fs.appendFile('./crash_log/Crash' + serverDateTime('YYYY-MM-DD HH mm ss ms') + '.txt', err.stack, (err) => { 38 | if (err) { 39 | Dlog(err); 40 | } 41 | }) 42 | 43 | if (client) { 44 | client.emit(eventName, { 'status': '0', "message": msg_server_internal_error } ) 45 | return 46 | } 47 | }, 48 | 49 | CheckParameterValid: (res, jsonObj, checkKeys, callback) => { 50 | 51 | var isValid = true; 52 | var missingParameter = ""; 53 | 54 | checkKeys.forEach( (key, indexOf) => { 55 | if(!Object.prototype.hasOwnProperty.call(jsonObj, key)) { 56 | isValid = false; 57 | missingParameter += key + " "; 58 | } 59 | }); 60 | 61 | 62 | if(!isValid) { 63 | 64 | if(!app_debug_mode) { 65 | missingParameter = ""; 66 | } 67 | res.json({ 'status': '0', "message": "Missing parameter (" + missingParameter +")" }) 68 | }else{ 69 | return callback() 70 | } 71 | }, 72 | 73 | CheckParameterValidSocket: (client, eventName, jsonObj, checkKeys, callback) => { 74 | 75 | var isValid = true; 76 | var missingParameter = ""; 77 | 78 | checkKeys.forEach((key, indexOf) => { 79 | if (!Object.prototype.hasOwnProperty.call(jsonObj, key)) { 80 | isValid = false; 81 | missingParameter += key + " "; 82 | } 83 | }); 84 | 85 | 86 | if (!isValid) { 87 | 88 | if (!app_debug_mode) { 89 | missingParameter = ""; 90 | } 91 | client.emit(eventName, { 'status': '0', "message": "Missing parameter (" + missingParameter + ")" }) 92 | } else { 93 | return callback() 94 | } 95 | }, 96 | 97 | createRequestToken: () => { 98 | var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 99 | var result = ''; 100 | for (let i = 20; i > 0; i--) { 101 | result += chars[Math.floor(Math.random() * chars.length)]; 102 | 103 | } 104 | 105 | return result; 106 | }, 107 | 108 | Dlog: (log) => { 109 | return Dlog(log); 110 | }, 111 | 112 | serverDateTime:(format) => { 113 | return serverDateTime(format); 114 | }, 115 | 116 | serverYYYYMMDDHHmmss:()=>{ 117 | return serverYYYYMMDDHHmmss(); 118 | }, 119 | 120 | createNumber:(length = 4) => { 121 | var chars = "0123456789" 122 | var result = ''; 123 | for (let i = length; i > 0; i--) { 124 | result += chars[Math.floor(Math.random() * chars.length)]; 125 | } 126 | return result; 127 | }, 128 | 129 | fileNameGenerate: (extension) => { 130 | var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 131 | var result = ''; 132 | for (let i = 10; i > 0; i--) result += chars[Math.floor(Math.random() * chars.length)]; 133 | return serverDateTime('YYYYMMDDHHmmssms') + result + '.' + extension; 134 | }, 135 | 136 | } 137 | 138 | 139 | function serverDateTime(format) { 140 | var jun = moment(new Date()); 141 | jun.tz(timezone_name).format(); 142 | return jun.format(format); 143 | } 144 | 145 | function Dlog(log) { 146 | if (app_debug_mode) { 147 | console.log(log); 148 | } 149 | } 150 | 151 | function serverYYYYMMDDHHmmss() { 152 | return serverDateTime('YYYY-MM-DD HH:mm:ss'); 153 | } 154 | 155 | process.on('uncaughtException', (err) => { 156 | 157 | }) -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "food-delivery", 3 | "version": "0.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "food-delivery", 9 | "version": "0.0.0", 10 | "dependencies": { 11 | "config": "^3.3.9", 12 | "cookie-parser": "~1.4.4", 13 | "cors": "^2.8.5", 14 | "debug": "~2.6.9", 15 | "ejs": "^3.1.9", 16 | "express": "^4.18.2", 17 | "http-errors": "~1.6.3", 18 | "moment-timezone": "^0.5.43", 19 | "morgan": "~1.9.1", 20 | "multiparty": "^4.2.3", 21 | "mysql": "^2.18.1", 22 | "socket.io": "^4.7.0", 23 | "uuid": "^9.0.0" 24 | } 25 | }, 26 | "node_modules/@socket.io/component-emitter": { 27 | "version": "3.1.0", 28 | "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", 29 | "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==" 30 | }, 31 | "node_modules/@types/cookie": { 32 | "version": "0.4.1", 33 | "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", 34 | "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" 35 | }, 36 | "node_modules/@types/cors": { 37 | "version": "2.8.13", 38 | "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", 39 | "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", 40 | "dependencies": { 41 | "@types/node": "*" 42 | } 43 | }, 44 | "node_modules/@types/node": { 45 | "version": "20.3.1", 46 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", 47 | "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==" 48 | }, 49 | "node_modules/accepts": { 50 | "version": "1.3.8", 51 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 52 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 53 | "dependencies": { 54 | "mime-types": "~2.1.34", 55 | "negotiator": "0.6.3" 56 | }, 57 | "engines": { 58 | "node": ">= 0.6" 59 | } 60 | }, 61 | "node_modules/ansi-styles": { 62 | "version": "4.3.0", 63 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 64 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 65 | "dependencies": { 66 | "color-convert": "^2.0.1" 67 | }, 68 | "engines": { 69 | "node": ">=8" 70 | }, 71 | "funding": { 72 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 73 | } 74 | }, 75 | "node_modules/array-flatten": { 76 | "version": "1.1.1", 77 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 78 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" 79 | }, 80 | "node_modules/async": { 81 | "version": "3.2.4", 82 | "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", 83 | "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" 84 | }, 85 | "node_modules/balanced-match": { 86 | "version": "1.0.2", 87 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 88 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 89 | }, 90 | "node_modules/base64id": { 91 | "version": "2.0.0", 92 | "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", 93 | "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", 94 | "engines": { 95 | "node": "^4.5.0 || >= 5.9" 96 | } 97 | }, 98 | "node_modules/basic-auth": { 99 | "version": "2.0.1", 100 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", 101 | "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", 102 | "dependencies": { 103 | "safe-buffer": "5.1.2" 104 | }, 105 | "engines": { 106 | "node": ">= 0.8" 107 | } 108 | }, 109 | "node_modules/bignumber.js": { 110 | "version": "9.0.0", 111 | "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", 112 | "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", 113 | "engines": { 114 | "node": "*" 115 | } 116 | }, 117 | "node_modules/body-parser": { 118 | "version": "1.20.1", 119 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", 120 | "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", 121 | "dependencies": { 122 | "bytes": "3.1.2", 123 | "content-type": "~1.0.4", 124 | "debug": "2.6.9", 125 | "depd": "2.0.0", 126 | "destroy": "1.2.0", 127 | "http-errors": "2.0.0", 128 | "iconv-lite": "0.4.24", 129 | "on-finished": "2.4.1", 130 | "qs": "6.11.0", 131 | "raw-body": "2.5.1", 132 | "type-is": "~1.6.18", 133 | "unpipe": "1.0.0" 134 | }, 135 | "engines": { 136 | "node": ">= 0.8", 137 | "npm": "1.2.8000 || >= 1.4.16" 138 | } 139 | }, 140 | "node_modules/body-parser/node_modules/depd": { 141 | "version": "2.0.0", 142 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 143 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 144 | "engines": { 145 | "node": ">= 0.8" 146 | } 147 | }, 148 | "node_modules/body-parser/node_modules/http-errors": { 149 | "version": "2.0.0", 150 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 151 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 152 | "dependencies": { 153 | "depd": "2.0.0", 154 | "inherits": "2.0.4", 155 | "setprototypeof": "1.2.0", 156 | "statuses": "2.0.1", 157 | "toidentifier": "1.0.1" 158 | }, 159 | "engines": { 160 | "node": ">= 0.8" 161 | } 162 | }, 163 | "node_modules/body-parser/node_modules/inherits": { 164 | "version": "2.0.4", 165 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 166 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 167 | }, 168 | "node_modules/body-parser/node_modules/on-finished": { 169 | "version": "2.4.1", 170 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 171 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 172 | "dependencies": { 173 | "ee-first": "1.1.1" 174 | }, 175 | "engines": { 176 | "node": ">= 0.8" 177 | } 178 | }, 179 | "node_modules/body-parser/node_modules/setprototypeof": { 180 | "version": "1.2.0", 181 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 182 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 183 | }, 184 | "node_modules/body-parser/node_modules/statuses": { 185 | "version": "2.0.1", 186 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 187 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 188 | "engines": { 189 | "node": ">= 0.8" 190 | } 191 | }, 192 | "node_modules/brace-expansion": { 193 | "version": "1.1.11", 194 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 195 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 196 | "dependencies": { 197 | "balanced-match": "^1.0.0", 198 | "concat-map": "0.0.1" 199 | } 200 | }, 201 | "node_modules/bytes": { 202 | "version": "3.1.2", 203 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 204 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 205 | "engines": { 206 | "node": ">= 0.8" 207 | } 208 | }, 209 | "node_modules/call-bind": { 210 | "version": "1.0.2", 211 | "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 212 | "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 213 | "dependencies": { 214 | "function-bind": "^1.1.1", 215 | "get-intrinsic": "^1.0.2" 216 | }, 217 | "funding": { 218 | "url": "https://github.com/sponsors/ljharb" 219 | } 220 | }, 221 | "node_modules/chalk": { 222 | "version": "4.1.2", 223 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 224 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 225 | "dependencies": { 226 | "ansi-styles": "^4.1.0", 227 | "supports-color": "^7.1.0" 228 | }, 229 | "engines": { 230 | "node": ">=10" 231 | }, 232 | "funding": { 233 | "url": "https://github.com/chalk/chalk?sponsor=1" 234 | } 235 | }, 236 | "node_modules/color-convert": { 237 | "version": "2.0.1", 238 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 239 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 240 | "dependencies": { 241 | "color-name": "~1.1.4" 242 | }, 243 | "engines": { 244 | "node": ">=7.0.0" 245 | } 246 | }, 247 | "node_modules/color-name": { 248 | "version": "1.1.4", 249 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 250 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 251 | }, 252 | "node_modules/concat-map": { 253 | "version": "0.0.1", 254 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 255 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" 256 | }, 257 | "node_modules/config": { 258 | "version": "3.3.9", 259 | "resolved": "https://registry.npmjs.org/config/-/config-3.3.9.tgz", 260 | "integrity": "sha512-G17nfe+cY7kR0wVpc49NCYvNtelm/pPy8czHoFkAgtV1lkmcp7DHtWCdDu+C9Z7gb2WVqa9Tm3uF9aKaPbCfhg==", 261 | "dependencies": { 262 | "json5": "^2.2.3" 263 | }, 264 | "engines": { 265 | "node": ">= 10.0.0" 266 | } 267 | }, 268 | "node_modules/content-disposition": { 269 | "version": "0.5.4", 270 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 271 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 272 | "dependencies": { 273 | "safe-buffer": "5.2.1" 274 | }, 275 | "engines": { 276 | "node": ">= 0.6" 277 | } 278 | }, 279 | "node_modules/content-disposition/node_modules/safe-buffer": { 280 | "version": "5.2.1", 281 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 282 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 283 | "funding": [ 284 | { 285 | "type": "github", 286 | "url": "https://github.com/sponsors/feross" 287 | }, 288 | { 289 | "type": "patreon", 290 | "url": "https://www.patreon.com/feross" 291 | }, 292 | { 293 | "type": "consulting", 294 | "url": "https://feross.org/support" 295 | } 296 | ] 297 | }, 298 | "node_modules/content-type": { 299 | "version": "1.0.5", 300 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 301 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 302 | "engines": { 303 | "node": ">= 0.6" 304 | } 305 | }, 306 | "node_modules/cookie": { 307 | "version": "0.4.1", 308 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", 309 | "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", 310 | "engines": { 311 | "node": ">= 0.6" 312 | } 313 | }, 314 | "node_modules/cookie-parser": { 315 | "version": "1.4.6", 316 | "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", 317 | "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", 318 | "dependencies": { 319 | "cookie": "0.4.1", 320 | "cookie-signature": "1.0.6" 321 | }, 322 | "engines": { 323 | "node": ">= 0.8.0" 324 | } 325 | }, 326 | "node_modules/cookie-signature": { 327 | "version": "1.0.6", 328 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 329 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" 330 | }, 331 | "node_modules/core-util-is": { 332 | "version": "1.0.3", 333 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 334 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" 335 | }, 336 | "node_modules/cors": { 337 | "version": "2.8.5", 338 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 339 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 340 | "dependencies": { 341 | "object-assign": "^4", 342 | "vary": "^1" 343 | }, 344 | "engines": { 345 | "node": ">= 0.10" 346 | } 347 | }, 348 | "node_modules/debug": { 349 | "version": "2.6.9", 350 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 351 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 352 | "dependencies": { 353 | "ms": "2.0.0" 354 | } 355 | }, 356 | "node_modules/depd": { 357 | "version": "1.1.2", 358 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 359 | "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", 360 | "engines": { 361 | "node": ">= 0.6" 362 | } 363 | }, 364 | "node_modules/destroy": { 365 | "version": "1.2.0", 366 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 367 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 368 | "engines": { 369 | "node": ">= 0.8", 370 | "npm": "1.2.8000 || >= 1.4.16" 371 | } 372 | }, 373 | "node_modules/ee-first": { 374 | "version": "1.1.1", 375 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 376 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" 377 | }, 378 | "node_modules/ejs": { 379 | "version": "3.1.9", 380 | "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", 381 | "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", 382 | "dependencies": { 383 | "jake": "^10.8.5" 384 | }, 385 | "bin": { 386 | "ejs": "bin/cli.js" 387 | }, 388 | "engines": { 389 | "node": ">=0.10.0" 390 | } 391 | }, 392 | "node_modules/encodeurl": { 393 | "version": "1.0.2", 394 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 395 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 396 | "engines": { 397 | "node": ">= 0.8" 398 | } 399 | }, 400 | "node_modules/engine.io": { 401 | "version": "6.5.0", 402 | "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.0.tgz", 403 | "integrity": "sha512-UlfoK1iD62Hkedw2TmuHdhDsZCGaAyp+LZ/AvnImjYBeWagA3qIEETum90d6shMeFZiDuGT66zVCdx1wKYKGGg==", 404 | "dependencies": { 405 | "@types/cookie": "^0.4.1", 406 | "@types/cors": "^2.8.12", 407 | "@types/node": ">=10.0.0", 408 | "accepts": "~1.3.4", 409 | "base64id": "2.0.0", 410 | "cookie": "~0.4.1", 411 | "cors": "~2.8.5", 412 | "debug": "~4.3.1", 413 | "engine.io-parser": "~5.1.0", 414 | "ws": "~8.11.0" 415 | }, 416 | "engines": { 417 | "node": ">=10.0.0" 418 | } 419 | }, 420 | "node_modules/engine.io-parser": { 421 | "version": "5.1.0", 422 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.1.0.tgz", 423 | "integrity": "sha512-enySgNiK5tyZFynt3z7iqBR+Bto9EVVVvDFuTT0ioHCGbzirZVGDGiQjZzEp8hWl6hd5FSVytJGuScX1C1C35w==", 424 | "engines": { 425 | "node": ">=10.0.0" 426 | } 427 | }, 428 | "node_modules/engine.io/node_modules/debug": { 429 | "version": "4.3.4", 430 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 431 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 432 | "dependencies": { 433 | "ms": "2.1.2" 434 | }, 435 | "engines": { 436 | "node": ">=6.0" 437 | }, 438 | "peerDependenciesMeta": { 439 | "supports-color": { 440 | "optional": true 441 | } 442 | } 443 | }, 444 | "node_modules/engine.io/node_modules/ms": { 445 | "version": "2.1.2", 446 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 447 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 448 | }, 449 | "node_modules/escape-html": { 450 | "version": "1.0.3", 451 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 452 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" 453 | }, 454 | "node_modules/etag": { 455 | "version": "1.8.1", 456 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 457 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 458 | "engines": { 459 | "node": ">= 0.6" 460 | } 461 | }, 462 | "node_modules/express": { 463 | "version": "4.18.2", 464 | "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", 465 | "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", 466 | "dependencies": { 467 | "accepts": "~1.3.8", 468 | "array-flatten": "1.1.1", 469 | "body-parser": "1.20.1", 470 | "content-disposition": "0.5.4", 471 | "content-type": "~1.0.4", 472 | "cookie": "0.5.0", 473 | "cookie-signature": "1.0.6", 474 | "debug": "2.6.9", 475 | "depd": "2.0.0", 476 | "encodeurl": "~1.0.2", 477 | "escape-html": "~1.0.3", 478 | "etag": "~1.8.1", 479 | "finalhandler": "1.2.0", 480 | "fresh": "0.5.2", 481 | "http-errors": "2.0.0", 482 | "merge-descriptors": "1.0.1", 483 | "methods": "~1.1.2", 484 | "on-finished": "2.4.1", 485 | "parseurl": "~1.3.3", 486 | "path-to-regexp": "0.1.7", 487 | "proxy-addr": "~2.0.7", 488 | "qs": "6.11.0", 489 | "range-parser": "~1.2.1", 490 | "safe-buffer": "5.2.1", 491 | "send": "0.18.0", 492 | "serve-static": "1.15.0", 493 | "setprototypeof": "1.2.0", 494 | "statuses": "2.0.1", 495 | "type-is": "~1.6.18", 496 | "utils-merge": "1.0.1", 497 | "vary": "~1.1.2" 498 | }, 499 | "engines": { 500 | "node": ">= 0.10.0" 501 | } 502 | }, 503 | "node_modules/express/node_modules/cookie": { 504 | "version": "0.5.0", 505 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", 506 | "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", 507 | "engines": { 508 | "node": ">= 0.6" 509 | } 510 | }, 511 | "node_modules/express/node_modules/depd": { 512 | "version": "2.0.0", 513 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 514 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 515 | "engines": { 516 | "node": ">= 0.8" 517 | } 518 | }, 519 | "node_modules/express/node_modules/http-errors": { 520 | "version": "2.0.0", 521 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 522 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 523 | "dependencies": { 524 | "depd": "2.0.0", 525 | "inherits": "2.0.4", 526 | "setprototypeof": "1.2.0", 527 | "statuses": "2.0.1", 528 | "toidentifier": "1.0.1" 529 | }, 530 | "engines": { 531 | "node": ">= 0.8" 532 | } 533 | }, 534 | "node_modules/express/node_modules/inherits": { 535 | "version": "2.0.4", 536 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 537 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 538 | }, 539 | "node_modules/express/node_modules/on-finished": { 540 | "version": "2.4.1", 541 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 542 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 543 | "dependencies": { 544 | "ee-first": "1.1.1" 545 | }, 546 | "engines": { 547 | "node": ">= 0.8" 548 | } 549 | }, 550 | "node_modules/express/node_modules/safe-buffer": { 551 | "version": "5.2.1", 552 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 553 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 554 | "funding": [ 555 | { 556 | "type": "github", 557 | "url": "https://github.com/sponsors/feross" 558 | }, 559 | { 560 | "type": "patreon", 561 | "url": "https://www.patreon.com/feross" 562 | }, 563 | { 564 | "type": "consulting", 565 | "url": "https://feross.org/support" 566 | } 567 | ] 568 | }, 569 | "node_modules/express/node_modules/setprototypeof": { 570 | "version": "1.2.0", 571 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 572 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 573 | }, 574 | "node_modules/express/node_modules/statuses": { 575 | "version": "2.0.1", 576 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 577 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 578 | "engines": { 579 | "node": ">= 0.8" 580 | } 581 | }, 582 | "node_modules/filelist": { 583 | "version": "1.0.4", 584 | "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", 585 | "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", 586 | "dependencies": { 587 | "minimatch": "^5.0.1" 588 | } 589 | }, 590 | "node_modules/filelist/node_modules/brace-expansion": { 591 | "version": "2.0.1", 592 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", 593 | "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", 594 | "dependencies": { 595 | "balanced-match": "^1.0.0" 596 | } 597 | }, 598 | "node_modules/filelist/node_modules/minimatch": { 599 | "version": "5.1.6", 600 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", 601 | "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", 602 | "dependencies": { 603 | "brace-expansion": "^2.0.1" 604 | }, 605 | "engines": { 606 | "node": ">=10" 607 | } 608 | }, 609 | "node_modules/finalhandler": { 610 | "version": "1.2.0", 611 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", 612 | "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", 613 | "dependencies": { 614 | "debug": "2.6.9", 615 | "encodeurl": "~1.0.2", 616 | "escape-html": "~1.0.3", 617 | "on-finished": "2.4.1", 618 | "parseurl": "~1.3.3", 619 | "statuses": "2.0.1", 620 | "unpipe": "~1.0.0" 621 | }, 622 | "engines": { 623 | "node": ">= 0.8" 624 | } 625 | }, 626 | "node_modules/finalhandler/node_modules/on-finished": { 627 | "version": "2.4.1", 628 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 629 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 630 | "dependencies": { 631 | "ee-first": "1.1.1" 632 | }, 633 | "engines": { 634 | "node": ">= 0.8" 635 | } 636 | }, 637 | "node_modules/finalhandler/node_modules/statuses": { 638 | "version": "2.0.1", 639 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 640 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 641 | "engines": { 642 | "node": ">= 0.8" 643 | } 644 | }, 645 | "node_modules/forwarded": { 646 | "version": "0.2.0", 647 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 648 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 649 | "engines": { 650 | "node": ">= 0.6" 651 | } 652 | }, 653 | "node_modules/fresh": { 654 | "version": "0.5.2", 655 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 656 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 657 | "engines": { 658 | "node": ">= 0.6" 659 | } 660 | }, 661 | "node_modules/function-bind": { 662 | "version": "1.1.1", 663 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 664 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 665 | }, 666 | "node_modules/get-intrinsic": { 667 | "version": "1.2.1", 668 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", 669 | "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", 670 | "dependencies": { 671 | "function-bind": "^1.1.1", 672 | "has": "^1.0.3", 673 | "has-proto": "^1.0.1", 674 | "has-symbols": "^1.0.3" 675 | }, 676 | "funding": { 677 | "url": "https://github.com/sponsors/ljharb" 678 | } 679 | }, 680 | "node_modules/has": { 681 | "version": "1.0.3", 682 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 683 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 684 | "dependencies": { 685 | "function-bind": "^1.1.1" 686 | }, 687 | "engines": { 688 | "node": ">= 0.4.0" 689 | } 690 | }, 691 | "node_modules/has-flag": { 692 | "version": "4.0.0", 693 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 694 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 695 | "engines": { 696 | "node": ">=8" 697 | } 698 | }, 699 | "node_modules/has-proto": { 700 | "version": "1.0.1", 701 | "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", 702 | "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", 703 | "engines": { 704 | "node": ">= 0.4" 705 | }, 706 | "funding": { 707 | "url": "https://github.com/sponsors/ljharb" 708 | } 709 | }, 710 | "node_modules/has-symbols": { 711 | "version": "1.0.3", 712 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", 713 | "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", 714 | "engines": { 715 | "node": ">= 0.4" 716 | }, 717 | "funding": { 718 | "url": "https://github.com/sponsors/ljharb" 719 | } 720 | }, 721 | "node_modules/http-errors": { 722 | "version": "1.6.3", 723 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 724 | "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", 725 | "dependencies": { 726 | "depd": "~1.1.2", 727 | "inherits": "2.0.3", 728 | "setprototypeof": "1.1.0", 729 | "statuses": ">= 1.4.0 < 2" 730 | }, 731 | "engines": { 732 | "node": ">= 0.6" 733 | } 734 | }, 735 | "node_modules/iconv-lite": { 736 | "version": "0.4.24", 737 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 738 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 739 | "dependencies": { 740 | "safer-buffer": ">= 2.1.2 < 3" 741 | }, 742 | "engines": { 743 | "node": ">=0.10.0" 744 | } 745 | }, 746 | "node_modules/inherits": { 747 | "version": "2.0.3", 748 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 749 | "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" 750 | }, 751 | "node_modules/ipaddr.js": { 752 | "version": "1.9.1", 753 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 754 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 755 | "engines": { 756 | "node": ">= 0.10" 757 | } 758 | }, 759 | "node_modules/isarray": { 760 | "version": "1.0.0", 761 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 762 | "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" 763 | }, 764 | "node_modules/jake": { 765 | "version": "10.8.7", 766 | "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", 767 | "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", 768 | "dependencies": { 769 | "async": "^3.2.3", 770 | "chalk": "^4.0.2", 771 | "filelist": "^1.0.4", 772 | "minimatch": "^3.1.2" 773 | }, 774 | "bin": { 775 | "jake": "bin/cli.js" 776 | }, 777 | "engines": { 778 | "node": ">=10" 779 | } 780 | }, 781 | "node_modules/json5": { 782 | "version": "2.2.3", 783 | "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", 784 | "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", 785 | "bin": { 786 | "json5": "lib/cli.js" 787 | }, 788 | "engines": { 789 | "node": ">=6" 790 | } 791 | }, 792 | "node_modules/media-typer": { 793 | "version": "0.3.0", 794 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 795 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 796 | "engines": { 797 | "node": ">= 0.6" 798 | } 799 | }, 800 | "node_modules/merge-descriptors": { 801 | "version": "1.0.1", 802 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 803 | "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" 804 | }, 805 | "node_modules/methods": { 806 | "version": "1.1.2", 807 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 808 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 809 | "engines": { 810 | "node": ">= 0.6" 811 | } 812 | }, 813 | "node_modules/mime": { 814 | "version": "1.6.0", 815 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 816 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 817 | "bin": { 818 | "mime": "cli.js" 819 | }, 820 | "engines": { 821 | "node": ">=4" 822 | } 823 | }, 824 | "node_modules/mime-db": { 825 | "version": "1.52.0", 826 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 827 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 828 | "engines": { 829 | "node": ">= 0.6" 830 | } 831 | }, 832 | "node_modules/mime-types": { 833 | "version": "2.1.35", 834 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 835 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 836 | "dependencies": { 837 | "mime-db": "1.52.0" 838 | }, 839 | "engines": { 840 | "node": ">= 0.6" 841 | } 842 | }, 843 | "node_modules/minimatch": { 844 | "version": "3.1.2", 845 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 846 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 847 | "dependencies": { 848 | "brace-expansion": "^1.1.7" 849 | }, 850 | "engines": { 851 | "node": "*" 852 | } 853 | }, 854 | "node_modules/moment": { 855 | "version": "2.29.4", 856 | "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", 857 | "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", 858 | "engines": { 859 | "node": "*" 860 | } 861 | }, 862 | "node_modules/moment-timezone": { 863 | "version": "0.5.43", 864 | "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz", 865 | "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", 866 | "dependencies": { 867 | "moment": "^2.29.4" 868 | }, 869 | "engines": { 870 | "node": "*" 871 | } 872 | }, 873 | "node_modules/morgan": { 874 | "version": "1.9.1", 875 | "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", 876 | "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", 877 | "dependencies": { 878 | "basic-auth": "~2.0.0", 879 | "debug": "2.6.9", 880 | "depd": "~1.1.2", 881 | "on-finished": "~2.3.0", 882 | "on-headers": "~1.0.1" 883 | }, 884 | "engines": { 885 | "node": ">= 0.8.0" 886 | } 887 | }, 888 | "node_modules/ms": { 889 | "version": "2.0.0", 890 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 891 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" 892 | }, 893 | "node_modules/multiparty": { 894 | "version": "4.2.3", 895 | "resolved": "https://registry.npmjs.org/multiparty/-/multiparty-4.2.3.tgz", 896 | "integrity": "sha512-Ak6EUJZuhGS8hJ3c2fY6UW5MbkGUPMBEGd13djUzoY/BHqV/gTuFWtC6IuVA7A2+v3yjBS6c4or50xhzTQZImQ==", 897 | "dependencies": { 898 | "http-errors": "~1.8.1", 899 | "safe-buffer": "5.2.1", 900 | "uid-safe": "2.1.5" 901 | }, 902 | "engines": { 903 | "node": ">= 0.10" 904 | } 905 | }, 906 | "node_modules/multiparty/node_modules/http-errors": { 907 | "version": "1.8.1", 908 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", 909 | "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", 910 | "dependencies": { 911 | "depd": "~1.1.2", 912 | "inherits": "2.0.4", 913 | "setprototypeof": "1.2.0", 914 | "statuses": ">= 1.5.0 < 2", 915 | "toidentifier": "1.0.1" 916 | }, 917 | "engines": { 918 | "node": ">= 0.6" 919 | } 920 | }, 921 | "node_modules/multiparty/node_modules/inherits": { 922 | "version": "2.0.4", 923 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 924 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 925 | }, 926 | "node_modules/multiparty/node_modules/safe-buffer": { 927 | "version": "5.2.1", 928 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 929 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 930 | "funding": [ 931 | { 932 | "type": "github", 933 | "url": "https://github.com/sponsors/feross" 934 | }, 935 | { 936 | "type": "patreon", 937 | "url": "https://www.patreon.com/feross" 938 | }, 939 | { 940 | "type": "consulting", 941 | "url": "https://feross.org/support" 942 | } 943 | ] 944 | }, 945 | "node_modules/multiparty/node_modules/setprototypeof": { 946 | "version": "1.2.0", 947 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 948 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 949 | }, 950 | "node_modules/mysql": { 951 | "version": "2.18.1", 952 | "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", 953 | "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", 954 | "dependencies": { 955 | "bignumber.js": "9.0.0", 956 | "readable-stream": "2.3.7", 957 | "safe-buffer": "5.1.2", 958 | "sqlstring": "2.3.1" 959 | }, 960 | "engines": { 961 | "node": ">= 0.6" 962 | } 963 | }, 964 | "node_modules/negotiator": { 965 | "version": "0.6.3", 966 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 967 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 968 | "engines": { 969 | "node": ">= 0.6" 970 | } 971 | }, 972 | "node_modules/object-assign": { 973 | "version": "4.1.1", 974 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 975 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 976 | "engines": { 977 | "node": ">=0.10.0" 978 | } 979 | }, 980 | "node_modules/object-inspect": { 981 | "version": "1.12.3", 982 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", 983 | "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", 984 | "funding": { 985 | "url": "https://github.com/sponsors/ljharb" 986 | } 987 | }, 988 | "node_modules/on-finished": { 989 | "version": "2.3.0", 990 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 991 | "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", 992 | "dependencies": { 993 | "ee-first": "1.1.1" 994 | }, 995 | "engines": { 996 | "node": ">= 0.8" 997 | } 998 | }, 999 | "node_modules/on-headers": { 1000 | "version": "1.0.2", 1001 | "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", 1002 | "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", 1003 | "engines": { 1004 | "node": ">= 0.8" 1005 | } 1006 | }, 1007 | "node_modules/parseurl": { 1008 | "version": "1.3.3", 1009 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1010 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 1011 | "engines": { 1012 | "node": ">= 0.8" 1013 | } 1014 | }, 1015 | "node_modules/path-to-regexp": { 1016 | "version": "0.1.7", 1017 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1018 | "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" 1019 | }, 1020 | "node_modules/process-nextick-args": { 1021 | "version": "2.0.1", 1022 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 1023 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 1024 | }, 1025 | "node_modules/proxy-addr": { 1026 | "version": "2.0.7", 1027 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 1028 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 1029 | "dependencies": { 1030 | "forwarded": "0.2.0", 1031 | "ipaddr.js": "1.9.1" 1032 | }, 1033 | "engines": { 1034 | "node": ">= 0.10" 1035 | } 1036 | }, 1037 | "node_modules/qs": { 1038 | "version": "6.11.0", 1039 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", 1040 | "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", 1041 | "dependencies": { 1042 | "side-channel": "^1.0.4" 1043 | }, 1044 | "engines": { 1045 | "node": ">=0.6" 1046 | }, 1047 | "funding": { 1048 | "url": "https://github.com/sponsors/ljharb" 1049 | } 1050 | }, 1051 | "node_modules/random-bytes": { 1052 | "version": "1.0.0", 1053 | "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", 1054 | "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", 1055 | "engines": { 1056 | "node": ">= 0.8" 1057 | } 1058 | }, 1059 | "node_modules/range-parser": { 1060 | "version": "1.2.1", 1061 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1062 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 1063 | "engines": { 1064 | "node": ">= 0.6" 1065 | } 1066 | }, 1067 | "node_modules/raw-body": { 1068 | "version": "2.5.1", 1069 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", 1070 | "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", 1071 | "dependencies": { 1072 | "bytes": "3.1.2", 1073 | "http-errors": "2.0.0", 1074 | "iconv-lite": "0.4.24", 1075 | "unpipe": "1.0.0" 1076 | }, 1077 | "engines": { 1078 | "node": ">= 0.8" 1079 | } 1080 | }, 1081 | "node_modules/raw-body/node_modules/depd": { 1082 | "version": "2.0.0", 1083 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 1084 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 1085 | "engines": { 1086 | "node": ">= 0.8" 1087 | } 1088 | }, 1089 | "node_modules/raw-body/node_modules/http-errors": { 1090 | "version": "2.0.0", 1091 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 1092 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 1093 | "dependencies": { 1094 | "depd": "2.0.0", 1095 | "inherits": "2.0.4", 1096 | "setprototypeof": "1.2.0", 1097 | "statuses": "2.0.1", 1098 | "toidentifier": "1.0.1" 1099 | }, 1100 | "engines": { 1101 | "node": ">= 0.8" 1102 | } 1103 | }, 1104 | "node_modules/raw-body/node_modules/inherits": { 1105 | "version": "2.0.4", 1106 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 1107 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 1108 | }, 1109 | "node_modules/raw-body/node_modules/setprototypeof": { 1110 | "version": "1.2.0", 1111 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 1112 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 1113 | }, 1114 | "node_modules/raw-body/node_modules/statuses": { 1115 | "version": "2.0.1", 1116 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1117 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 1118 | "engines": { 1119 | "node": ">= 0.8" 1120 | } 1121 | }, 1122 | "node_modules/readable-stream": { 1123 | "version": "2.3.7", 1124 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 1125 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 1126 | "dependencies": { 1127 | "core-util-is": "~1.0.0", 1128 | "inherits": "~2.0.3", 1129 | "isarray": "~1.0.0", 1130 | "process-nextick-args": "~2.0.0", 1131 | "safe-buffer": "~5.1.1", 1132 | "string_decoder": "~1.1.1", 1133 | "util-deprecate": "~1.0.1" 1134 | } 1135 | }, 1136 | "node_modules/safe-buffer": { 1137 | "version": "5.1.2", 1138 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1139 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1140 | }, 1141 | "node_modules/safer-buffer": { 1142 | "version": "2.1.2", 1143 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1144 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1145 | }, 1146 | "node_modules/send": { 1147 | "version": "0.18.0", 1148 | "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", 1149 | "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", 1150 | "dependencies": { 1151 | "debug": "2.6.9", 1152 | "depd": "2.0.0", 1153 | "destroy": "1.2.0", 1154 | "encodeurl": "~1.0.2", 1155 | "escape-html": "~1.0.3", 1156 | "etag": "~1.8.1", 1157 | "fresh": "0.5.2", 1158 | "http-errors": "2.0.0", 1159 | "mime": "1.6.0", 1160 | "ms": "2.1.3", 1161 | "on-finished": "2.4.1", 1162 | "range-parser": "~1.2.1", 1163 | "statuses": "2.0.1" 1164 | }, 1165 | "engines": { 1166 | "node": ">= 0.8.0" 1167 | } 1168 | }, 1169 | "node_modules/send/node_modules/depd": { 1170 | "version": "2.0.0", 1171 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 1172 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 1173 | "engines": { 1174 | "node": ">= 0.8" 1175 | } 1176 | }, 1177 | "node_modules/send/node_modules/http-errors": { 1178 | "version": "2.0.0", 1179 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 1180 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 1181 | "dependencies": { 1182 | "depd": "2.0.0", 1183 | "inherits": "2.0.4", 1184 | "setprototypeof": "1.2.0", 1185 | "statuses": "2.0.1", 1186 | "toidentifier": "1.0.1" 1187 | }, 1188 | "engines": { 1189 | "node": ">= 0.8" 1190 | } 1191 | }, 1192 | "node_modules/send/node_modules/inherits": { 1193 | "version": "2.0.4", 1194 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 1195 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 1196 | }, 1197 | "node_modules/send/node_modules/ms": { 1198 | "version": "2.1.3", 1199 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1200 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 1201 | }, 1202 | "node_modules/send/node_modules/on-finished": { 1203 | "version": "2.4.1", 1204 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 1205 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 1206 | "dependencies": { 1207 | "ee-first": "1.1.1" 1208 | }, 1209 | "engines": { 1210 | "node": ">= 0.8" 1211 | } 1212 | }, 1213 | "node_modules/send/node_modules/setprototypeof": { 1214 | "version": "1.2.0", 1215 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 1216 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 1217 | }, 1218 | "node_modules/send/node_modules/statuses": { 1219 | "version": "2.0.1", 1220 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1221 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 1222 | "engines": { 1223 | "node": ">= 0.8" 1224 | } 1225 | }, 1226 | "node_modules/serve-static": { 1227 | "version": "1.15.0", 1228 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", 1229 | "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", 1230 | "dependencies": { 1231 | "encodeurl": "~1.0.2", 1232 | "escape-html": "~1.0.3", 1233 | "parseurl": "~1.3.3", 1234 | "send": "0.18.0" 1235 | }, 1236 | "engines": { 1237 | "node": ">= 0.8.0" 1238 | } 1239 | }, 1240 | "node_modules/setprototypeof": { 1241 | "version": "1.1.0", 1242 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 1243 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 1244 | }, 1245 | "node_modules/side-channel": { 1246 | "version": "1.0.4", 1247 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", 1248 | "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", 1249 | "dependencies": { 1250 | "call-bind": "^1.0.0", 1251 | "get-intrinsic": "^1.0.2", 1252 | "object-inspect": "^1.9.0" 1253 | }, 1254 | "funding": { 1255 | "url": "https://github.com/sponsors/ljharb" 1256 | } 1257 | }, 1258 | "node_modules/socket.io": { 1259 | "version": "4.7.0", 1260 | "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.0.tgz", 1261 | "integrity": "sha512-eOpu7oCNiPGBHn9Falg0cAGivp6TpDI3Yt596fbsf+vln8kRLFWxXKrecFrybn/xNYVn9HcdJNAkYToCmTjsyg==", 1262 | "dependencies": { 1263 | "accepts": "~1.3.4", 1264 | "base64id": "~2.0.0", 1265 | "cors": "~2.8.5", 1266 | "debug": "~4.3.2", 1267 | "engine.io": "~6.5.0", 1268 | "socket.io-adapter": "~2.5.2", 1269 | "socket.io-parser": "~4.2.4" 1270 | }, 1271 | "engines": { 1272 | "node": ">=10.0.0" 1273 | } 1274 | }, 1275 | "node_modules/socket.io-adapter": { 1276 | "version": "2.5.2", 1277 | "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", 1278 | "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", 1279 | "dependencies": { 1280 | "ws": "~8.11.0" 1281 | } 1282 | }, 1283 | "node_modules/socket.io-parser": { 1284 | "version": "4.2.4", 1285 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", 1286 | "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", 1287 | "dependencies": { 1288 | "@socket.io/component-emitter": "~3.1.0", 1289 | "debug": "~4.3.1" 1290 | }, 1291 | "engines": { 1292 | "node": ">=10.0.0" 1293 | } 1294 | }, 1295 | "node_modules/socket.io-parser/node_modules/debug": { 1296 | "version": "4.3.4", 1297 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 1298 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 1299 | "dependencies": { 1300 | "ms": "2.1.2" 1301 | }, 1302 | "engines": { 1303 | "node": ">=6.0" 1304 | }, 1305 | "peerDependenciesMeta": { 1306 | "supports-color": { 1307 | "optional": true 1308 | } 1309 | } 1310 | }, 1311 | "node_modules/socket.io-parser/node_modules/ms": { 1312 | "version": "2.1.2", 1313 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1314 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 1315 | }, 1316 | "node_modules/socket.io/node_modules/debug": { 1317 | "version": "4.3.4", 1318 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", 1319 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", 1320 | "dependencies": { 1321 | "ms": "2.1.2" 1322 | }, 1323 | "engines": { 1324 | "node": ">=6.0" 1325 | }, 1326 | "peerDependenciesMeta": { 1327 | "supports-color": { 1328 | "optional": true 1329 | } 1330 | } 1331 | }, 1332 | "node_modules/socket.io/node_modules/ms": { 1333 | "version": "2.1.2", 1334 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1335 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 1336 | }, 1337 | "node_modules/sqlstring": { 1338 | "version": "2.3.1", 1339 | "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", 1340 | "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==", 1341 | "engines": { 1342 | "node": ">= 0.6" 1343 | } 1344 | }, 1345 | "node_modules/statuses": { 1346 | "version": "1.5.0", 1347 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 1348 | "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", 1349 | "engines": { 1350 | "node": ">= 0.6" 1351 | } 1352 | }, 1353 | "node_modules/string_decoder": { 1354 | "version": "1.1.1", 1355 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 1356 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 1357 | "dependencies": { 1358 | "safe-buffer": "~5.1.0" 1359 | } 1360 | }, 1361 | "node_modules/supports-color": { 1362 | "version": "7.2.0", 1363 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 1364 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 1365 | "dependencies": { 1366 | "has-flag": "^4.0.0" 1367 | }, 1368 | "engines": { 1369 | "node": ">=8" 1370 | } 1371 | }, 1372 | "node_modules/toidentifier": { 1373 | "version": "1.0.1", 1374 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 1375 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1376 | "engines": { 1377 | "node": ">=0.6" 1378 | } 1379 | }, 1380 | "node_modules/type-is": { 1381 | "version": "1.6.18", 1382 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1383 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1384 | "dependencies": { 1385 | "media-typer": "0.3.0", 1386 | "mime-types": "~2.1.24" 1387 | }, 1388 | "engines": { 1389 | "node": ">= 0.6" 1390 | } 1391 | }, 1392 | "node_modules/uid-safe": { 1393 | "version": "2.1.5", 1394 | "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", 1395 | "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", 1396 | "dependencies": { 1397 | "random-bytes": "~1.0.0" 1398 | }, 1399 | "engines": { 1400 | "node": ">= 0.8" 1401 | } 1402 | }, 1403 | "node_modules/unpipe": { 1404 | "version": "1.0.0", 1405 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1406 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1407 | "engines": { 1408 | "node": ">= 0.8" 1409 | } 1410 | }, 1411 | "node_modules/util-deprecate": { 1412 | "version": "1.0.2", 1413 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1414 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" 1415 | }, 1416 | "node_modules/utils-merge": { 1417 | "version": "1.0.1", 1418 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1419 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 1420 | "engines": { 1421 | "node": ">= 0.4.0" 1422 | } 1423 | }, 1424 | "node_modules/uuid": { 1425 | "version": "9.0.0", 1426 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", 1427 | "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", 1428 | "bin": { 1429 | "uuid": "dist/bin/uuid" 1430 | } 1431 | }, 1432 | "node_modules/vary": { 1433 | "version": "1.1.2", 1434 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1435 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 1436 | "engines": { 1437 | "node": ">= 0.8" 1438 | } 1439 | }, 1440 | "node_modules/ws": { 1441 | "version": "8.11.0", 1442 | "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", 1443 | "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", 1444 | "engines": { 1445 | "node": ">=10.0.0" 1446 | }, 1447 | "peerDependencies": { 1448 | "bufferutil": "^4.0.1", 1449 | "utf-8-validate": "^5.0.2" 1450 | }, 1451 | "peerDependenciesMeta": { 1452 | "bufferutil": { 1453 | "optional": true 1454 | }, 1455 | "utf-8-validate": { 1456 | "optional": true 1457 | } 1458 | } 1459 | } 1460 | } 1461 | } 1462 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "food-delivery", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "config": "^3.3.9", 10 | "cookie-parser": "~1.4.4", 11 | "cors": "^2.8.5", 12 | "debug": "~2.6.9", 13 | "ejs": "^3.1.9", 14 | "express": "^4.18.2", 15 | "http-errors": "~1.6.3", 16 | "moment-timezone": "^0.5.43", 17 | "morgan": "~1.9.1", 18 | "multiparty": "^4.2.3", 19 | "mysql": "^2.18.1", 20 | "socket.io": "^4.7.0", 21 | "uuid": "^9.0.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /public/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/.DS_Store -------------------------------------------------------------------------------- /public/img/202307271540184018GfPWltDhf7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271540184018GfPWltDhf7.png -------------------------------------------------------------------------------- /public/img/202307271540184018zTiLmW8DLh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271540184018zTiLmW8DLh.png -------------------------------------------------------------------------------- /public/img/202307271541334133BWr6HpS5XM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271541334133BWr6HpS5XM.png -------------------------------------------------------------------------------- /public/img/202307271541334133FB4SiUmser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271541334133FB4SiUmser.png -------------------------------------------------------------------------------- /public/img/202307271542144214H4v0ZRggMF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271542144214H4v0ZRggMF.png -------------------------------------------------------------------------------- /public/img/202307271542144214HqC7fMRTIY.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271542144214HqC7fMRTIY.png -------------------------------------------------------------------------------- /public/img/20230727154318431880O0w5WjdS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/20230727154318431880O0w5WjdS.png -------------------------------------------------------------------------------- /public/img/202307271543184318ziFG4JXVxl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/202307271543184318ziFG4JXVxl.png -------------------------------------------------------------------------------- /public/img/category/20230726155407547qM5gSxkrCh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/20230726155407547qM5gSxkrCh.png -------------------------------------------------------------------------------- /public/img/category/202307261554435443I62l071lLA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/202307261554435443I62l071lLA.png -------------------------------------------------------------------------------- /public/img/category/202307261555485548dKi8yJisIn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/202307261555485548dKi8yJisIn.png -------------------------------------------------------------------------------- /public/img/category/20230731100233233AOuWmq6r64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/20230731100233233AOuWmq6r64.png -------------------------------------------------------------------------------- /public/img/category/20230731100257257bPdXFaneYu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/20230731100257257bPdXFaneYu.png -------------------------------------------------------------------------------- /public/img/category/20230731100322322vK4gHfIwCI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/20230731100322322vK4gHfIwCI.png -------------------------------------------------------------------------------- /public/img/category/20230731100347347lrk8CyW57u.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/category/20230731100347347lrk8CyW57u.png -------------------------------------------------------------------------------- /public/img/product/20230727161106116DsCP0Lq5md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/20230727161106116DsCP0Lq5md.png -------------------------------------------------------------------------------- /public/img/product/202307310947354735xuruflIucc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307310947354735xuruflIucc.png -------------------------------------------------------------------------------- /public/img/product/202307310951365136W6nJvPCdzQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307310951365136W6nJvPCdzQ.png -------------------------------------------------------------------------------- /public/img/product/202307310958175817ytVf7AVIOl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307310958175817ytVf7AVIOl.png -------------------------------------------------------------------------------- /public/img/product/202307311010091094RZ1nWHTug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307311010091094RZ1nWHTug.png -------------------------------------------------------------------------------- /public/img/product/202307311011551155pIjIPWIb4w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307311011551155pIjIPWIb4w.png -------------------------------------------------------------------------------- /public/img/product/20230731101409149FomkojOsMt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/20230731101409149FomkojOsMt.png -------------------------------------------------------------------------------- /public/img/product/202307311018321832QsO9noUdBS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307311018321832QsO9noUdBS.png -------------------------------------------------------------------------------- /public/img/product/202307311022232223jrsJiejIQu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/product/202307311022232223jrsJiejIQu.png -------------------------------------------------------------------------------- /public/img/type/20230726160935935fZ46tYHZrf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/type/20230726160935935fZ46tYHZrf.png -------------------------------------------------------------------------------- /public/img/type/202307261610181018aVOpgmY1W1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/type/202307261610181018aVOpgmY1W1.png -------------------------------------------------------------------------------- /public/img/type/202307310959535953siLWeCJ71I.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/type/202307310959535953siLWeCJ71I.png -------------------------------------------------------------------------------- /public/img/type/202307311000160168a0737aEiC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeforany/online_groceries_shop_app_backend_api_node/2c83461b0115ca3011e347be4b1ce8ce6e2a1c68/public/img/type/202307311000160168a0737aEiC.png -------------------------------------------------------------------------------- /public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } 9 | -------------------------------------------------------------------------------- /routes/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET home page. */ 5 | router.get('/', function(req, res, next) { 6 | res.render('index', { title: 'Express' }); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /routes/users.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | 4 | /* GET users listing. */ 5 | router.get('/', function(req, res, next) { 6 | res.send('respond with a resource'); 7 | }); 8 | 9 | module.exports = router; 10 | -------------------------------------------------------------------------------- /views/error.ejs: -------------------------------------------------------------------------------- 1 |

<%= message %>

2 |

<%= error.status %>

3 |
<%= error.stack %>
4 | -------------------------------------------------------------------------------- /views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= title %> 5 | 6 | 7 | 8 |

<%= title %>

9 |

Welcome to <%= title %>

10 | 11 | 12 | --------------------------------------------------------------------------------