Prisoner's Dilemma App

Build Status Status of Dependencies

The purpose of this project is to create a web application with which a group of people can participant in a Prisoner's Dilemma tournament.

To learn more about the Prisoner's Dilemma:

If you would like to contribute to the project, the following should help get you started.

Requirements

The following is a list of requirements needed to contribute to this project.

  • nodejs - For Linux and Mac install node via nvm. For Windows, use an installer from the nodejs website.
  • git
  • grunt-cli - Can be installed via npm as follows:
    • npm install -g grunt-cli
  • A GitHub account to create pull requests

Getting Started

Before continuing, be sure to download and install the project requirements.

To contribute to the project, you will use pull requests instead of pushing your changes directly. The first thing you must do is create a fork of this project (see this article for more information about GitHub forks). This will create a full copy of the project in your GitHub account. You have full read/write privileges to your fork.

Now that you have your fork, you must "clone" it locally. Run the following command:

git clone https://github.com/YOUR_USERNAME/prisoners-dilemma-app.git

Be sure to replace YOUR_USERNAME with your GitHub username.

Change directory into the new folder that was created:

cd prisoners-dilemma-app

Running the App

To run the app locally, you should first install the node dependencies:

npm install

After the installation has completed, you can run it like this:

npm start

Your browser should automatically open to the app.

Contributing

Create a new branch:

git checkout -b my-new-branch

Make your changes to the project locally. Save your changes by committing them:

git commit -a -m "Some message goes here"

Push the changes to your fork:

git push origin my-new-branch

Go to your fork on GitHub and click the green "Create a pull request" button. At the next screen, scroll down to view the changes you've made. Click the "Create pull request" to submit the changes as a pull request.

How to Keep Your Local Project Up-to-date

Overtime, the project will change. To keep your local copy of the project up-to-date, you will need to download the changes from Github and merge them into your local instance of the project.

If you have not done so already, you will need to add the upstream remote to your local git repository:

git remote add upstream https://github.com/Learn-by-doing/prisoners-dilemma-app.git

To download the latest changes from upstream (this does not make any changes to your files):

git fetch upstream

upstream is the name of the main project's remote

Now to merge the latest changes into your local master branch:

git checkout master
git merge upstream/master

And finally, update your fork:

git push origin master

That's it! Your local and your fork (in GitHub) should now both be up-to-date.