How to run the Food Delivery application

Manish Kumar
2 min readApr 10, 2021

--

Prerequisite:

You should have

  1. node and npm installed
  2. MySQL database installed
  3. By default project has configured to use MySQL DB where the database name is dishdb, the user is dishuser and the password is dishpass. You have to keep this thing ready prior to running the project.

Step 1) Clone the git repo from the below link:

git clone git@github.com:rhythm98/Food-Ordering-Application.git

Step 2 ) Build the project

$ cd Food-Ordering-Application/$ npm installadded 270 packages from 255 contributors and audited 271 packages in 26.41s39 packages are looking for fundingrun `npm fund` for detailsfound 0 vulnerabilities

Step 3 ) Till this point ideally everything should work smoothly, but that is not the case. There is some issue in the project which you have to fix first.

$ npm start> food_ordering_application@1.0.0 start /Users/kumanman/Documents/Personal/Food-Ordering-Application> node src/run.jsinternal/modules/cjs/loader.js:818throw err;^Error: Cannot find module 'sequelize/types'Require stack:- /Users/kumanman/Documents/Personal/Food-Ordering-Application/src/auth/passport.js- /Users/kumanman/Documents/Personal/Food-Ordering-Application/src/server.js- /Users/kumanman/Documents/Personal/Food-Ordering-Application/src/run.jsat Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)

Q) how to fix them?

Answer:- Follow the below steps to correct those errors.

Remove this line from the passport.js file

const { Model } = require('sequelize/types')

open passport-local-strategy js file and correct the below line:

}catch e{return done( e)}

To:

}catch (e){return done( e)}
Note the paranthesis.

Open dishes js file and correct below code snippet:

route.get('/:id',asyn(req,res)=>{})

To:

route.get('/:id',async(req,res)=>{})Note there was a typo here.

Open dishes js file inside the controller and comment all the lines.

// write functions// createDishes// fetchDishes// fetchDishById

That's it. Once you followed all the above steps run npm start again. You will see something like this in the console.

$ npm start> food_ordering_application@1.0.0 start /Users/kumanman/Documents/Personal/Food-Ordering-Application> node src/run.jsExecuting (default): SELECT 1+1 AS result

If everything is cool then open the below URL in the browser:-

http://localhost:2323/

Your app is ready to do the experiment.

Happy coding!!!

--

--

Manish Kumar
Manish Kumar

Written by Manish Kumar

Principal Software Engineer at Oracle

No responses yet