Step 1- Create a directory :

mkdir new_project

Step 2- Move to new directory then generate express app and install dependencies :

cd new_project
npx express-generator
npm install

Step 3- Install Sequelize, mysql2, passport and bcrypt : npm i sequelize mysql2 passport bcrypt

Step 4- Next, let’s install Postgres and the Sequelize CLI :

npm init -y
npm install sequelize pg
npm install — save-dev sequelize-cli

npm install sequelize pg
npm install — save-dev sequelize-cli

Step 5- Next, let’s initialize a Sequelize project : npx sequelize-cli init

Step 6- Create a database using the Sequelize CLI : npx sequelize-cli db:create


Sequelize is a popular, easy-to-use JavaScript object relational mapping (ORM) tool that works with SQL databases. It’s quite easy to start a new project using the Sequelize CLI, but Sequelize’s full potential is unleashed when the relationships between your models are defined.

In this tutorial, we’ll set up a Sequelize project to assign tasks to particular users. Associations will be used to define that relationship, we’ll then look at ways to query the database based on those associations.

Let’s start by generating an express app in a new project folder:

mkdir new-folder

cd new-folder

npx express-generator

npm install

Next, let’s…

Salem Gogura

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store