This repository contains the official documentation for the Dojo ecosystem - a comprehensive toolchain for building provable games and autonomous worlds on Starknet. Dojo provides a complete framework for developing fully on-chain games using Cairo smart contracts with Entity Component System (ECS) architecture.
- Type: Technical documentation website built with Vocs (Vue-based documentation framework)
- Primary Technology: TypeScript/JavaScript with React components
- Content Format: Markdown/MDX files with code examples
- Deployment: Vercel hosting with automatic builds
- Architecture: Doc source in docs/, with reference material kept in src/ as Git submodules
- Markdown/MDX: Documentation content with JSX components
- Git Submodules: Source code references from multiple repositories
- Structured Navigation: Hierarchical routing with collapsible sections
# Start development server (http://localhost:5173/)
pnpm run dev
# Build for production
pnpm run build# Update all submodules to latest versions
git submodule update --remote
# Check submodule status
git submodule status~/book/
├── docs/ # Documentation content
│ ├── components/ # React components for docs
│ ├── pages/ # MDX content files
│ │ ├── architecture/ # Technical architecture (execution, rollups)
│ │ ├── blog/ # Blog posts and articles
│ │ ├── client/ # SDK documentation for multiple platforms
│ │ │ └── sdk/ # Platform-specific SDKs
│ │ │ ├── bevy/ # Bevy engine integration // REFERENCE: src/sdks/dojo.bevy
│ │ │ ├── c/ # C language bindings // REFERENCE: src/sdks/dojo.c
│ │ │ ├── discord/ # Discord integration
│ │ │ ├── godot/ # Godot engine integration
│ │ │ ├── javascript/ # JavaScript SDK // REFERENCE: src/sdks/dojo.js
│ │ │ ├── rust/ # Rust SDK
│ │ │ ├── telegram/ # Telegram integration
│ │ │ ├── unity/ # Unity integration // REFERENCE: src/sdks/dojo.unity
│ │ │ └── unreal/ # Unreal Engine integration // REFERENCE: src/sdks/dojo.unreal
│ │ ├── community/ # Community resources
│ │ ├── framework/ # Core Dojo framework documentation // REFERENCE: src/framework/dojo && src/starters && src/games
│ │ │ ├── authorization/ # Authorization system
│ │ │ ├── config/ # Configuration management
│ │ │ ├── models/ # Model definitions and API
│ │ │ ├── systems/ # Systems documentation
│ │ │ ├── testing/ # Testing framework and cheat codes
│ │ │ └── world/ # World contract (API, events, metadata, permissions)
│ │ ├── getting-started/ # Onboarding and setup guides
│ │ ├── libraries/ # Ecosystem libraries
│ │ │ ├── alexandria/ # Alexandria library collection
│ │ │ └── origami/ # Cairo utilities library // REFERENCE: src/libraries/origami
│ │ ├── misc/ # Miscellaneous content
│ │ ├── theory/ # Conceptual topics (autonomous worlds)
│ │ ├── toolchain/ # Tool-specific documentation
│ │ │ ├── katana/ # Starknet sequencer // REFERENCE: src/toolchain/katana
│ │ │ ├── saya/ # Proving system // REFERENCE: src/toolchain/saya
│ │ │ ├── slot/ # Deployment commands
│ │ │ ├── sozo/ # Project and world commands // REFERENCE: src/framework/dojo
│ │ │ └── torii/ # Indexing engine // REFERENCE: src/toolchain/torii
│ │ └── tutorials/ # Step-by-step learning guides // REFERENCE: src/starters && src/games
│ └── public/ # Static assets
├── src/ # Git submodules (reference repositories)
├── spec/ # Documentation standards
└── configuration files # Build, linting, deployment
- Framework: Core Dojo concepts (World, Models, Systems) -- theoretically focused
- Toolchain: Tool-specific documentation (Katana, Torii, Sozo, Saya) -- theoretically focused
- Tutorials: Step-by-step learning guides -- practically focused
- Client/SDK: Integration guides for various platforms -- practically focused
- Architecture: Scaling and technical deep-dives -- theoretically focused
- Libraries: Ecosystem libraries (Origami, Alexandria) -- practically focused
- Framework: Core Dojo framework implementation (Rust/Cairo)
- Games: Example game implementations showcasing Dojo capabilities
- Libraries: Ecosystem libraries like Origami (Cairo utilities)
- SDKs: Multi-platform integrations (JavaScript, Unity, Unreal, Bevy, C/C++)
- Starters: Template projects for quick development setup
- Toolchain: Core infrastructure tools (Katana, Torii, Saya)
- Process Documentation: Update workflows and maintenance procedures
- Style Guide: Writing standards and terminology consistency
- Architecture: Content organization using Diátaxis framework
- Tutorials: Learning-oriented, step-by-step guides
- How-to Guides: Goal-oriented problem-solving
- Reference: Information-oriented technical specs
- Explanations: Understanding-oriented concepts
- Voice: Direct, conversational, present tense
- Tone: Helpful, inclusive, professional but approachable
- Terminology: Consistent use of Dojo-specific terms
- Code Examples: Working, tested, well-commented snippets
- Newlines: Put each sentence on a new line
- Documentation as Code: Treat docs as first-class deliverables
- Audience-Driven: Content tailored to user skill levels
- Visual Integration: Diagrams, screenshots, and examples
- Accessibility: Global audience, screen-reader friendly
-
CRITICAL: One sentence per line: Always put each sentence on its own line in Markdown files for maintainability and easier editing. This is non-negotiable for all content changes.
# Correct format: Katana provides flexible mining modes. This allows precise control over block production. # Incorrect format: Katana provides flexible mining modes. This allows precise control over block production.
-
CRITICAL: Omit best practices: LLM-generated "best practices" are often generic, do not include them in generated documentation
-
Ensure code correctness: Verify all code examples against source code in src/ submodules (see "Code Verification Workflow" below)
-
Maintain cross-references: Link related content appropriately
-
Follow navigation structure: Use existing routing patterns in
routes.ts -
Never commit without testing: Run
pnpm run buildbefore commits
- Accuracy: All Cairo code must be verified against src/ submodule source code
- Realism: Use realistic game scenarios, not abstract examples
- References: Include links to source-code references whenever possible
Use this workflow when updating docs after version changes or to fix inaccuracies.
- Identify scope: Determine which docs sections are affected using the REFERENCE annotations in the architecture section above
- Update submodules (if needed):
git submodule update --remote - Review source changes:
cd src/<relevant-submodule> git log --oneline -20 # See recent changes git diff HEAD~10 -- <relevant-files> # See what changed
- Load source context: Read the relevant src/ code to understand current behavior
- Compare with docs: Read the existing documentation and identify discrepancies
- Make targeted edits: Update only what's changed; preserve correct existing content
- Verify: Run
pnpm run buildand check for broken links
Use this workflow when creating new pages or sections.
-
Determine page type: Using Diátaxis (see
spec/page-types.md):- Tutorial: Teaching a concept through building something
- How-to: Solving a specific problem
- Reference: API/CLI specifications
- Explanation: Conceptual understanding
-
Gather source material:
- For framework docs: Read
src/framework/dojoandsrc/starters - For toolchain docs: Read
src/toolchain/<tool> - For SDK docs: Read
src/sdks/<sdk> - For library docs: Read
src/libraries/<library>
- For framework docs: Read
-
Study existing patterns: Read 2-3 similar pages in the same section to match style and depth
-
Draft content: Follow the template from
spec/page-types.mdfor your chosen type -
Add code examples: Extract real examples from src/ or adapt from existing games in
src/games -
Update navigation: Add the new page to
routes.ts -
Verify: Run
pnpm run build
All Cairo/Dojo code examples must be verified before inclusion.
For model definitions:
- Check
src/framework/dojo/crates/dojo/corefor current trait names and derive macros - Verify required attributes (
#[dojo::model],#[key], etc.) - Confirm field types match what's supported
For system implementations:
- Check
src/framework/dojo/crates/dojo/corefor system traits and interfaces - Verify world interaction patterns (get/set model syntax)
- Confirm event emission patterns
For CLI commands:
# Verify command exists and syntax is correct
sozo --help
katana --help
torii --help
# For detailed options
<command> <subcommand> --helpFor configuration:
- Check
src/framework/dojofor Scarb.toml patterns - Verify against working examples in
src/startersorsrc/games
When unfamiliar with a Dojo concept, follow this process:
- Start with existing docs: Read the current documentation for context and terminology
- Read source code: The src/ submodules are the source of truth
- Core concepts:
src/framework/dojo/crates/dojo/core - Working examples:
src/starters,src/games
- Core concepts:
- Study tests: Test files often demonstrate correct usage patterns
- Check examples:
src/gamescontains full game implementations
Key Dojo concepts to understand:
- World: The root contract that manages all state
- Models: Data structures with
#[dojo::model]that define game state - Systems: Functions that modify models, implementing game logic
- Events: On-chain events for client synchronization
- Torii: Indexer that makes World state queryable
- Katana: Local Starknet sequencer for development
Before considering documentation complete:
- One sentence per line (non-negotiable)
- No generic "best practices" sections
- All code examples verified against src/
- Code examples use realistic game scenarios
- Cross-references to related pages included
- Page type matches content (Tutorial/How-to/Reference/Explanation)
- Navigation updated in
routes.tsif new page - Build passes:
pnpm run build - No broken internal links
This documentation project serves as the central hub for the Dojo ecosystem, providing comprehensive guidance for developers building on-chain games and autonomous worlds. The multi-repository architecture via submodules ensures documentation stays current with rapid development across the entire toolchain.