Skip to content
This repository

A habit tracker app which treats your goals like a Role Playing Game.

Octocat-spinner-32 archive add debug buttons back in, including +10 gems (@sabrecat) October 31, 2013
Octocat-spinner-32 migrations feat(mystery): bailey + migration for march mystery items March 24, 2014
Octocat-spinner-32 public feat(coupons): add coupon-code feature April 16, 2014
Octocat-spinner-32 src feat(coupons): add coupon-code feature April 16, 2014
Octocat-spinner-32 test Fix failing unit test March 08, 2014
Octocat-spinner-32 views feat(coupons): add coupon-code feature April 16, 2014
Octocat-spinner-32 .bowerrc chore(bower): bowerrc (see bower/bower#933) February 28, 2014
Octocat-spinner-32 .gitignore Added Vagrant for unified development env. March 03, 2014
Octocat-spinner-32 .nodemonignore fix(nodemon): Add another ignore for weirdsauce Windoze dev environments February 04, 2014
Octocat-spinner-32 .travis.yml add mocha tests to travis, remove makefile January 15, 2014
Octocat-spinner-32 CHANGELOG.md Changed hints style (and small quick fixes) February 16, 2014
Octocat-spinner-32 CONTRIBUTING.md chore(docs): fix outdated links for code contributors February 17, 2014
Octocat-spinner-32 DOCS-README.md Updated DOCS-README.md for Docker September 28, 2013
Octocat-spinner-32 EXTENDEDCHANGELOG.md chore(bailey): add bailey for group plans + perfect day achiev. Keep January 28, 2014
Octocat-spinner-32 Gruntfile.js fix(misc): some styles & translations February 14, 2014
Octocat-spinner-32 LICENSE chore(license): remove conflicting text (fixes #2596), and simply ref… January 27, 2014
Octocat-spinner-32 Procfile update procfile for heroku. @paglias this is the heroku script-runner… September 07, 2013
Octocat-spinner-32 README.md feat(readme): code climate badge March 30, 2014
Octocat-spinner-32 VAGRANT.md Updated base vagrant box. added full provisioning of HRPG env. April 11, 2014
Octocat-spinner-32 Vagrantfile Updated base vagrant box. added full provisioning of HRPG env. April 11, 2014
Octocat-spinner-32 bower.json Add missing angular-ui dependency. April 13, 2014
Octocat-spinner-32 config.json.example feat(subscriptions): add paypal recurring cancelation. refactor strip… March 24, 2014
Octocat-spinner-32 karma.conf.js fix(tests): include select2 in test manifest January 23, 2014
Octocat-spinner-32 newrelic.js chore(newrelic): some newrelic code location experiments January 30, 2014
Octocat-spinner-32 package.json feat(coupons): add coupon-code feature April 16, 2014
Octocat-spinner-32 protractor.conf.js Test server port changed to 3001 January 01, 2014
Octocat-spinner-32 vagrant.sh Updated base vagrant box. added full provisioning of HRPG env. April 11, 2014
Octocat-spinner-32 validate-commit-msg.js chore(changelog): change max commit message length back to 999 (sorry, January 28, 2014
Octocat-spinner-32 validate-commit-msg.spec.js chore(changelog): change max commit message length back to 999 (sorry, January 28, 2014
README.md

HabitRPG Build Status Code Climate

HabitRPG is an open source habit building program which treats your life like a Role Playing Game. Level up as you succeed, lose HP as you fail, earn money to buy weapons and armor.

Built using Angular, Express, Mongoose, Jade, Stylus, Grunt and Bower.

Set up HabitRPG locally

Windows users should skip this section and read the one below with Windows-specific steps.

Before starting make sure to have MongoDB, NodeJS and npm and Git installed and set up.

  1. Fork the repository on your computer.
  2. Checkout the develop branch where all the development happens: git checkout -t origin/develop
  3. Install grunt-cli npm package globally (on some systems you may need to add sudo in front of the command below): npm install -g grunt-cli bower
  4. Install our dependencies: npm install
  5. Create a config file from the example one: cp config.json.example config.json
  6. Ensure that Mongo is running and seed the database with initial settings by running: node src/seed.js.

Windows Environment Install

  1. Set up MongoDB. Steps:

    1. Download the latest production release of MongoDB
    2. Extract the zip file to the desired application directory. Example: c:\apps\mongodb-win32-x86_64-2.4.6
    3. Rename the folder from mongodb-win32-x86_64-2.4.6 to mongodb
    4. Create a data\db directory under the application directory. Example: c:\apps\mongodb\data\db
    5. Start up MongoDB using the following command: c:\apps\mongodb\bin\mongod.exe --dbpath c:\apps\mongodb\data

    If MongoDB starts up successfully, you should see the following at the end of the logs:

    Sun Sep 01 18:10:21.233 [initandlisten] waiting for connections on port 27017
    Sun Sep 01 18:10:21.233 [websvr] admin web console waiting for connections on port 28017
    
  2. Install Node.js (includes npm).

  3. Install Git.
  4. Fork the repository on your computer.
  5. Checkout the develop branch where all the development happens: git checkout -t origin/develop
  6. Install our dependencies: npm install.

    You might receive the following error during the npm install command:

    habitrpg@0.0.0-152 postinstall C:\...\habitrpg
    ./node_modules/bower/bin/bower install -f
    '.' is not recognized as an internal or external command,
    operable program or batch file.
    npm ERR! weird error 1
    npm ERR! not ok code 0
    

    Ignore this error and proceed with the following:

  7. Install grunt-cli and bower npm packages globally: npm install -g grunt-cli bower

  8. Install the bower packages: bower install -f
  9. Create a config file from the example one: copy config.json.example config.json
  10. Ensure that Mongo is running and seed the database with initial settings by r unning: node src\seed.js.

Run HabitRPG

HabitRPG uses Grunt as its build tool.

grunt run:dev compiles the Stylus files and start a web server.

It uses Nodemon and grunt-contrib-watch to automatically restart the server and re-compile the files when a change is detected.

Open a browser to URL http://localhost:3000 to test the application!

Technologies discussion

  1. Angular, Express, Mongoose. Awesome, tried technologies. Read up on them.
  2. Stylus, Jade - big debate.
    1. Jade. We need a server-side templating language so we can inject variables (res.locals from Express). Jade is great because the "significant whitespace" paradigm protects you from HTML errors such as missing or mal-matched close tags, which has been a pretty common error from multiple contribs on Habit. However, it's not very HTML-y, and makes people mad. We'll re-visit this conversation after the rewrite is done.
    2. Stylus. We're either staying here or moving to LESS, but vanilla CSS isn't cutting it for our app.
Something went wrong with that request. Please try again.