A small browser game where you guess the Sorcery: Contested Realm card. Play the Daily to keep your streak, or Practice for unlimited rounds.
- React 19 + TypeScript on Vite 7
- Tailwind CSS v4 for styling
- TanStack Query for data fetching/caching
- React Router v7 for routing
- Vitest + Testing Library for unit/integration tests
- Playwright for end-to-end tests
- Biome for formatting and linting
Absolute imports are configured with the @ alias to src (see vite.config.ts).
- Daily: A deterministic daily card based on the current UTC date. Win to increase your daily streak. Streak is stored in
localStorageundersorcerify:streakandsorcerify:lastWinDate. - Practice: Infinite random cards with a session-only win streak.
- Goal: Reveal the card enough to select its exact name from the dropdown. A correct name guess wins the round; running out of guesses loses it.
- Input: Click on-screen keys or use your keyboard. You can also guess elemental thresholds by using tokens:
air,earth,fire,water.
Card data is loaded from static JSON (src/mocks/data/cards.json).
Prerequisites:
- Node 18+ (or 20+ recommended)
pnpm(the repo usespnpm@10)
Install dependencies:
pnpm installStart the dev server:
pnpm devThe app runs at http://localhost:5173 by default.
pnpm dev: Start the development server (opens browser)pnpm build: Build the production bundle todist/pnpm preview: Preview the production build locallypnpm test: Run unit/integration tests in watch modepnpm test:ci: Run all unit/integration tests oncepnpm test:e2e: Run Playwright tests with the UIpnpm test:e2e:ci: Run Playwright tests headlesslypnpm lint: Type-check and run Biome checks (with safe fixes)pnpm format: Format the codebase with Biomepnpm validate: Run lint, unit, and e2e tests in CI mode
src/pages/— Routes:Home(redirects to Daily),Daily,Practicesrc/components/— UI components likeGameBoard,Keyboard,NavBar,SorceryCardsrc/api/cards.ts— Card schema validation and data loadingsrc/mocks/data/cards.json— Static card datasettests/— Playwright e2e tests
Key behaviors:
- Daily selection is derived from the UTC date; progress for the Daily round is persisted under
sorcerify:progressinlocalStorageper day key. - Practice mode stores only in-memory progress and a session win streak.
- Unit/integration tests use Vitest with a
happy-domenvironment. Test files live undersrc/**/*.test.ts?(x). - E2E tests use Playwright (
tests/), which boots the dev server automatically.
Run unit tests:
pnpm testRun e2e tests (headless):
pnpm test:e2e:ciThis is a static site. Any static host will work (GitHub Pages, Netlify, Vercel, etc.).
pnpm build
# deploy the contents of dist/If your host expects a different base path, configure it via Vite’s base option.
- Create a feature branch
- Make changes and add tests where relevant
- Run
pnpm validate - Open a PR
MIT. See LICENSE.