Start here
Quickstart
From zero to a running client in two commands.
Scaffold
npm create slotplate my-slot
cd my-slot
pnpm install
pnpm dev Open http://localhost:5173. Click Spin. You're watching the FSM run end-to-end: HUD click → transition → bet debit → parallel reels-start + network — then result playback → winShow → idle.
The reels themselves are a stub. slotplate ships with a
StubReelsEngine so the FSM can boot before your assets are loaded. You'll
swap it for a real ReelSetBuilder call in src/view/scenes/MainScene.ts
once you have art.
What just booted
The composition root (src/composition.ts) wired:
- A Pixi
Applicationmounted in#app. - A MobX
RootStoreholdingbalance,data,ui. - The
FSMwith phasesidle,spin,stopSpin,winShow. - A
HUDPresenterbinding the plain HTML buttons to FSM transitions. - A
MockNetworkManagerreturning a random grid after 300 ms. - A
GsapTickersynced to Pixi's ticker — nosetTimeoutleaks.
Next checkpoints
- Read
CLAUDE.mdin the project root. The principles there are hard rules, and Biome enforces them. You'll save yourself a lint-failure commit. - Wire pixi-reels properly.
Replace
StubReelsEngineinsrc/view/scenes/MainScene.tswith a realReelSetBuildercall. See the Add a symbol guide for the shape. - Swap the network transport.
MockNetworkManageris for dev only. Your real RGS goes insrc/infrastructure/NetworkManager.ts. Keep the interface; replace the class. See Swap the network transport. - Tune the HUD. The default HUD is three DOM elements. Swap in React / Vue / Svelte when you're ready — the presenter contract stays the same.
- Run the tests.
pnpm test. The scaffolded project ships with real tests for the FSM and stores.
Running commands
pnpm dev # vite on :5173
pnpm typecheck # tsc --noEmit
pnpm test # vitest
pnpm lint # enforces the principles
pnpm build # static bundle in dist/ If something breaks
- Build the project first with
pnpm install && pnpm typecheck— catches dep mismatches. - Check the browser console.
__PIXI_REELS_DEBUG.log()shows the reel state. - Use the
/loopof TypeScript → lint → test as your editing rhythm.