alejomejia
4/16/2020 - 6:55 PM

MERN Setup

PROJECT SETUP

Mongo Atlas setup

Create Project and Cluster

  1. Go to Mongo Atlas account
  2. Create a Project
  3. Create a Cluster - AWS

Create database user

  1. Go to Database left menu item
  2. Create a Database user with username, password, read and write to any database permission

Set IP Address permission

  1. Go to Network Access left menu item
  2. Click on ADD IP ADDRESS
  3. ACCESS FROM ANYWHERE and Save

Get connection code

  1. Go to Clusters left menu item
  2. Click on CONNECT
  3. Click CONNECT YOUR APPLICATION
  4. Copy code and add it to the conf file in the app

Install dependencies

Standard dependencies

  1. express: Backend main framework
  2. express-validator: Backend data validator
  3. bcryptjs: Password encryption to store on databse
  4. config: Global variables
  5. jsonwebtoken: Tokens for validation
  6. mongoose: Layer for database interaction
  7. request: Make request to external APIs

$ yarn add express express-validator bcryptjs config jsonwebtoken mongoose request

Dev dependencies

  1. nodemon: Watch changes on server to auto refresh
  2. concurrently: Allow to run backend server and frontend app at the same time with 1 command

$ yarn add -D nodemon concurrently