LiChess
Summarizing my attempts to understand LiChess.
Arch
https://pbs.twimg.com/media/CYGyi12UwAArCU9?format=png&name=medium
The main diagram is not very clear, or helpful.
Where's Redis? Or does the diagram predate it?
API
They stream board events with ndjson https://lichess.org/api#operation/apiStreamEvent. It's long polling I suppose?
Can't find API to actually make moves. I suppose it's done via websockets?
Can't find API to actually do puzzles. Only see API to get daily puzzle. Perhaps it's also done with web sockets.
There's an API to send a message, but I see no API to view messages.
Code
Lila
https://github.com/ornicar/lila
Doesn't seem to have many tests.
Board literals in tests whoa https://github.com/ornicar/scalachess/blob/master/src/test/scala/BishopTest.scala#L32-L40
WS
WS deploy command whoa https://github.com/ornicar/lila-ws/blob/master/deploy.sh Just like that.
Very magic numbers are all over the place https://github.com/ornicar/lila-ws/blob/3bf35711609034235dcf77e2fccfc5b1c4a53a5b/src/main/scala/LilaWsServer.scala#L65-L74
Few comments, very hard to follow which class is doing what.
No tests apparently.
WFH is anaMove?
Actually receive move from Lila https://github.com/ornicar/lila-ws/blob/c18ac9df67893e22c2196f5745c53eae83b8251b/src/main/scala/LilaHandler.scala#L128-L132
Send the move to watching clients https://github.com/ornicar/lila-ws/blob/c18ac9df67893e22c2196f5745c53eae83b8251b/src/main/scala/Fens.scala#L56-L77
UI
Arguments: t, d, o. https://github.com/ornicar/lila/blob/6bdf93d27ac08cb9321e439fcf3b10f235c373ac/ui/site/src/component/socket.ts#L147 How is anyone supposed to understand what it means?
Tracking how a move is sent to the server:
Puzzler
Overall, seems very basic stuff. It feels like it's possible to do a lot better.
Extracting puzzle from a game https://github.com/ornicar/lichess-puzzler/blob/master/generator/generator.py
Cheat detection
https://github.com/clarkerubber/irwin
https://github.com/ornicar/lila/tree/master/modules/irwin/src/main
Last updated