Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Competitive Pokemon battle simulator.
CoffeeScript CSS Other
Branch: master
Failed to load latest commit information.
api Sim: Implement nicknames.
client [sim] sanitize some of message on backend
config [cap] use own upstart config
migrations [replays] finish destroying of replays
public/fonts Fix fonts, h/t @CarlosFdez for the selection.json
server [replays] enforce max 15 replay limit
shared Merge pull request #233 from Marty-D/master
test Merge pull request #233 from Marty-D/master
.gitattributes Normalize line endings on windows
.gitignore Compile and upload files as S3 assets.
.ruby-version Use .ruby-version for rbenv
.travis.yml [travis] run redis-server
Capfile Deploys: Use Capistrano
Gemfile Pull in my fix for capistrano-node-deploy
Gemfile.lock Migrate database after updating code, and update Gemfile.lock
Gruntfile.coffee [deploys] fix env, fix replays not being uploaded.
LICENSE Add MIT license.
Makefile Implement Tailwind
README.md Migrations: knex now supports a native CLI
Vagrantfile Add vagrant to the project.
assets.coffee [assets] use correct fingerprints
aws_config.json.example Compile and upload files as S3 assets.
bootstrap.sh Vagrant: Install mocha globally, just in case.
icomoon-selection.json Fix fonts, h/t @CarlosFdez for the selection.json
index.coffee Add jscoverage support.
knexfile.coffee [replays] misc fixes.
nodetime.json.example Use nodetime for monitoring.
npm-shrinkwrap.json [npm] update primus
package.json [npm] update primus
start.js Use nodetime for monitoring.

README.md

pokebattle-sim Build Status

A competitive Pokemon battle simulator playable in the browser.

Set up

Installation

git clone git://github.com/sarenji/pokebattle-sim.git
cd pokebattle-sim
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.

Something went wrong with that request. Please try again.