Creating a Chess Game Explorer

Creating a Chess Game Explorer

Avatar of Mikusbunkarus
| 1

So it has been a long time since my last post. I basically fell off the map for playing, studying and blogging about my chess journey. I was however, still doing something related to chess. I had an idea to create my own chess game explorer similar to that of Chess.com and others on the web. However, I wanted to use this functionality with all of my live games, a feature that Chess.com does not support (hilariously enough, I have come back to discover that this functionality is included in the new beta website of Chess.com).

 I set out writing up what I wanted the game explorer to do, and some of the things needed to do it. After having a general outline I set to work building it using Ruby on Rails, Javascript, Jquery, PostgreSQL, Redis, Chess.js, and a variety of gems, frameworks and technologies for web/app development. It was a crazy ride and I wanted to share some of my thoughts about it on my blog here. For the sake of brevity (and to prevent you from falling asleep from boredom) I am going to try and limit the techincal specifics as much as possible.

Planning out the app was fairly straightforward. I had a great model to base my design off of, and so it was simply a matter of putting all of the features that I wanted to include down, and tackle them step by step.

 

A couple of things jumped out right off the bat for me. The first being, the rules of chess are not simple. I luckily stumbled upon a well maintained and tested JavaScript Library called chess.js which took care of all the game logic and rules that I had to worry about. This combined with a wonderful GUI chessboard library helped me to tackle the first 2 major hurdles, getting a working board, and getting the rules working for a game of chess (I say this like it was as simple process, however even after finding these 2 very useful tools, it still took a tremendous amount of work for me to incorporate them into what I was doing. Once I incorporated these two libraries, and worked out some problems using JavaScript, I was off to the races with a rather good looking start. 

The open-source community in web development (and the tech. world in general) is pretty amazing. There are a ton of tools, tutorials, and support for almost anything you want to do. It was a great help to me to be able to look at others work, draw inspiration from past examples, and use free open source tools to help develop my app.

After getting an User Authentication system up and running, as well as cleaning up the design and navigation of the app, I decided I wanted to add in a few other features. I added the ability to upload games in mass, such as a zip file that is downloaded from Chess.com. I was able to recieve all of my games played on chess.com, and upload them to my app using Redis, Sidekiq, and PostgreSQL. After that I looked to adding a good chess engine, since playing games and having a computer analysis are great tools in the chess player toolbet.

Enter Stockfish.


Stockfish destroying me in the picture above.



Again, another amazing tool that is open-source and free to use. If there was one lesson that I took away from this project, it would be the incredible generosity of people who are involved in the open-source community.

 

I won't bore anyone with the specifics of the code or how the different languages and technologies were used. But I will say that I learned a tremendous amount working on this pet project. It has increased my respect of chess as a whole, from the difficulties of programming Chess Engines to simple things like making a board show up and look nice for the users. I hope to keep working on this as a side-project and release it free for anyone who may find use of it later on once I make the UI look much cleaner and more intuitive and increase performance of the engine.

 

I hope to get back into playing and studying more Chess for the new year. This project ate up a bunch of my time that usually went to that. But it has been totally worth it. If you have any questions, feel free to ask. I hope to see some of you over the board soon.

 

 

Until next time, friends, comrades.