📓
ainzzorl's wiki
  • Intro
  • Pet Projects
    • Good Code
    • LangFlipFlop
    • Soccer Adjectives
    • Word Highlighter
    • News Digest
    • Algorithms in Kotlin
    • rustorcli
  • Tech
    • Tech Articles
    • Algorithms
      • Distributed Hash Table (DHT)
      • RSA
      • Seam Carving
      • Fibonacci Heaps
      • Suffix trees, suffix arrays, etc.
    • Technologies
      • Threads vs Events
      • TLS
      • GPU
      • Web Sockets
      • OSI Model
    • Open Source
      • Homebrew
      • Standard Notes
      • LiChess
    • Bash
    • Raft
    • Quantum Computing
    • GFS
    • MapReduce
    • ZooKeeper
  • Courses
    • MIT 6.824: Distributed Systems
      • Primary-Backup Replication
      • Object Storage on CRAQ
      • Aurora
      • Cache Consistency: Frangipani
      • Takeways
      • Distributed Transactions
      • Midterm
      • Spanner
      • FaRM
      • Spark
      • Cache Consistency: Memcached at Facebook
    • Page 2
    • MIT 6.854/18.415: Advanced Algorithms + Stanford CS168: The Modern Algorithmic Toolbox
  • Math
    • Fourier Transform
    • Probabilities & Statistics
  • Places
    • Moscow
  • Books
    • Page 1
    • Page 1
    • Page 1
    • Page 1
    • Page 1
    • Tobol Mnogo Zvannyh - Ivanov
    • The Twelve Chairs/12 стульев - Ilf, Petrov
    • Beauty is a Wound - Eka Kurniawan
    • The Queen of Spades/Пиковая Дама - Pushkin
    • The Sirens of Titan - Kurt Vonnegut
    • Обитель - Захар Прилепин
    • The Faithful Executioner - Joel Harrington
    • City of Lies: Love, Sex, Death, and the Search for Truth in Tehran - Ramita Navai
    • June/Июль - Dmitry Bykov/Дмитрий Быков
    • East of Eden - John Steinbeck
    • Como Agua Para Chocolate/Like Water for Chocolate - Laura Esquivel Valdés
    • The Kukotski Enigma/Казус Кукоцкого - Lyudmila Ulitskaya/Людмила Улицкая
    • Ancillary Justice - Ann Leckie
    • Career of Evil - JK Rowling
    • The Signal and the Noise - Nate Silver
    • Don't Sleep, There are Snakes - Daniel Everett
    • Оправдание Острова - Eugene Vodolazkin
    • A Place Called Winter - Patrick Gale
    • 1491: New Revelations of the Americas Before Columbus - Charles C. Mann
    • Трудно Отпускает Антарктида - Vladimir Sanin
    • Klara and the Sun - Kazuo Ishiguro
    • The History of My Contemporary/История Моего Современника - Vladimir Korolenko
    • Life at the Speed of Light - Craig Venter
    • Misery - Stephen King
    • And Then There Were None - Agatha Christie
    • A Kim Jong-Il Production - Paul Fischer
  • Cooking
    • Marinated Mushrooms
    • Pea Soup
    • Fried Potato
    • Chimichurri
    • Komendantsky Sauce
    • Spicy mushroom marinara
    • Bruschetta
    • Solyanka with Mushrooms
    • Tofu Scramble
    • Bean Spaghetti
    • Salsa
    • Baked Mushrooms
    • Lentil Soup
    • Веганство в Москве
  • Misc Research
    • Recycling
    • Sailing Upwind
    • Viruses
  • Misc Reading
    • Harry Potter - Rowling Writing
  • Fitness
  • Languages
    • Spanish
    • Language Classification
  • Juggling
  • Life Advice
Powered by GitBook
On this page
  • Arch
  • API
  • Code
  • Lila
  • WS
  • UI
  • Puzzler
  • Cheat detection

Was this helpful?

  1. Tech
  2. Open Source

LiChess

PreviousStandard NotesNextBash

Last updated 4 years ago

Was this helpful?

Summarizing my attempts to understand LiChess.

Arch

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

  • Doesn't seem to have many tests.

WS

  • Few comments, very hard to follow which class is doing what.

  • No tests apparently.

  • WFH is anaMove?

UI

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.

Cheat detection

Board literals in tests whoa

WS deploy command whoa Just like that.

Very magic numbers are all over the place

Actually receive move from Lila

Send the move to watching clients

Arguments: t, d, o. How is anyone supposed to understand what it means?

Main script (?)

Generator

Extracting puzzle from a game

https://github.com/ornicar/lila
https://github.com/ornicar/scalachess/blob/master/src/test/scala/BishopTest.scala#L32-L40
https://github.com/ornicar/lila-ws/blob/master/deploy.sh
https://github.com/ornicar/lila-ws/blob/3bf35711609034235dcf77e2fccfc5b1c4a53a5b/src/main/scala/LilaWsServer.scala#L65-L74
https://github.com/ornicar/lila-ws/blob/c18ac9df67893e22c2196f5745c53eae83b8251b/src/main/scala/LilaHandler.scala#L128-L132
https://github.com/ornicar/lila-ws/blob/c18ac9df67893e22c2196f5745c53eae83b8251b/src/main/scala/Fens.scala#L56-L77
https://github.com/ornicar/lila/blob/6bdf93d27ac08cb9321e439fcf3b10f235c373ac/ui/site/src/component/socket.ts#L147
https://github.com/ornicar/lila/blob/97a46cfa5d7334904d0ee0698e7822ee9314d052/ui/round/src/ctrl.ts#L303
https://github.com/ornicar/lila/blob/97a46cfa5d7334904d0ee0698e7822ee9314d052/ui/round/src/ctrl.ts#L277
https://github.com/ornicar/lichess-puzzler/blob/master/bin/import-more.sh
https://github.com/ornicar/lichess-puzzler/tree/master/generator
https://github.com/ornicar/lichess-puzzler/blob/master/generator/generator.py
https://github.com/clarkerubber/irwin
https://github.com/ornicar/lila/tree/master/modules/irwin/src/main
https://pbs.twimg.com/media/CYGyi12UwAArCU9?format=png&name=medium
https://lichess.org/api
https://lichess.org/api#operation/apiStreamEvent
LogoSource Code • lichess.orglichess
LogoGitHub - ornicar/lichess-puzzlerGitHub