A simple Rock, Paper, Scissors web app built with React, TypeScript, and Zustand. Players start with a balance and can place bets on one or two positions. The game resolves a random outcome and pays out based on configurable multipliers.
src/
├── components/ # React UI components
│ ├── BetButton/
│ ├── Button/
│ ├── GameControls/
│ ├── Header/
│ └── PlayClearButton/
├── domain/ # Pure game logic and types
│ ├── gameLogic.ts
│ └── resolveRound.ts
├── screens/ # High-level flow
│ └── GameScreen/
├── store/ # Zustand store
│ └── gameStore.ts
├── utils/ # Utility functions
│ ├── pickPlayerTitleChoice.ts
│ └── randomChoice.ts
├── assets/ # Static assets (icons, images)
├── setupTests.ts # Testing environment setup
└── index.html, main.tsx # App entrypoint
Node.js ≥ 20
npmnpm installnpm run devOpen http://localhost:5173 in your browser
npm run buildnpm run previewUnit tests are written with Vitest and React Testing Library
npm test• Framework: React
• Language: TypeScript (strict)
• State: Zustand
• Bundler: Vite
• Testing: Vitest, React Testing Library
• Styling: plain CSS