This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Death Mountain is a blockchain-based adventure RPG game built on StarkNet using the Dojo engine. The game features adventurers battling beasts, collecting loot, and progressing through various challenges.
cd client
pnpm install # Install dependencies
pnpm dev # Start development server (port 5173)
pnpm build # Build for production (runs tsc && vite build)
pnpm lint # Run ESLint
pnpm preview # Preview production buildcd contracts
sozo build # Build Cairo contracts
sozo test # Run contract tests- React + TypeScript application using Vite as build tool
- State Management: Zustand stores in
client/src/stores/gameStore.ts- Main game state and player datamarketStore.ts- Marketplace and trading stateuiStore.ts- UI state management
- Platform-Specific UI:
client/src/desktop/- Desktop-optimized components and pagesclient/src/mobile/- Mobile-optimized components and pages
- Dojo Integration:
client/src/dojo/contains blockchain interaction code - Generated Code:
client/src/generated/- Auto-generated contract bindings - Game Data:
client/src/constants/- Static game data (beasts, loot, obstacles) - Components: Reusable UI components in
client/src/components/ - Containers: Screen-specific containers in
client/src/containers/
- Cairo Contracts in
contracts/src/ - Systems: Core game logic contracts in
contracts/src/systems/adventurer/- Player character systembeast/- Enemy and combat systemgame/- Main game loop and state managementloot/- Item generation and managementmarket/- Trading and marketplace logicsettings/- Game configurationrenderer/- NFT metadata rendering
- Models: Data structures in
contracts/src/models/ - Libraries: Shared code in
contracts/src/libs/ - Constants: Game constants in
contracts/src/constants/ - Dojo Framework: Version 1.5.1 for on-chain game state
- Wallet Connection: Uses Cartridge Controller and StarknetKit
- Contract Calls: Through generated bindings in
client/src/generated/ - Game State: Managed through Dojo's entity-component system
- Audio System: Background music and sound effects in
client/public/audio/
VITE_PUBLIC_NODE_URL- StarkNet RPC endpointVITE_PUBLIC_TORII- Torii indexer URL- Contract addresses for ETH, LORDS tokens, and game contracts
- Development:
dojo_dev.toml - Sepolia testnet:
dojo_sepolia.toml - Mainnet:
dojo_mainnet.toml - Slot testnet:
dojo_slot.toml
- Frontend Changes: Work in
client/src/, runpnpm devto see changes - Contract Changes: Modify Cairo files in
contracts/src/, deploy with Dojo CLI - Asset Updates: Place images in appropriate directories under
client/src/assets/ - State Management: Update Zustand stores for new game features
- UI Components: Use Material-UI components, maintain consistent styling
- TypeScript strict mode enabled
- React functional components with hooks
- Zustand for global state management
- Cairo 2.10.1 syntax for smart contracts
- Component files use
.tsxextension - Utility files use
.tsextension - Cairo formatting:
scarb fmtwith max line length 120
cd contracts
scarb fmt # Format Cairo code- Frontend deployment configured for Google App Engine (
client/app.yaml) - Contract deployment via Dojo CLI with network-specific profiles