No description
Find a file
2013-11-13 23:24:59 -08:00
archive add debug buttons back in, including +10 gems (@sabrecat) 2013-10-31 15:14:19 -07:00
locales clean code from websites 2013-11-14 15:20:35 +11:00
migrations [#923] also migrate group.websites => group.description (@Fandekasp the 2013-11-13 23:24:59 -08:00
public Merge pull request #1795 from Fandekasp/remove_website 2013-11-13 23:09:27 -08:00
src Merge pull request #1795 from Fandekasp/remove_website 2013-11-13 23:09:27 -08:00
test fix unit tests 2013-10-31 22:35:35 -03:00
views Merge pull request #1795 from Fandekasp/remove_website 2013-11-13 23:09:27 -08:00
.bowerrc rewrite2 add in indivdual tasks 2013-08-25 12:29:53 -04:00
.gitignore Documentation configuration for Docker 2013-09-26 18:10:50 -04:00
.nodemonignore add margin-right to all .btn, typo in stylus, add build to .nodemonignore 2013-09-11 20:36:57 +02:00
.travis.yml fix unit tests 2013-10-31 22:35:35 -03:00
bower.json forked the angular-at-directive code and made changes to support minification 2013-11-12 16:47:36 -08:00
config.json.example fix #1619 (missing comma in config.example) 2013-10-17 01:06:21 +01:00
DOCS-README.md Updated DOCS-README.md for Docker 2013-09-28 14:59:34 -07:00
Gruntfile.js move js & css files to public/manifest.json, allow for stylus files editing without restarting server on development, removed hashres from dev build 2013-11-04 22:13:03 +01:00
karma-e2e.conf.js [#1534] initialize karma tests using generator-karma (yeoman) 2013-09-13 20:00:35 -04:00
karma.conf.js fix tests 2013-11-07 20:27:21 +01:00
LICENSE README & LICENSE 2012-06-26 11:29:49 -04:00
Makefile setting up for testing REST 2012-10-12 11:53:57 -04:00
package.json Merge pull request #1700 from djuretic/develop 2013-11-03 18:59:56 -08:00
Procfile update procfile for heroku. @paglias this is the heroku script-runner btw 2013-09-07 10:54:03 -04:00
README.md updated README to show initial seeding tasks, and fixed a small typo 2013-11-09 08:48:38 -08:00

HabitRPG

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 -b develop 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 the npm and bower packages: 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:
  2. Download the latest production release of MongoDB from: http://www.mongodb.org/downloads
  3. Extract the zip file to the desired application directory. Example: c:\apps\mongodb-win32-x86_64-2.4.6
  4. Rename the folder from mongodb-win32-x86_64-2.4.6 to mongodb
  5. Create a data\db directory under the application directory. Example: c:\apps\mongodb\data\db
  6. 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 [websvr] admin web console waiting for connections on po
rt 28017```

1.  Install  Node.js (includes npm).  Steps:
  1.  Download and run the latest Node.js msi installation file from  http://nodejs.org/download/
1. Install [Git](https://help.github.com/articles/set-up-git).
1. [Fork the repository](https://help.github.com/articles/fork-a-repo) on your computer.
1. Checkout the **develop** branch where all the development happens:
`git checkout -b develop origin/develop`
1. Install the **npm** packages:
`npm install`
Read below for possible error message.

You might receive the following error during the 'npm install' command:
> habitrpg@0.0.0-152 postinstall C:\Users\022498\Projects\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:

1. Install **grunt-cli** and **bower** npm packages globally
'npm install -g grunt-cli bower'
1. Install the **bower** packages:
'bower install -f'
1. Create a config file from the example one:
`copy config.json.example config.json`
1. Ensure that Mongo is running and seed the database with initial settings by r
unning:
`node ./src/seed.js`.

# Run HabitRPG

HabitRPG uses [Grunt](http://gruntjs.com) as its build tool.

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

It uses [Nodemon](https://github.com/remy/nodemon) and [grunt-contrib-watch](https://github.com/gruntjs/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.
1. 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.
  1. Stylus. We're either staying here or moving to LESS, but vanilla CSS isn't cutting it for our app.