A blockchain-based word puzzle game built on the Dojo engine, where players solve puzzles by guessing words based on image clues.
- Overview
- How to Play
- Prerequisites
- Local Development Setup
- Project Structure
- Configuration
- Game Flow
- Troubleshooting
- Architecture
QuadClue is a decentralized puzzle game where:
- Players view 4 images and guess the connecting word
- Each puzzle has available letters that can be used to form the answer
- Players earn points and coins for correct answers
- Game state is stored on the Starknet blockchain via Dojo
- Features include hints, scoring system, and level progression
- Look at all 4 pictures carefully
- Find the common theme or connection between them
- Think about what word could describe or relate to all images
- Look at the word slots (empty boxes)
- Count how many letters the answer has
- This gives you a clue about the word length
- You'll see 12 letters at the bottom of the screen
- These are the only letters you can use to form your answer
- Drag and drop or tap letters to spell your guess
- You can only use each letter once (unless it appears multiple times)
- Once you've spelled out your word, submit your guess
- If correct: ✅ You earn points and solve the puzzle!
- If wrong: ❌ Try again with different letters
Before you begin, make sure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- Dojo CLI (follow Dojo installation guide)
- Git
If you don't have Dojo installed:
curl -L https://install.dojoengine.org | bash
dojoupgit clone <repository-url>
cd QuadClueNavigate to the contract directory and set up the blockchain infrastructure:
cd contractkatana --dev --http.api dev,starknet --dev.no-fee --http.cors_origins '*'Keep this terminal running. Katana will output several important details:
- Account addresses and private keys
- RPC URL (typically
http://localhost:5050) - World address (generated after migration)
# Build the contracts and generate TypeScript bindings
sozo build --typescript
# Deploy the contracts to Katana
sozo migrateImportant: After running sozo migrate, note the WORLD_ADDRESS from the output. You'll need this for the next steps.
# Replace <WORLD_ADDRESS> with the actual world address from sozo migrate
torii --world <WORLD_ADDRESS> --http.cors_origins "*"Open a new terminal and navigate to the frontend directory:
cd ../front-end
# Install dependencies (use legacy peer deps to resolve conflicts)
npm install --legacy-peer-deps- Update Manifest File
After running sozo migrate, copy the generated manifest file to the frontend:
# From the contract directory
cp manifest_dev.json ../front-end/- Update Dojo Configuration
Open front-end/src/lib/dojo/dojoConfig.ts and update the master address and private key to match your Katana instance:
export const dojoConfig = createDojoConfig({
// Replace these with the account details from your Katana output
masterAddress: "0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec",
masterPrivateKey: "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912",
// These usually don't need to change for local development
accountClassHash: "0x07dc7899aa655b0aae51eadff6d801a58e97dd99cf4666ee59e704249e51adf2",
feeTokenAddress: "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
manifest,
});# From the front-end directory
npm run devThe application will be available at http://localhost:3000.
QuadClue/
├── contract/ # Dojo smart contracts
│ ├── src/
│ │ ├── lib.cairo # Main contract library
│ │ ├── models.cairo # Data models
│ │ └── systems/ # Contract systems
│ ├── dojo_dev.toml # Dojo development config
│ └── manifest_dev.json # Generated contract manifest
│
├── front-end/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # React components
│ │ ├── lib/ # Utilities and Dojo integration
│ │ └── types/ # TypeScript type definitions
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
│
└── README.md # This file
contract/dojo_dev.toml- Dojo world configurationcontract/manifest_dev.json- Generated contract manifest (auto-generated)front-end/src/lib/dojo/dojoConfig.ts- Frontend Dojo configurationfront-end/manifest_dev.json- Copy of contract manifest for frontend
The app uses these default configurations:
- RPC URL:
http://localhost:5050(Katana) - Torii URL:
http://localhost:8080(Torii indexer)
When you first open the app:
- The app will prompt you to connect a wallet
- Use one of the pre-deployed Katana accounts
- The app supports Katana's built-in accounts for local development
Navigate to http://localhost:3000/dashboard to create puzzles:
- Quick Test: Click "Create Test Puzzle (PAINT)" to create a pre-configured puzzle
- Custom Puzzle:
- Fill in 4 image hashes or URLs
- Provide an answer (3+ characters)
- Click "Create Puzzle"
Example test puzzle data:
- Images: 4 URLs or hashes representing the concept
- Answer: The word that connects all images (e.g., "PAINT")
Navigate to http://localhost:3000/game to play:
- View the 4 images for each puzzle
- Use available letters to spell the answer
- Letters are shuffled - use the shuffle button to rearrange
- Complete puzzles to earn points and advance levels
- Hints: Use hints to reveal letters (limited per puzzle)
- Scoring: Based on time and hints used
- Progression: Unlock new levels by completing puzzles
- Persistence: Game state is saved on the blockchain
Symptoms: App shows initialization error
Solutions:
- Ensure Katana is running on
http://localhost:5050 - Verify Torii is running and connected to the correct world address
- Check that
manifest_dev.jsonis up to date in both contract and frontend directories - Restart all services in order: Katana → Deploy → Torii → Frontend
Symptoms: Cannot connect wallet or transactions fail
Solutions:
- Use the correct account address/private key from Katana output
- Ensure the account has sufficient balance (Katana provides prefunded accounts)
- Check browser console for connection errors
Symptoms: Puzzle creation or game actions fail
Solutions:
- Verify the world address in Torii matches the deployed world
- Ensure all contracts are properly migrated
- Check that the account has necessary permissions
Symptoms: Build errors or import failures
Solutions:
# Clear dependencies and reinstall
cd front-end
rm -rf node_modules package-lock.json
npm install --legacy-peer-depsTo completely reset your local environment:
- Stop all services (Katana, Torii, Frontend)
- Restart Katana with a fresh state
- Rebuild and redeploy contracts:
cd contract sozo build --typescript sozo migrate - Update manifest in frontend:
cp manifest_dev.json ../front-end/
- Restart Torii with new world address
- Update dojoConfig.ts with new account details
- Restart frontend
- Blockchain: Starknet with Cairo smart contracts
- Game Engine: Dojo framework for autonomous worlds
- Frontend: Next.js 15 with TypeScript
- Styling: Tailwind CSS
- State Management: Zustand + Dojo SDK
- Wallet Integration: Starknet React
- Smart Contracts: Handle game logic, puzzle storage, and player progression
- Dojo SDK: Provides blockchain integration and state synchronization
- React Components: UI components for game interface
- Katana: Local Starknet node for development
- Torii: Dojo indexer for efficient data querying
cd contract
# Build contracts
sozo build
# Build with TypeScript bindings
sozo build --typescript
# Deploy to local Katana
sozo migrate
# Start local node
katana --dev --http.api dev,starknet --dev.no-fee --http.cors_origins '*'
# Start indexer (replace <WORLD_ADDRESS>)
torii --world <WORLD_ADDRESS> --http.cors_origins "*"cd front-end
# Install dependencies
npm install --legacy-peer-deps
# Development server
npm run dev
# Production build
npm run build
# Start production server
npm start
# Lint code
npm run lintFor more information about Dojo development, visit the official documentation.
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally following the setup guide
- Submit a pull request
[Add your license information here]