Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Setup for development

Andrew edited this page Jul 8, 2017 · 17 revisions

How to run Mail 4 Good in development mode

This guide was written for linux-based machines. It will also work with OSX. Deployment on Windows is untested, and the current suggestion is to run Ubuntu in a virtual machine using software such as VirtualBox.

In development mode, Mail 4 Good has a number of useful utilities:

  • Hot reloading with webpack hot middleware
  • The ability to use Redux Dev Tools (a browser extension that allows for redux time travel & viewing state)
  • Additional debugging information on the server

PREREQUISITES

Your machine should have NPM and Node >=7.4x installed. It will also need Redis and Postgres. A full guide for installing each of these is given below. Before you install any packages, ensure your package list is up to date with:

sudo apt-get update

NPM

sudo apt-get install -y npm

Node
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Redis

sudo apt-get install -y redis-server

Postgres

sudo apt-get install -y postgresql postgresql-contrib

SETUP

  • Clone the repository.

git clone https://github.com/freeCodeCamp/Mail-for-Good.git.

  • Change into the cloned directory. Install packages.

cd Mail-for-Good && npm install

  • Set up your Google API key with this guide. There are only a few environment variables that need to be changed, these are listed below.

mv .env.example .env && nano .env

GOOGLE_CONSUMER_KEY= Put your consumer key from Google here
GOOGLE_CONSUMER_SECRET= Put your consumer secret key from Google here
ENCRYPTION_PASSWORD= Put a long random password here, you don't need to remember it yourself
  • We now need to configure the Postgres DB. We'll keep this part as simple as possible, but feel free to setup your own config if you wish.
# Running the command below will let you know your username.
whoami
# When you run the command below, enter your username. Answer 'y' when asked to be a superuser.
sudo -u postgres createuser --interactive

Help

Got an issue? Want to report a bug or a new feature you're thinking of? Please let us know here!

Clone this wiki locally