Skip to content

Complete Dojo Starter: React + TypeScript frontend, Cairo smart contracts, achievement system, wallet integration, GitHub Actions deployment.

Notifications You must be signed in to change notification settings

0xNaokiDev/Cairo_Dojo_Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Dojo Game Starter

The fastest way to build onchain games on Starknet From zero to deployed in 5 minutes ⚡

Dojo Engine     Dojo by Example     Starknet

✨ What's Included

🎨 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

🛠️ Tech Stack

Frontend: React + Vite + TypeScript + TailwindCSS + Zustand
Backend:  Cairo + Dojo Engine + Torii GraphQL Indexer
Network:  Starknet (Local/Sepolia/Mainnet)
Wallet:   Cartridge Controller

📦 Project Structure

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

📚 Documentation

🎨 Frontend Integration

The client/ directory contains a complete React + Dojo integration with comprehensive documentation:

📖 Client Documentation - Start here for frontend development

Complete Integration Guide Series:

⚙️ Backend Development

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

🎮 Game Mechanics

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

🎯 Perfect For

  • 🏆 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

🚀 Key Features

⚡ 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

🌟 Getting Started

  1. For Frontend Development: Start with Client README
  2. For Backend Development: Check Contracts README
  3. For Complete Understanding: Follow the Integration Guide Series

🔗 Links


Built with ❤️ for the Starknet gaming community

About

Complete Dojo Starter: React + TypeScript frontend, Cairo smart contracts, achievement system, wallet integration, GitHub Actions deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published