jonasalbert
9/6/2018 - 7:35 AM

node checklist

node checklist

** opening vscode on terminal **
https://code.visualstudio.com/docs/setup/mac
-----------------------------------------------------------------------------
** npm init or npm init --yes **
creates package.json
-----------------------------------------------------------------------------
** packages **
express
mongoose
joi
joi-objectid 'validates a valid objectid'
joi-password-complexity
helmet
morgan
config - manage configuration files.
debug - 
lodash
express-async-errors
winston@2.4.4 - logging error
winston-mongodb@3.0.0
mongoose-paginate

TEMPLATING ENGIGNES
  pug
RUNNING MONGODB IN TERMINAL
  sudo mongod
MONGODB COMPARISON QUERY OPERATORS
  eq (equal)
  ne (not equal)
  gt (greater than)
  gte (greater than or equal to)
  lt (less than)
  lte (less than or equal to)
  in
  nin (not in)
bcrypt
-----------------------------------------------------------------------------
objectid
_id: 5bb2db846b3ee1149a974908
12  bytes
4   bytes:  timestamp
3   bytes:  machine indentifier
2   bytes:  process indentifier
3   bytes:  counter

1   byte  = 8 bits
2 ^ 8     = 256
2 ^ 24    = 16M

objectid generated by driver
Driver -> MongoDB
-----------------------------------------------------------------------------
npm - fawn use for transactional
-----------------------------------------------------------------------------
setting environment variable
-mac
  export NODE_ENV=production
-----------------------------------------------------------------------------
mongoDb
  two phase commit - like transactions.
-----------------------------------------------------------------------------
Authentication
  a process of identifying if the users are claiming who there are
Authorization
  permission
-----------------------------------------------------------------------------
npm i jsonwebtoken
-----------------------------------------------------------------------------
Information Export Principle
-----------------------------------------------------------------------------
jest - a unit test tool 
npm i jest --save-dev
-----------------------------------------------------------------------------
jest.fn() for mock function for testing.
-----------------------------------------------------------------------------
npm i supertest --save-dev
   use in testing. for http request.
-----------------------------------------------------------------------------
npm i moment
-----------------------------------------------------------------------------
npm i helmet - middleware package can protect ur app from well know vulnerabilities.
npm i compression - compress the http response send to the client.
-----------------------------------------------------------------------------
heroku cli
heroku create appname
git remote -v
git push heroku master (will deploy to heroku)
heroku config:set vidly_jwtPrivateKey=1234
heroku config:set NODE_ENV=production
-----------------------------------------------------------------------------
npm i mongoose-paginate - researched
-----------------------------------------------------------------------------