Git Product home page Git Product logo

habitrpg's Introduction

HabitRPG Build Status

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:
  2. Download the latest production release of MongoDB
  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 [initandlisten] waiting for connections on port 27017
Sun Sep 01 18:10:21.233 [websvr] admin web console waiting for connections on port 28017
  1. Install Node.js (includes npm).

  2. Install Git.

  3. Fork the repository on your computer.

  4. Checkout the develop branch where all the development happens: git checkout -t origin/develop

  5. Install our dependencies: npm install.

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

    [email protected] 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:

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

  7. Install the bower packages: bower install -f

  8. Create a config file from the example one: copy config.json.example config.json

  9. 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.
  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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.