GithubHelp home page GithubHelp logo

txerrinko / lichess Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ornicar/lichess-old

1.0 2.0 0.0 13.78 MB

Free and adless chess website, trying to scale

Home Page: http://lichess.org

License: Other

lichess's Introduction

Very fast Chess game designed to run on a small server and play hundreds of concurrent games. GUI is only HTML5 and JavaScript.

  • Allows to play with a friend, a random player or an artificial intelligence.
  • Supports castling, en passant, selective promotion, color selection, check and mate detection, threefold repetition, and move validation.
  • Chess clock, integrated chat, real time spectator mode and analysis interface available.
  • Chess variants available: Standard and Chess960
  • Translated to 57 languages thanks to contributors.
  • Uses only open source languages: PHP 5.3, HTML5, Javascript and CSS. Powered by Symfony2, jQuery 1.5 and jQuery UI 1.8.
  • Learn more in the wiki

PLAY

FEEDBACK

I'm eagerly waiting for bug reports and feature requests in Lichess Forum

INSTALL

Lichess is built on Symfony2.

It requires APC. It's a free and open opcode cache for PHP.

It uses MongoDB for game storage.

Get the code

git clone git://github.com/ornicar/lichess.git
cd lichess
./bin/vendors install

Check your server requirements

Open your browser at http://myhostname/check.php

You can also run checks from command line, but the results may differ:

php web/check.php

Configure lichess host

You have to tell lichess the host it will be accessed through.

Open app/config/config_dev.yml and replace occurences of l.org with your own localhost.

Configure subdomains

lichess uses one subdomain per language. You don't have to configure all of them. Here is how to configure the English and French ones: Just replace l.org with your domain name.

/etc/hosts

127.0.0.1	l.org
127.0.0.1	en.l.org
127.0.0.1	fr.l.org

Here is a nginx configuration example:

server {
    listen 80;
    server_name l.org *.l.org;
    root /home/thib/data/workspace/lichess/web;

    location / {
        root   /home/thib/data/workspace/lichess/web/;
        index  index_dev.php;
        # serve static files directly
        if (-f $request_filename) {
            access_log        off;
            expires           1s;
            break;
        }
        rewrite ^(.*) /index_dev.php last;
    }

    location ~ \.php {
        fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index  index_dev.php; 
        fastcgi_param  SCRIPT_FILENAME  /home/thib/data/workspace/lichess/web/$fastcgi_script_name;
        include        fastcgi_params;
    }
}

Initialize things

By running this script:

./bin/reload

It will build the bootstrap, clear the cache, warm it up, load fixtures, create MongoDB indexes and symlink assets.

You can run this script as many times as needed. Note that it reinitializes the dev and test databases.

Run

Open your browser at http://myhostname/index_dev.php

Configure Artificial Intelligence

The default AI is crafty, an opensource program written in C.

Install crafty on Debian based distros:

sudo apt-get install crafty

If you can't or don't want to install crafty, you can disable it:

# lichess/config/config.yml
lichess:
    ai:
        crafty:
            enabled: false
            priority: 2
            executable_path: /usr/bin/crafty
            book_dir: /usr/share/crafty
        stupid:
            enabled: true
            priority: 1

Lichess will then use the next AI available, called "stupid". It's dumb as hell but it plays :)

APC cache slam

If you get cache slam warning in logs, upgrade APC and/or disable the warnings in apc.ini

apc.slam_defense="Off"

TEST

Lichess is well tested. You should run the tests if you plan to modify the code.

You need PHPUnit 3.5 installed.

Run all unit and functional tests

phpunit -c app

To get functional tests passing, you need to enable APC in CLI.

# /etc/php5/cli/conf.d/apc.ini
extension=apc.so
apc.enabled=1  
apc.enable_cli=1
apc.shm_segments=1  
apc.shm_size=64

lichess's People

Contributors

brikou avatar erkan-yilmaz avatar maba avatar ornicar avatar qpleple avatar ubermuda avatar wtfzdotnet avatar

Stargazers

 avatar

Watchers

 avatar  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.