Building Chess Solitaire
I’m always on the lookout for fresh chess application ideas. Over time, I’ve built more than 50 different tools (51 and counting!) and I’ve set myself a symbolic goal of reaching 64 — one for every square on the board. Recently, someone in the community (shoutout to mattchess) asked if I had ever thought about building a Chess Solitaire game. Honestly, I had no idea what that was at first, but the concept immediately caught my attention once it was explained.
At first, I planned to just add it to my ever-growing backlog of “someday projects.” But then I found myself with a few free evenings and thought — why not give it a shot?
In this blog, I’ll walk you through my thought process, from the initial design stage to getting a working version of the game up and running.
If you just want to see the application: Try Now
Note: This build is currently live on my test site, not yet on the main site. I like to experiment and gather feedback before rolling features out more broadly. So if you have any feedback, do let me know in the comments or on Discord
Update: Due to popular request, you can now select games directly from my library. At the moment it includes all World Chess Championship games, Fischer’s My 60 Memorable Games, a collection of Miniatures, and other legendary classics. Enjoy!
Update: A massive shoutout to mattchess for providing an extensive collection of PGNs for you to search through and enjoy!!!
What is Chess Solitaire?
The idea behind Chess Solitaire is simple but surprisingly powerful. The goal is to replay a real game — usually from a strong master, a famous clash, or a historic encounter — and try to guess the moves as if you were the one sitting at the board.
Of course, you could just open up a PGN and click through the moves by yourself. That’s why it’s called “solitaire” — it’s essentially a solo training exercise. But the twist is that after every move you play, the system gives you immediate feedback. If you chose the same move as the master, it’s marked as a match, and if you went off track, you’ll know right away.
The purpose of the exercise is two-fold. First, it gives you the chance to walk through and reflect on an instructive game, taking the time to understand each decision. Second, it challenges you to see how closely your thought process aligns with that of a grandmaster. In that sense, it becomes both a study tool and a fun test of your chess instincts.
Application Design
When I first sat down to think about how to build Chess Solitaire, my initial question was simple: what components would this actually need? At the very least, it would require an interactive chessboard where moves could be played, a PGN card to display the notation, some form of analysis during the game, and finally, a review system once the game ended.
From there, the flow began to take shape. The idea was that you could either load a PGN directly or choose a random game from a built-in collection — I decided to leverage my archive of every World Championship game for this. Once a game is loaded, you can start playing through it on the board. As you make moves, the PGN card updates in real time, and beneath it, in-game analysis shows how your choices compare to the original moves.
I also wanted to give players some flexibility with the controls. You can set how many attempts you want per move, which changes the difficulty depending on how strict you want the experience to be. You can also choose which side you’re playing — White, Black, or both — so the game can adapt to whatever training focus you have in mind.
You can keep going until you reach the end of the game naturally, or hit an “End Game” button to jump straight to the review phase. The review itself offers a fuller picture of your performance: which moves you matched, where you went wrong, and whether your alternatives were still reasonable. In some cases, your move might even be an improvement over the grandmaster’s choice — was it a book move, a hidden resource, or simply stronger according to the engine?
In the end, the workflow I had in mind was deliberately simple. Load a game, play through it as best you can, and then see the outcome laid out clearly in the review. Simple to follow, but rich enough to make the experience both a learning tool and an enjoyable test of skill.
Note: Whenever I start a new application, I never jump straight into code. Instead, I begin with pen and paper, sketching out the layout and flow I have in mind. I’ll iterate a few times, refining the look and structure until I’m happy with it. Only then do I translate that design into actual code. This step saves me a lot of rework later and helps me stay clear on what I’m trying to build.
Tech Stack
For those interested in the nuts and bolts, the Chess Solitaire application is built with a lightweight and straightforward stack:
- React.js — powering the UI, component state, and overall application structure.
- React Chessboard — for the interactive chessboard, move input, and piece rendering.
- Stockfish.js — running chess engine analysis directly in the browser, with a worker pool for fast and parallel evaluations.
- Plain JavaScript utilities — additional helper functions and lightweight modules to tie everything together.
I deliberately kept the stack minimal. By avoiding heavy frameworks or unnecessary dependencies, I could focus on performance, responsiveness, and building the exact features I wanted without bloat.
If you’d like to dive deeper into how to build your own Chess Web Application from scratch, I’ve written a dedicated series that walks you through the fundamentals — from setting up a React project to integrating a chessboard and handling PGN data. You can check it out here:
- Programming Chess Web Apps: Part One: Getting Started
- Programming Chess Web Apps: Part Two: Stockfish
- Programming Chess Web Apps: Part Three: Deploying your Application
- Programming Chess Web Apps: Part Four: Chessboard Customisation
- Programming Chess Web Apps: Part Five: Game Review
- Programming Chess Web Apps: Part Six: Essential Resources
- Programming Chess Web Apps: Part Seven: Lichess API
- Programming Chess Web Apps: Part Eight: Chess.com API
- Programming Chess Web Apps: Part Nine: Chessground
Running Analysis
This was by far the most challenging part of building Chess Solitaire. The analysis needed to feel quick and responsive — ideally instant during the game — and the post-game review had to generate results in seconds, not minutes. That immediately raised the question: how do you achieve this level of speed without overwhelming the system?
For the engine, I chose to leverage Stockfish 17.1 Lite.js, which I already use across many of my other applications. It’s freely available, reliable, and lightweight enough to run in the browser. The tricky part wasn’t running Stockfish itself, but doing so efficiently. Imagine a situation where the player has unlimited guesses on a single move. If they tried twenty different moves and each one was evaluated at depth 15, that would mean running the engine twenty times in sequence. The feedback would be far too slow — the complete opposite of what I wanted.
To solve this, I created a pool of Stockfish workers. Instead of a single engine instance, I spun up eight in parallel. That way, multiple moves could be evaluated simultaneously, and feedback would arrive quickly enough to feel immediate. On most computers, this setup reaches depth 15 for all the moves almost instantly, which makes the in-game experience smooth and responsive.
The same approach worked for the post-game analysis. Once the game ends, I could send batches of positions to the worker pool and process them in parallel, giving the user a complete review of the entire game in just a few seconds. This part required a little extra care, though. The post-game review involved a two-pass system: first, attach Stockfish evaluations (as well as the principal variations for later comparison) to every move and every guess the player made; second, go back through those results and assign annotations. This ensured that when you navigate through the finished game, it’s clear not only whether you matched the grandmaster’s move, but also how your alternative compared — was it still playable, was it book theory, or did you somehow stumble on an improvement?
Getting this analysis pipeline running smoothly was the hardest technical challenge. Between synchronization issues, potential memory issues, and the complexity of managing multiple engine instances, this was the part where I suspect many hobbyist developers would get stuck. Once I solved it, though, the rest of the application became a matter of building out the components and fine-tuning the workflow to deliver the desired user experience.
Note: One of the most important aspects of building chess applications that work with PGNs is deciding how to store the data. A raw PGN string might be fine for display, but it’s not effective for analysis or interaction. For Chess Solitaire, I structured the data as a moves array with parent–child relationships. This allowed me to traverse the entire move tree easily, while still being able to process each move individually and attach attributes such as evaluations, annotations, and user attempts.
Results
Once the game is finished, the experience shifts from playing to reflecting. The Results phase is where everything comes together: you can see how well you matched the original game, where you went astray, and how your alternatives stacked up against the master’s moves.
The review isn’t just a list of right and wrong decisions. Each move is annotated based on Stockfish’s evaluation and a comparison with the actual game. If you matched the grandmaster, it’s marked clearly. If you chose something different, the system checks whether your move was still sound — was it a book move, a playable alternative, or even an improvement? In some cases, you’ll discover that your idea wasn’t so bad after all, and in rare cases, you might even “outplay” the original.
The results also provide an overall snapshot of your performance: how many moves were perfect matches, how many needed retries, and how many you missed entirely. This summary gives the exercise a sense of closure, but more importantly, it offers insight into your thinking process and areas for improvement.
For me, this was the part that made the game feel complete. The in-game feedback keeps you engaged move by move, but the results screen is what makes the whole exercise valuable as a training tool. It’s here that you can step back, see the bigger picture, and measure how closely you managed to “think like a grandmaster.”
Note (for the nerds): For categorizing moves, I didn’t want to just say “right” or “wrong” — I wanted to give proper chess-style annotations based on the difference between the engine’s best move and the player’s move. Using Stockfish’s evaluation as the baseline, here’s the logic I used:
- If the move matches the engine’s best move
*- If it’s within 0.25 pawns of the best
!- If the difference is > 0.25
?!(inaccuracy)- If the difference is > 0.75
?(mistake)- If the difference is > 1.5
??(blunder)These thresholds are, of course, arbitrary. They’re not official or universally accepted cutoffs, but I found them to be a practical balance between being too strict and too lenient. The goal wasn’t to replicate a grandmaster coach’s intuition perfectly, but to provide clear, useful feedback that makes the post-game review more engaging and instructive.
Summary
Building Chess Solitaire turned out to be one of those projects that looks simple on the surface but hides a lot of interesting challenges under the hood. At its core, the idea is straightforward: load up a master game, try to play through it move by move, and get feedback along the way. But to make it truly engaging, I had to think carefully about design, responsiveness, and the overall flow from start to finish.
The design phase was about keeping things simple and intuitive: an interactive board, a PGN card, in-game feedback, and a clear results screen. Running analysis was the hardest technical hurdle — managing Stockfish in a way that felt instant and scalable required worker pools, parallel processing, and a two-pass review system. The results screen brought it all together, turning the exercise into both a training tool and a fun challenge.
For me, Chess Solitaire fits nicely into the larger theme of the applications I’ve been building: tools that combine serious chess training value with a sense of play. It’s a chance to step into the shoes of a grandmaster, even if just for one game, and measure how close your thought process comes to theirs.
And here is the result... after around 12 hours of building, testing, and tweaking, this is what I ended up with.

Note: Having built a large number of chess applications already, I’ve accumulated an extensive library of reusable components — boards, PGN parsers, analysis panels, result cards, and more. This made the development process much smoother, since I could leverage pieces I’d already refined in earlier projects. One of the joys of building a lot of chess tools is that each new project benefits from the groundwork of the previous ones.
#### Note: One of the most important aspects of building any application is to get feedback, and the community supporting me is awesome in giving me suggestions and tweaks. Big shout out to Mattchess and FRahde for their support in this application.
Try it out yourself and see how closely you can follow a grandmaster’s moves. Try Now
Building chess applications is both fun and rewarding. If you’re working on your own chess project and have questions — technical or design-related — feel free to reach out. I’m always happy to talk shop and share ideas.
Kind Regards,
Toan Hoang (@HollowLeaf)
Discord