This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
qSpider is a web and desktop player for QSP (Quest Soft Player) games. It's built as a React application using NX workspace for monorepo management, with Tauri for desktop versions.
pnpm start- Start the main web player development server (http://localhost:4200)pnpm start:standalone- Start standalone web playerpnpm start:desktop- Start desktop version with Tauri (requires Rust installed)pnpm start:docs- Start documentation site
pnpm build- Build all projects for productionpnpm build:standalone- Build standalone web playerpnpm build:desktop- Build desktop versionpnpm build:docs- Build documentation
pnpm test- unit tests in every project (nxtesttargets, inferred by the@nx/vitestplugin from each project's vite/vitest config); one project:pnpm nx test <project>.html-renderer,rendereranddesktoprun in Vitest browser mode, so they need Chromium:CHROME_BIN=/usr/bin/chromiumorpnpm exec playwright install chromiumpnpm lint- Run ESLint on all projectspnpm format- Format code with Prettierpnpm format:check- Check code formattingpnpm typecheck- Type-check all projectspnpm check:rust- Rust fmt, clippy and tests forsrc-tauripnpm e2e:web- Web E2E (Playwright); needsCHROME_BIN=/usr/bin/chromiumorpnpm exec playwright install chromiumpnpm e2e:standalone-web- Standalone web E2E (Playwright, port 4310); same browser requirement ase2e:webpnpm e2e:desktop- Desktop E2E (WebdriverIO + tauri-driver); needstauri-driveron PATH (~/.cargo/bin),WebKitWebDriverand Rustpnpm e2e:standalone-desktop- Standalone desktop E2E (own Tauri debug build intarget/e2e-standalone); same requirements ase2e:desktoppnpm smoke:desktop- Desktop launch smoke of both desktop apps (no WebDriver; markers on stdout). On Linux it runs in the private session; on macOS/Windows it refuses unlessCIis set (CI runs it on macOS and Windows); seeapps/player-e2e/README.md"Launch smoke"pnpm check- Fast subset: format, lint, typecheck, unit tests (every project, browser-mode ones included, so Chromium as forpnpm test), build, Rust checks, web and standalone web E2E (no desktop E2E)pnpm check:full-pnpm checkplus desktop and standalone desktop E2E
Before declaring work done locally, run format check, lint and typecheck plus the E2E specs the change touches, and report their results. The full gate is CI on the PR (all suites run there as parallel jobs); run pnpm check:full locally only when asked, or to reproduce a CI failure. pnpm check is the fast subset (no desktop E2E). Every check must pass; any failure is a regression to fix or report, never to hide or skip. Setup details: apps/player-e2e/README.md.
When writing or changing E2E tests, follow the Rules section of apps/player-e2e/README.md (areas, naming, locating by data-qsp/role/data-qa, seeEventually, OperatePlayer).
nx build player- Build specific player appnx serve player- Serve specific player appnx affected- Run commands on affected projects onlynx dep-graph- View dependency graph
The project uses NX monorepo with the following structure:
Applications (apps/):
player- Main web player applicationplayer-standalone- Standalone web playerplayer-desktop- Desktop-specific player variantdocs- Documentation site (Docusaurus)
Libraries (libs/):
game-state- Core game state management and QSP API integrationgame-shelf- Game library and storage managementrenderer- Game content renderinghtml-renderer- HTML content renderingbrowser- Browser-specific utilitiesdesktop- Desktop-specific utilitiescontracts- TypeScript interfaces and typesi18n- Internationalization supportimporters- Game file import functionalityutils- Common utilitiestauri-storage- Tauri-specific storage adapters
- Frontend: React 19.3, TypeScript, Vite
- State Management: Xoid for reactive state
- UI Components: Radix UI primitives with custom styling
- Desktop: Tauri (Rust backend)
- Build System: NX workspace with Vite
- Styling: TailwindCSS
- Audio: Howler.js
- Game Engine: @qsp/wasm-engine (WebAssembly QSP engine)
@qsp/wasm-engine- Core QSP game engine (WebAssembly)@qsp/converters- Game file format converters@radix-ui/*- UI component primitives@tauri-apps/api- Tauri desktop integrationdexie- IndexedDB wrapper for browser storagei18next- Internationalization frameworkxoid- Reactive state management
- Default project is
playeras specified in nx.json - Uses ESLint for linting with TypeScript support
- Prettier for code formatting
- Commitizen for conventional commits
- Husky for git hooks with lint-staged
- The project supports both web and desktop deployment
- Uses service workers for PWA functionality in web builds
- Desktop version requires Rust toolchain for Tauri
To set up desktop development:
- Install Rust: https://rustup.rs/
- Navigate to
src-tauridirectory and runcargo install - Use
pnpm start:desktopfor development
The application integrates with QSP games through the @qsp/wasm-engine WebAssembly module, providing:
- Game execution and state management
- Save/load functionality
- Resource handling (images, audio, etc.)
- HTML content rendering with custom themes