- Mongodb for a document based backend database.
- Nodejs as a backend server.
- Expressjs as a wrapper on HTTP for nodejs to process.
- Mongoose as a wrapper for Mongodb native client.
- AngularJS for frontend modularity and one page app.
- Jasmine tests run through karma on the frontend.
- Mocha tests runon the backend.
- Protractor and Selinium based tests for end to end testing.
- Install Node.js (We currently use 0.12.7 due package change in yeoman)
- Use nvm installer follow this link
- Run the following commands in the terminal
node -v
npm -v
- Make sure both the above commands were valid and printed out node and npm versions.
- Set user account as owner of the /usr/local
sudo chown -R $USER /usr/local
- Install MongoDB (We use 2.4.1 so find the specific installer or install the specific verison through homebrew. DO NOT USE 1.)
- Use Homebrew
brew install mongodb
- Or, use Installer http://www.mongodb.org/downloads
- Or, install specific version using homebrew-versions, e.g.
brew install Mongodb24
(at writing, 2.4.11) - Start mongo by running
mkdir ~/mongo
mkdir ~/mongo/db
mongod --dbpath ~/mongo/db/
- Git and checkout app
- Install and configure Git https://help.github.com/articles/set-up-git
- cd (e.g
cd Documents/Github
) git clone https://github.com/savvytoronto/savvy.git
- Run the following commands in cloned directory
npm install -g bower
npm install
bower install
- Install grunt in app directory
Build system uses grunt. Run the following command to build
grunt build
- To run all tests
grunt test
To run the server simply use
grunt serve
There is a git-commit-template that should be used with each commit.
git config --global commit.template /path/to/git-commit-template.txt
If you want to use different commit tempates for different projects then you must configure them individually for each project.
cd <path-to-app>
git config commit.template git-commit-template.txt
git checkout master
git pull origin master
git checkout -b my-branch
git add file1
git add file2
git commit
git push origin my-branch
- Go to https://github.com/savvytoronto/savvy and do a pull request.
- Get code review comments
- Your change will be merged when reviewed.
git add file1
git commit --amend
- Change commit message if you like.
git push -f origin my-branch
( NEVER FORCE PUSH TO MASTER )- Go to pull request on https://github.com/savvytoronto/savvy and make sure changes are uploaded.
git checkout master
git pull
git checkout my-branch
git rebase master
If there is no conflict:git push origin my-branch
Otherwise:- Fix conflicts
git add <resolved files>
git rebase --continue
- Mongod has given some folks a /data/db
ERROR: dbpath (/data/db/) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
To resolve this issue before running grunt serve
run the following command to start mongo
mongod --dbpath /usr/local/var/mongodb
To run mongo manually run
mongod --dbpath ~/mongo/db/
######Sublime
- View > Indetations > Convert indentation to spaces
Most of the style is followed from https://github.com/rwaldron/idiomatic.js with a small modification.
- We used cramped braces
if (condition) {
}
function(a, b, c){
}
instead of
if ( condition ) {
}
This goes for all parathesis like for, while etc...