Go to file
Unknown 83439d537f Some changes for switch to Gitlab and making public 2017-08-16 18:31:44 +02:00
api Lots of stuff 2016-02-01 23:19:30 +01:00
client Some changes for switch to Gitlab and making public 2017-08-16 18:31:44 +02:00
config Lots of stuff 2016-02-01 23:19:30 +01:00
migrations Lots of stuff 2016-02-01 23:19:30 +01:00
public Added popovers to team preview 2016-05-22 18:05:30 +02:00
server Properly direct as https 2016-05-23 15:51:04 +02:00
shared Made pokemon learn all moves regardless of level, apparently people feel really strongly about this 2016-03-08 12:54:26 +01:00
test Lots of stuff 2016-02-01 23:19:30 +01:00
.gitignore Lots of stuff 2016-02-01 23:19:30 +01:00
.nodemonignore Lots of stuff 2016-02-01 23:19:30 +01:00
Capfile Lots of stuff 2016-02-01 23:19:30 +01:00
Gemfile Lots of stuff 2016-02-01 23:19:30 +01:00
Gemfile.lock Lots of stuff 2016-02-01 23:19:30 +01:00
Gruntfile.coffee Lots of stuff 2016-02-01 23:19:30 +01:00
LICENSE Lots of stuff 2016-02-01 23:19:30 +01:00
Makefile Lots of stuff 2016-02-01 23:19:30 +01:00
README.md Some changes for switch to Gitlab and making public 2017-08-16 18:31:44 +02:00
Vagrantfile Lots of stuff 2016-02-01 23:19:30 +01:00
assets.coffee Lots of stuff 2016-02-01 23:19:30 +01:00
aws_config.json Lots of stuff 2016-02-01 23:19:30 +01:00
aws_config.json.example Lots of stuff 2016-02-01 23:19:30 +01:00
bootstrap.sh Lots of stuff 2016-02-01 23:19:30 +01:00
icomoon-selection.json Lots of stuff 2016-02-01 23:19:30 +01:00
index.coffee Lots of stuff 2016-02-01 23:19:30 +01:00
node_modules.tar.gz Resolve #27 2016-02-26 22:32:33 +01:00
nodetime.json Lots of stuff 2016-02-01 23:19:30 +01:00
npm-shrinkwrap.json Lots of stuff 2016-02-01 23:19:30 +01:00
package.json Lots of stuff 2016-02-01 23:19:30 +01:00
start.js Lots of stuff 2016-02-01 23:19:30 +01:00

README.md

Insurgence Battle Simulator

A competitive Pokemon battle simulator playable in the browser. Based on https://github.com/sarenji/pokebattle-sim

Set up

Installation

git clone https://gitlab.com/Deukhoofd/BattleSim.git
cd BattleSim
npm install

Next, you need to install two dependencies: redis and PostgreSQL 9.1.

Redis

On Mac OS X with homebrew, you can do:

brew install redis

On Windows, there is a Redis port that works fairly well: https://github.com/rgl/redis/downloads

PostgreSQL

PostgreSQL has installable versions for every major OS. In particular, for Mac OS X, there is Postgres.app.

When you install PostgreSQL, you should create a database for pokebattle, called pokebattle_sim. You can do this two ways:

# command-line:
$ createdb pokebattle_sim

# or via SQL client:
CREATE DATABASE pokebattle_sim;

Next, you must migrate the database. Simply run:

npm install -g knex
knex migrate:latest

If you get an error complaining that the postgres role doesn't exist, run this: createuser -s -r postgres.

Run server

We use Grunt to handle our development. First, you must npm install -g grunt-cli to get the grunt runner. Then you can type

grunt

to automatically compile all client-side files and run nodemon for you.

We also support Vagrant if you are on a Windows machine and so desire.

Run tests

npm test
# or
npm install -g mocha
mocha

Or if you're in the Vagrant VM, you can just run

mocha

Deployment

First, you must get SSH access to the server. Then, to deploy:

cap staging deploy
# test on staging
cap production deploy

Guide

pokebattle-sim is a one-page app. The server serves the client.

api/             Hosts the code for the API that we host.
client/          Main client code. Contains JS and CSS.
config/          For Capistrano and deployment.
public/          Public-facing dir. Generated files, fonts, images.
server/          Server, battle, move, Pokemon logic, etc.
shared/          Files shared between server and client.
test/            Automated tests for server and client.
views/           All views that are rendered server-side go here.
Gruntfile.coffee Contains all tasks for pokebattle-sim, like compiling.
start.js         The main entry point of pokebattle-sim.

Contributing

All contributions to the simulator logic must come with tests. If a contribution does not come with a test that fails before your contribution and passes after, your contribution will be rejected.

Other contributions (e.g. to the client) are much less strict!

Issues

Report issues in GitHub's issue tracker.