- Install brew
- Install Node.JS & NPM:
-
Install nodemon for development (optional)
- Execute
npm install -g nodemon
- Execute
-
Install MongoDB:
-
Install MongoDB Community Edition on OS X
Note: If you already have Mongo installed, be sure you have >= v3.2 with
brew update && brew upgrade mongodb
- Run the MongoDB daemon by executing
mongod
in a Terminal window
##Installing the Arrays server locally
- First, clone this repository to your computer with
git clone [email protected]:schemadesign/arrays.git
- Change directory (
cd [the path to]/arrays
) into your local clone of this repository - Execute
git checkout develop
- Change directory (
cd [the path to]/arrays
) into your local clone of this repository - Run
git submodule init
followed bygit submodule update
- Execute
npm install
- Install
bower_components
in the 'develop' bower.json
- Change directory (
cd [the path to]/arrays
) into your local clone of this repository - Execute
bower install
- Run the Grunt tasks
- Change directory (
cd [the path to]/arrays
) into your local clone of this repository - Execute
grunt build
to rebuild the main CSS file, style.min.css - Execute
grunt watch
to start LiveReload which will rebuild the css and reload the page whenever a CSS, HTML, or JS file is saved
Environment-related secrets such as the production password database are not committed to this repository as a security-related best practice.
In order to add them (and to support both local development and production deployment) you need to create two files named ".env.development" and ".env.production" in 'config/env/' of this repository at arrays/config/env/.env*
and then fill them respectively with the content of the following Google Docs:
- Add local.arrays.co:
- Run
sudo nano /etc/hosts
- You should see some numbers including your local ip address on the left column and host names on the right. - Add a new log
[your local ip address] local.arrays.co
- Save the write changes with "control" + "o"
- Hit "enter"
- Exit with "control" + "x"
-
Navigate to local.arrays.co:9080 and create a new account.
-
Add your subdomain to hosts
- Run
sudo nano /etc/hosts
again. - Add a new log
[your local ip address] [your arrays subdomain].local.arrays.co
- Save the write changes with control + "o"
- Hit "enter"
- Exit with "control" + "x" Anytime you add a new account in arrays, you will have a new subdomain. If you want that subdomain to work locally, you have to add it to your hosts file.
- Download Robomongo, if you don't already have it.
- Open Robomongo, go to File -> Connection and click create
- Address will be localhost:27017. Save and Connect.
- Expand arraysdb and right click Collections then click create collection and name it "views".
- Right click the views collection you just created and select Insert Document.
- Go to Google Docs, click the folder icon -> Shared With Me -> Arrays Beta -> MongoDB Files -> JSON -> views
- Copy each of the view files and paste into the Insert Document window. (by the end, you should have 9 objects in your views collection)
- Flush your cache by running
dscacheutil -flushcache
in the terminal and you're all set for running Arrays locally!. - Execute
bin/start_dev_app
##Signing into Heroku
- Download/Install the heroku toolbelt: https://devcenter.heroku.com/articles/heroku-command-line
- Login to the heroku account. $ heroku login
- Add a remote using the git URL so that you can deploy the current source to Heroku. $ heroku git:remote -a arrays
-
Contributors should check out the 'develop' branch with
git checkout develop
. -
Anytime you work on a new feature/bug fix etc, create a new branch. From the develop branch, run
git checkout -b [a branch name]
. If you executegit branch
you can see that you've created and navigated to your new branch. -
When you're done working on that branch, navigate to the repo and you should see a green button above the files that says "Compare & pull request". Click that button.
-
Towards the top of the page, there will be a bar with two buttons. Click the one that says "base: master" and change it to "develop". Then click the "compare" button and make sure it's on your current branch.
-
Add in any comments for clarity and click "Create pull request".
- Once you're ready to start a new branch, go back to step 1. Note: It's important to start the new branch off 'develop' as each time you create one, it inherits from the branch you're currently on.