Development Setup - dev-tails/old-engram GitHub Wiki

Install Node

Download Node.js (LTS version on left) and npm from https://nodejs.org.

  • Check Tools for Native Modules

Install MongoDB Community Server

  • https://www.mongodb.com/try/download/community
  • Select Complete Installation
  • Leave defaults for everything else
  • Once complete this will open Mongo DB Atlas (a MongoDB Database viewer)
  • Enter mongodb://localhost:27017 as connection string and connect to confirm database is running in background

Clone Repository

  • Either in terminal: git clone https://github.com/adamjberg/engram.git
  • Or via Open with GitHub Desktop (After clicking green "Code" button here https://github.com/adamjberg/engram)

Open engram folder in VS Code

Backend

Create .env file in be/ folder

# This tells the application to connect to your local database
DB_URL=mongodb://localhost:27017

# This is the secret used to encrypt the json web token
JWT_SECRET={random string of characters}

Install Backend Dependencies

  • Inside VS Code Terminal cd be
  • npm install

Run Backend Server

  • npm start
  • You should see "Connected" print out in the logs which confirms that it successfully connected to your local database
  • Accessing http://localhost:4000/ in browser should return "Cannot GET /" which confirms server is running

Frontend

Install Frontend Dependencies

  • Split Terminal in VS Code (Ctrl+Shift+5 or the two panes next to trash can in bottom right)
  • In new terminal cd fe
  • npm install

Run Frontend Development Build

  • npm start
  • Browser should automatically open to http://localhost:3000/

Fin

Congratulations you are now running a development build of engram