This project demonstrates the use of the following packages :
- express
- express-session
- express-handlebars
- sequelize
- connect session sequelize
- mysql12
- dotenv
- bycrypt
- bulma
Instructions written for Windows.
-
Open a terminal on your computer
-
Change directory to desired location for repository : cd <desired_repo_location>
-
Clone repo : git clone <this_repo>
-
Change directory into the repo directory created from the clone command : cd <repo_directory>
-
Initialize npm : npm init -y
-
Install packages : npm install express express-session sequelize mysql2 express-handlebars connect-session-sequelize dotenv bcrypt bulma
-
If you don't have nodemon installed globally already, do that now. If you do, skip this step : npm install -g nodemon
-
Install nodemon as dev dependency for this repo (if not installed globally you will encounter an error, install globally first [command found in step above]) : npm install --save-dev nodemon
-
Create a .env file in the root directory and add values for DB_NAME, DB_USER, and DB_PW, like so :
DB_NAME='proj2_group6_db'
DB_USER='root'
DB_PW='your mysql password goes here'
-
Start mysql (this step is where the walkthrough video starts) : mysql -u root -p
-
If prompted for a password, enter the password for your mysql db
-
Set up db : source db/schema.sql;
-
Optional, confirm that the db was created : show databases;
-
Quit mysql : \q;
-
Seed db : npm run seed
-
Start the server with either of the following commands : npm start -or- node server.js