I created a platform for chess puzzles using lichess.org's game database

I’m working on a website where chess puzzles are made from random games in Lichess’s open database.

Check it out here: https://pichess.org

This is a great idea and it looks awesome

I have a few suggestions to make it even better:
On mobile, the controls are okay but could be improved. I missed being able to tap on a piece and then tap the square I wanted to move to. Also, it doesn’t let you drag a piece back to its start position without marking it as a mistake.

After solving a puzzle, the success message makes the board shake which isn’t very pleasing.

Another issue arises when there are several ways to checkmate, it gets marked wrong when you do it that way. Solving that would be interesting.

I really think it’s good already. As a developer myself, I appreciate user feedback and hope this helps you improve if you’re interested.

@Brigham
Thank you so much for checking out Pichess your feedback means a lot

For the tapping piece feature, there’s a switch at the top of the board to turn off drag and drop.

We know about the issue with dragging a piece back without it being a mistake and we plan to fix that along with the success message.

As for the problem with multiple ways to checkmate, yes, I’m working on adding branches for possible best moves to allow for different moves.

Thanks again for your input!

Max said:
Nxe4

I’ve been looking at it for ten minutes and still can’t find the mate in three lol

Rowan said:

Max said:
Nxe4

I’ve been looking at it for ten minutes and still can’t find the mate in three lol

There are a few options for black, but the direct line is 1. Nxe4 fxe4 2. Rxe4 Qxe4 3. Qf6#

@Max
I thought it was a forced mate in three. It’s only mate in three if black makes a mistake, right

Rowan said:
@Max
I thought it was a forced mate in three. It’s only mate in three if black makes a mistake, right

No, any move black makes still leads to checkmate. But black doesn’t have to take the knight. For example, instead of fxe4, black could play Kg7. Then white would go Qg3, then Qg8#

Edit- this isn’t actually a mate in three after looking closer. I thought the puzzle was correct, but it seems not.

As a developer, I’d love to share my thoughts: the platform currently supports only one correct solution when there could be multiple ways to achieve the same checkmate. It would be better to check if a piece could move there during the move instead of just comparing the moves. Anyway, amazing work and best wishes

@Mica
Thanks a lot for your feedback

I’m currently working on adding branches to support various moves instead of just one.

Really great move awesome job

Fantastic work. I’m curious what you built this with. Did you use ChessboardJS or any tools from Lichess apart from the database

Lex said:
Fantastic work. I’m curious what you built this with. Did you use ChessboardJS or any tools from Lichess apart from the database

Thanks for using Pichess!

Yes, I built it using ChessboardJS and chess.js on the front end and three different services all in Golang.

For the database, I use Atlas’ MongoDB cluster.

I download PGN files from Lichess, containing games from a specific month (like July 2024 with over 90 million games).

Then I split the large PGN files into individual game files with unique IDs using a program I wrote in Golang.

From there, a random file is selected, I jump to a random position and use Stockfish to calculate the best moves, which are then sent to MongoDB as puzzle candidates.

Finally, the Golang web app that you interact with allows you to load and solve the puzzles.

GitHub: GitHub - ahmed-debbech/go_chess_puzzle: You like Lichess? You will love Pichess! ❤️ - A Chess puzzle generator from Lichess.org games database using Stockfish engine to calculate best moves.

@Winter
this is awesome. I gave it a star and can’t wait to see how this develops. Great job

Lex said:
@Winter
this is awesome. I gave it a star and can’t wait to see how this develops. Great job

Really grateful, thank you

When drag and drop is off,

You can’t change the piece you want to move. Once you click on a piece and then another, it still plays the initial piece to that spot.

But great job overall, with some tweaks it could be very useful for chess players

@Nash
Thanks for trying Pichess!

I’m aware of this bug and will look into it.

@VS are there different solutions to the puzzle? In puzzle 52966, the last move had multiple solutions.

Uma said:
@VS are there different solutions to the puzzle? In puzzle 52966, the last move had multiple solutions.

Thanks for using Pichess, I appreciate your feedback!

In many puzzles, you can find different solutions that lead to the same result which is a checkmate. Right now, I’m working on a way to accept similar moves as correct moves too.

Source code can be found here: https://github.com/ahmed-debbech/go_chess_puzzle