A personal Klondike solitaire game built for the browser and designed with an iPhone XR in mind. Play it at bgingell.github.io/solitaire.
Important
This project was generated with AI. I have tested and used the finished game, but I have not manually reviewed or audited the source code.
The game includes optional home-screen and offline support through standard progressive web app features; it is not a native mobile app.
Games intentionally are not persisted. Refreshing or reopening the app starts a fresh deal.
Node 24 LTS is required.
nvm use
npm install
npm run devRun every local quality check with:
npm run checkAfter deployment, open the site in Safari, tap Share, then choose Add to Home Screen.
src/engine/— platform-independent solitaire rules and state transitionssrc/components/— React game interfacesrc/test/— shared test setuppublic/— installable app assets
The rules engine is deliberately independent of React so it can be tested without a browser. UI components will be introduced in the playable-board stage.
The engine exposes immutable operations from src/engine/index.ts. A move returns a new game state when legal and null when rejected. Deals are seeded, making failures and individual games reproducible during development.
Tap the stock to draw a card. Clicking a legal top tableau card sends it straight to its foundation; other tableau cards become selected for a normal move. Move a selected card or face-up stack by tapping its destination, or drag it directly with touch or a mouse. Double-tap an available waste card to send it to its foundation. New deal creates a fresh game; Restart deal restores the current deal to its initial layout and resets the timer.
Long tableau columns tighten their spacing only when needed while leaving each exposed rank selectable. Once every tableau card is exposed, the app safely plans a proven finish and animates one card to the foundations at a time. The timer and counters stay above the board so they remain visible during long games. The app also conservatively checks a complete stock cycle and offers a new deal when no non-draw move can be found.