Skip to content

DB connection

Kemi edited this page May 29, 2021 · 13 revisions

Database mysql


  • 1- Create a database called just4giving

  • 2- Create a .env file, notice that it's a hidden file

  • 3- Add the following info to your .env file

DB_NAME=just4giving
DB_USER=root
DB_PASSWORD=your_mysql_password
JWT_SECRET=your_secret

  • 4- In the root folder of just4giving project run node api/scripts/sync.js.

If your connection is established correctly you should see all the tables that have been created!!

-seed script (create categories and dummy data): run node api/scripts/seed.js.

note: you will do this step only once to create your table if you do it again, your data will be gone and you will create the tables again!!!

note: please use the stable node version 14.xx.x, the current version is 14.17.0

  • 5- nodemon index.js in the root folder

Enjoy coding!!

Samir

Clone this wiki locally