This organization encompasses all of the components comprising our chess website (as well as a few false-starts and experiments). The primary components of Chessticulate are:
- shallow-pink: A chess engine written in javascript
- chess-workers: A scalable REST API wrapper for shallowpink
- chessticulate-api: The api for the chessticulate website built with FastAPI
I (bglaws) became enamored with the game of Chess, as many of us did, during the peak of the COVID-19 pandemic. I was also still in college learning Java at the time, and these two interests of mine merged and blossomed into a terminal chess program I built. Later on I began learning JavaScript at an internship. That, combined with a dissatisfaction with the chess programming I had done previously, led me to make a second attempt at writing an improved chess engine, this time in JavaScript. Yes, JS is probably not the most efficient option in hindsight (especially if you want to add AI into the mix), but I really wanted to improve my JavaScript skills. Additionally, I had some vague ideas of building my own simple chess website (for fun of course), and so building the engine in JS would allow it to be used on the frontend of such a site.
After some time developing that I decided to collaborate with my brother krglaws on building the chess website I had been picturing. This project is the product of that collaboration.
-
shallow-pink (it's a pun) - Our JavaScript chess engine. It is more or less "done". The core functionality is there, and it is fully tested. It includes a rudimentary AI that has been implemented using a simple Minimax algorithm. We have tentative plans to:
- reimplement the library in either C or C++.
- improve upon the ai using a Monte Carlo Tree Search or Neural Network, or both.
-
chessticulate-api - The REST API for our website. We decided to write our API in Python using the FastAPI web framework since it comes with excellent data validation and auto-generated swagger pages. The database we are using for now is sqlite, although we have plans to migrate to postgres at some point. This part of the project is mostly done, barring whatever additions or enhancements we decide to add later on.
-
chess-workers - A small expressjs REST API wrapper around shallow-pink.
Our reasoning for separating shallow-pink from the python API via chess-workers (aside from the fact that they are written in different languages) is as follows:
- by having shallow-pink, which requires significant CPU resources, execute in a separate process from the python API and moving shallow-pink to an IO-bound process instead of a CPU-bound process (at least from python's perspective), we avoid holding up FastAPI's eventloop.
- it is easier to scale a project when it has been broken up into simpler components.
We are currently working on deploying the components we have with Docker onto a raspberry pi. After that, our next step is to build the frontend, probably with React.