Skip to content

beastrc/mern_tutorial_2

Repository files navigation

Legably Production

Legably production site

Development Environment Setup

Tools Required

  • Git
  • React - version 15.02 is used
  • NodeJS - version 8.x LTS (the latest 8.x LTS available known as lts/carbon)
    • It is recommended to use nvm to manage your NodeJS installation and versions. If you are not on a *nix based environment, and are required to develop in a Windows environment nvm-windows is a good alternative.
  • MongoDB - version 4.x is currently used by Legably
  • UI

Setup with Homebrew

If you are developing on Mac OS X, we recommend installing the required tools with Homebrew by running:

  • brew install git
  • brew install nvm
  • brew install mongodb

Run brew services start mongodb to start mongodb after install.

First Time Environment Setup

  1. Clone repository:

    $ git clone git@github.com:legably/production.git

  2. Install node package dependencies:

    $ npm ci

    • Note we prefer npm ci over npm install as it is more strict about following the package-lock.json file and also is quicker.
  3. Configure dotenv file

    • Create the .env file using the template:
      • $ cp .env.template .env
    • Edit the .env file with your appropriate ENV variable options:
      • $ vim .env
    • Minimally required ENV keys that need to be defined to run locally include the following:
      • DB_HOST, DB_NAME, DB_PORT
      • SERVER_HOST, SERVER_PORT
    • In development, you can comment out the DB_USER and DB_PASS if your local MongoDB instance doesnt require user auth

Daily Development Process

  1. Start MongoDB locally if not already running:

    $ mongod --config /path/to/your/mongo.conf

  1. Start the server

    $ npm run start

  2. View the development environment website at http://localhost:3001

About

this is mern stack tutorial for beginnner

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published