Giter Club home page Giter Club logo

chess's Introduction

--About--
This project's goal is to let users upload their chess AIs to our website and
then see how they compare to other user's AIs and also watch games online.

--Building--
I have the following environment variables defined in my .bashrc:

export CPP_CHESS_ROOT=~/chess
export PHP_CHESS_ROOT=C:/cygwin/home/Andrew/chess
export BOOST_DIR=/usr/include/boost
export THRIFT_CPP_DIR=/usr/thrift-0.8.0/lib/cpp/src
export THRIFT_PHP_DIR=C:/cygwin/usr/thrift-0.8.0/lib/php/src
export LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
export CHESS_READ_PASSWORD={read password}
export CHESS_WRITE_PASSWORD={write password}
export CHESS_ADMIN_PASSWORD={admin password}
export DB_ROOT_PASSWORD={db root password}

Since Andrew's developing in Cygwin, g++ uses cygwin style paths and php uses
windows style paths, which is why we have a separate path for CPP_CHESS_ROOT and
PHP_CHESS_ROOT even though they are both technically the root directory. We are
still looking for a workaround for this.

(Windows): In addition to setting environment variables in cygwin for building,
you'll also have to set windows environment variables for the actual execution
of the cpp and php programs since the runtime uses windows env vars rather than
cygwin env vars.

After setting up environment variables, go to chess/server/cpp and make, which
will place the startServer binary in chess/bin. Running this will start a
service which will be able to keep track of current games initiated from php
code in chess/server/php via thrift.

If you're running the site live on apache, make sure to use SetEnv to set the
above environment variables.

--Database Backup--
Everytime you make a git commit on the ec2 server, chess_root/pre-commit.sh is
run, which currently dumps the database into chess_root/web/db.sql. This is
convenient so that you can have the same copy of the database as the server,
including tables, data, everything. You'll have to set a symlink from
.git/hooks/pre-commit to this file by doing the following:

ln -s $CPP_CHESS_ROOT/.pre-commit.sh $CPP_CHESS_ROOT/.git/hooks/pre-commit

Note that this means that your db copy will also be committed to the server
every time you commit, so make sure you only do this if you want that to happen.

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.