A classic Klondike Solitaire card game built with Svelte 5, Tailwind CSS v4, and Vite.
# Clone the repository
git clone https://github.com/lingster/solitaire-svelte.git
cd solitaire-svelte
# Install dependencies
npm install --legacy-peer-deps
# Start development server
npm run dev
# Run unit tests
npm run test
# Run unit tests in watch mode
npm run test:watch
# Run E2E tests
npm run test:e2e
# Run E2E tests with UI
npm run test:e2e:ui
# Run all tests
npm run test:all
# Build for production
npm run build
# Preview production build
npm run preview
solitaire-svelte/
โโโ src/
โ โโโ lib/
โ โ โโโ types.ts # TypeScript types
โ โ โโโ game.ts # Game logic
โ โ โโโ game.test.ts # Unit tests (TDD)
โ โ โโโ store.ts # Svelte stores
โ โ โโโ Card.svelte # Card component
โ โ โโโ Pile.svelte # Pile component
โ โ โโโ Board.svelte # Game board
โ โโโ App.svelte # Main app
โ โโโ main.ts # Entry point
โ โโโ app.css # Tailwind styles
โโโ e2e/
โ โโโ solitaire.spec.ts # Playwright E2E tests
โโโ public/ # Static assets
โโโ playwright.config.ts # Playwright config
โโโ vite.config.ts # Vite config
โโโ wrangler.toml # Cloudflare config
Move all 52 cards to the four foundation piles, building each from Ace to King by suit.
npm run builddistOr deploy via CLI:
npm run build
npx wrangler pages deploy dist --project-name=solitaire-svelte
The repository includes a CI/CD workflow that:
Set these secrets in your GitHub repository:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_IDThis project was built using Test-Driven Development:
game.test.tsgame.tse2e/MIT