Skip to content

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

License

Notifications You must be signed in to change notification settings

nafoster/habitrpg

Repository files navigation

HabitRPG Rewrite

HabitRPG Rewrite under development. Built using Angular, Express, Mongoose, Jade, Stylus, Coffeescript.

Note: This branch is under development, and these instructions may fall out of date. They were accurate as of August 5, 2013. Should you encounter this, join #habitrpg on IRC (Freenode) and talk to litenull.

The general steps are:

  1. Clone the repo
  2. Install all dependencies
  3. Run the client

Or, expressed in commands on the command line:

  1. git clone --recursive -b angular_rewrite https://github.com/lefnire/habitrpg.git
  2. cd habitrpg && npm install
  3. grunt start (grunt start:production to concat & minify js)

To access the site, open http://localhost:3000 in your browser.

Technologies

  1. Angular, Express, Mongoose. Awesome, tried technologies. Read up on them.
  2. CoffeeScript, Stylus, Jade - big debate.
  3. 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.
  4. Stylus. We're either staying here or moving to LESS, but vanilla CSS isn't cutting it for our app.
  5. CoffeeScript. This is the hottest debate. I'm using it to rewrite, and Habit was written originally on CS. It's a fantastic language, but it's a barrier-to-entry for potential contribs who don't know it. Will also revisit right after the rewrite.

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 mongodo
  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 [initandlisten] waiting for connections on port 27017 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:
  2. Download and run the latest Node.js msi installation file from http://nodejs.org/download/
  3. Create a fork of the habitrpg repository on github under your own account
  4. Install Git and download angular_rewrite code repository. Steps:
  5. Install latest stable version of Git, found here: http://git-scm.com/downloads 1. Make sure to select "Run Git from the Windows Command Prompt" during the installation process
  6. Open a command window. Navigate to the location where you would like the project files to live. Example: c:\projects
  7. Run git command to download angular_rewrite branch. 'git clone --recursive -b angular_rewrite https://github.com/ezinaz/habitrpg.git' (where 'ezinaz' is your account name)
  8. Run 'cd habitrpg'
  9. Create upstream remote: 'git remote add upstream https://github.com/lefnire/habitrpg.git'
  10. Run 'git fetch upstream'
  11. Run 'npm install'. Read below for possible error message.

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

[email protected] 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. Run 'npm install -g nodemon'
  2. Run 'npm install -g bower'
  3. Run 'bower install -f'
  4. Run 'copy config.json.example config.json'
  5. grunt start (grunt start:production to concat & minify js)

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 68.5%
  • CoffeeScript 20.7%
  • CSS 10.3%
  • Other 0.5%