Code Monkey home page Code Monkey logo

ai-battle-website's Introduction

Build Status

Javascript Fight Club

This repository contains the code that powers the website. By forking this, you will be able to develop the site code, or use real (github player ai code) or test (just local versions of those scripts) data to generate a battle.

Playing The Game

Visit https://jsfight.club to play the game. You do not need a copy of this repo to play.

Development

Initial set-up can be avoided by using the provided Vagrant environment. See the Vagrant website for more information. If you're already set up with Vagrant, run vagrant up, then vagrant ssh, and navigate to the /vagrant directory. Once you're there, you can skip down to Dependency Installation for initial set-up.

Requirements

To work on this application, you must have the following installed:

Initial Setup

Database Setup

Run the following command and carefully follow the prompts to install PostgreSQL, create a user, and give that user permission to modify the jsfightclub database. Simply read the output to know what to do at each step.

database/setup-postgres.sh

Configuration

Next, copy the config file template so you can configure the application. This file will not be tracked, so you don't have to worry about accidentally committing your passwords and such.

cp config-template.js config.js

The most important pieces of information to add to config.js are the database user and database password. Everything else can be skipped for now.

Dependency Installation

npm install
bower install

Add Database Tables

database/initialize.js
psql jsfightclub < ./node_modules/connect-pg-simple/table.sql

Running a Battle

Running battles does not require the web server in order to run.

To run a test battle:

node gamerunner/run-test-game.js

Starting the Web Server

The website is not built automatically, but you can do so via the following command:

npm run build

You must build one time before starting the server in order to provide the game engine to the browser. After that, it is only necessary after making changes.

To start the server without connecting to Github, run:

node server.js --no-github

You can also run node server.js with no options to show the help screen.

Once it's running, you can navigate to http://localhost:8080/ to view the site. (if you're using the Vagrant environment, navigate to http://localhost:4000/ instead)

Changing the Website

You can view the "dev build" of the site at dev.html while the built version will be accessible from index.html. There are no pre-compilation steps for doing development via dev.html. Once you're happy with the dev version of the site, re-build it using npm run build and verify that your changes are alive and well in the built version.

ai-battle-website's People

Contributors

gjtrowbridge avatar yahkob avatar asuza avatar jamesyothers avatar forrestbthomas avatar natedsaint avatar t3chguy avatar tenshi13 avatar aewens avatar hackreactor-students avatar slugo avatar constablebrew avatar tacensi avatar jeromechrist avatar

Watchers

James Cloos avatar Rainier L. avatar

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.