The fastest way to build onchain games on Starknet From zero to deployed in 5 minutes โก
๐จ Frontend Ready
- React + Vite + TypeScript with complete Dojo integration
- Cartridge Controller wallet integration with session policies
- Real-time game UI with optimistic updates
- Comprehensive hooks for blockchain operations
โ๏ธ Backend Complete
- Cairo smart contracts with Dojo Engine architecture
- Player progression system with experience, health, and coins
- Integrated achievement system with 5+ achievements
- Production-ready deployment configuration
Frontend: React + Vite + TypeScript + TailwindCSS + Zustand
Backend: Cairo + Dojo Engine + Torii GraphQL Indexer
Network: Starknet (Local/Sepolia/Mainnet)
Wallet: Cartridge Controller
dojo-game-starter/
โโโ ๐ฑ client/ # Complete React + Dojo integration
โ โโโ src/dojo/ # Core Dojo integration files
โ โ โโโ bindings.ts # TypeScript interfaces from Cairo
โ โ โโโ dojoConfig.ts # Network and connection configuration
โ โ โโโ contracts.gen.ts # Auto-generated contract functions
โ โ โโโ hooks/ # Custom React hooks for blockchain
โ โโโ docs/ # ๐ Complete integration documentation
โ โโโ README.md # Frontend-specific documentation
โโโ โ๏ธ contract/ # Cairo smart contracts
โ โโโ src/
โ โ โโโ models/ # Data entities (Player model)
โ โ โโโ systems/ # Game logic (train, mine, rest)
โ โ โโโ achievements/ # Achievement system implementation
โ โ โโโ store/ # Data layer abstraction
โ โโโ README.md # Backend development and deployment guide
โโโ tests/ # Integration tests
The client/ directory contains a complete React + Dojo integration with comprehensive documentation:
๐ Client Documentation - Start here for frontend development
Complete Integration Guide Series:
- 01. Overview - Architecture and concepts
- 02. Architecture - System design patterns
- 03. Core Files - Essential integration files
- 04. Zustand State Management - Optimistic updates
- 05. Cartridge Controller - Gaming wallet UX
- 06. React Hooks Pattern - Blockchain hooks
- 07. Data Flow - Request/response cycles
- 08. Extending the System - Building your game
The contract/ directory contains Cairo smart contracts with Dojo Engine:
๐ Contracts Documentation - Backend development guide
Key Topics Covered:
- Project Structure - Models, Systems, Store architecture
- Game Mechanics - Player actions (spawn, train, mine, rest)
- Achievement System - Complete trophy/task implementation
- Local Development - Katana, Sozo, Torii setup
- Sepolia Deployment - Production deployment process
- Testing Strategy - Integration tests and best practices
The starter demonstrates essential onchain game patterns:
| Action | Effect | Demonstrates |
|---|---|---|
| ๐๏ธ Train | +10 Experience | Pure advancement mechanics |
| โ๏ธ Mine | +5 Coins, -5 Health | Risk/reward decision making |
| ๐ค Rest | +20 Health | Resource management systems |
๐ Achievement System:
- MiniGamer (1 action) โ SenseiGamer (50 actions)
- Complete integration with frontend achievement display
- Automatic progress tracking for all game actions
- ๐ Hackathon teams needing rapid onchain game setup
- ๐ฎ Game developers entering Web3 with production patterns
- ๐ข Studios prototyping blockchain games with real UX
- ๐ Developers learning Starknet + Dojo with comprehensive examples
โก Gaming-First UX
- Cartridge Controller integration eliminates wallet friction
- Session policies enable uninterrupted gameplay
- Optimistic updates provide instant feedback
- Background blockchain confirmation
๐ง Developer Experience
- Complete TypeScript integration end-to-end
- Hot reload with contract changes
- Comprehensive error handling patterns
- Production deployment configurations
๐๏ธ Scalable Architecture
- Modular component design for easy extension
- Reusable hooks for blockchain operations
- Clean separation between UI and blockchain logic
- Performance optimizations built-in
- For Frontend Development: Start with Client README
- For Backend Development: Check Contracts README
- For Complete Understanding: Follow the Integration Guide Series
Built with โค๏ธ for the Starknet gaming community