|
||
---|---|---|
app | ||
bin | ||
conf | ||
doc | ||
modules | ||
project | ||
public | ||
serve | ||
test | ||
.gitignore | ||
.gitmodules | ||
README.md | ||
todo |
lichess.org
It's a free online chess game focused on realtime and simplicity.
It haz a search engine,
computer analysis,
tournaments,
forums,
teams,
and a weird monitoring console.
The UI is available in 72 languages thanks to the community.
Lichess is written in Scala 2.10, and relies on Play 2.1 for the routing, templating, and JSON. Pure chess logic is contained in scalachess submodule. The codebase is fully asynchronous, making heavy use of Scala Futures and Akka 2 actors. Lichess talks to Stockfish using a FSM Actor to handle AI moves and analysis. It uses MongoDB 2.4 to store about 10 million games, which are indexed by elasticsearch 0.90. HTTP requests and websocket connections are proxied by nginx 1.4.
Join us on #lichess IRC channel for more info.
Installation
I am not happy to see lichess clones spreading on the Internet. This project source code is open for other developers to have an example of non-trivial scala/play2/mongodb application. You're welcome to reuse as much code as you want for your projects, and to get inspired by the solutions I propose to many common web development problems. But please don't just create a public lichess clone. Also, if you are building a website based on lichess, please mention it in the footer with
Based on <a href="http://lichess.org">lichess</a>
. Thank you!
Also note that if I provide the source code, I do not offer free support for your lichess instance. I will probably ignore any question about lichess installation and runtime issues.
This is full-stack application, not a library, and it may not be straightforward to get it fully running. I assume you run a Unix with nginx, mongodb, elasticsearch and stockfish installed.
git clone git://github.com/ornicar/lila
cd lila
git submodule update --init
bin/play compile
Configuration
cp conf/application.conf.dist conf/application.conf
application.conf
extends base.conf
and can override any value.
Note that application.conf
is excluded from git index.
Websocket proxying and language subdomains
When accessed from the root domaing (e.g. lichess.org),
the application will redirect to a language specific subdomaing (e.g. en.lichess.org).
Additionally, lichess will open websockets on the socket.
subdomain (e.g. socket.en.lichess.org).
Here is my local nginx configuration for l.org
, assuming lila is installed in /home/thib/lila
and runs on 127.0.0.1:9000
/etc/nginx/l.org.conf
And here is my local /etc/hosts file
Run it
Launch the play console:
bin/play
From here you can now run the application (run
).
Credits
Big thanks go to lichess community for the support, inspiration, bug reports, and amazing translation efforts.
Special thanks go to:
- Mephostophilis for writing Lichess Wiki, leading the cheater hunt, moderating the site, reporting countless bugs, and contributing to the codebase
- Smiling Bishop, legend, mb and all the moderators who spent time keeping the site enjoyable
- Evropi for contributing to the wiki and animating #lichess IRC channel
- Steibock for board theming
- Yusuke Kamiyamane for the fugue icons
- pgn4web for the analysis board
- chessboardjs for the board editor
Thanks to all players for feeding the database.