-
Notifications
You must be signed in to change notification settings - Fork 50
Guide client integration with torii #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
respp
wants to merge
15
commits into
AkatsukiLabs:main
Choose a base branch
from
respp:guide-client-integration-with-torii
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Guide client integration with torii #197
respp
wants to merge
15
commits into
AkatsukiLabs:main
from
respp:guide-client-integration-with-torii
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Create main overview page with quick start guide - Include basic setup instructions and working examples - Add links to detailed guides for comprehensive learning - Provide copy-paste ready code for immediate use - Address GitHub issue AkatsukiLabs#194 for Torii client integration documentation
- Add comprehensive setup instructions for Torii integration - Include environment configuration for different networks - Provide Dojo configuration examples with security best practices - Add troubleshooting section for common setup issues - Include address validation and security considerations
- Add comprehensive GraphQL query structure documentation - Include Cairo model query examples (Position, Moves) - Provide advanced query patterns (pagination, filtering, sorting) - Add query optimization best practices - Include debugging and schema introspection examples
- Add comprehensive React hooks patterns for Torii data fetching - Include basic, enhanced, and auto-refetch hook examples - Provide multiple model query patterns and list hooks - Add component usage examples with error handling - Include hook best practices and performance considerations
- Add hex to number conversion utilities for Cairo model data - Include address formatting and validation utilities - Provide Cairo enum handling patterns (Direction enum examples) - Add bulk data conversion and type-safe conversion patterns - Include error handling and validation utilities for data conversion
- Add comprehensive error handling patterns for Torii queries - Include custom error classes (ToriiError, GraphQLError, NetworkError) - Provide retry strategies with exponential backoff - Add error boundaries and component error handling - Include error monitoring, logging, and recovery strategies
- Add caching strategies with TTL and LRU implementations - Include request batching and query deduplication patterns - Provide performance monitoring and metrics collection - Add memory management and query optimization techniques - Include performance best practices and optimization guidelines
- Add Torii Integration section to deployment navigation - Include links to all 6 detailed guides (setup, queries, hooks, etc.) - Add cross-reference in React Integration section - Update routes structure for proper navigation integration - Ensure all guides are discoverable in the documentation
2 tasks
jimenezz22
requested changes
Sep 7, 2025
Contributor
jimenezz22
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain the use of torii in the client please use this example it's more meaningful than the example of x and y movements you are using
- Replace Position/Moves examples with Player model (experience, health, coins, creation_day) - Update GraphQL queries to use fullStarterReactPlayerModels - Update component examples to display meaningful player statistics - Update data conversion examples to handle player data types - Improve prerequisites to reference Player model instead of Position/Moves This makes the documentation more meaningful and aligns with real-world Dojo Game Starter implementation patterns.
- Replace Position/Moves hook examples with Player model hooks - Update GraphQL queries to use fullStarterReactPlayerModels - Update multiple model hook to use Player model structure - Update enhanced hook with data conversion for player data - Maintain consistent Player interface across all hook examples This provides developers with practical, real-world hook patterns that match the Dojo Game Starter implementation.
- Replace Position/Moves query examples with Player model queries - Update query structure to use fullStarterReactPlayerModels - Update leaderboard query to sort by experience instead of remaining moves - Update filtered query to use health conditions - Update pagination query to use Player model fields - Update multiple model query to use Player model structure This provides developers with practical GraphQL query patterns that match real-world Dojo game implementations.
- Replace Position data conversion examples with Player model examples - Update hex conversion utilities to handle player data fields - Update bulk data conversion examples to use player data structure - Update type-safe conversion interfaces for Player model - Update generic type converter examples for player data - Maintain consistent Player interface across all conversion examples This provides developers with practical data conversion patterns for handling Cairo model data in real-world applications.
- Replace Position error handling examples with Player model examples - Update hook with error handling to use Player model structure - Update component usage example to display player statistics - Update fallback example to use player data instead of position data - Update GraphQL queries to use fullStarterReactPlayerModels - Maintain consistent error handling patterns for player data This provides developers with robust error handling patterns that work with real-world Player model implementations.
- Replace Position/Moves performance examples with Player model examples - Update optimized hook to use Player model structure - Update request batching examples to use Player model queries - Update pagination query examples to use Player model fields - Update usage examples to demonstrate Player model optimization - Update GraphQL queries to use fullStarterReactPlayerModels This provides developers with performance optimization patterns that work with real-world Player model implementations.
- Replace Position/Moves prerequisites with Player model prerequisites - Update debug query example to use fullStarterReactPlayerModels - Update model verification examples to use Player model structure - Maintain consistent Player model references throughout setup guide This ensures the setup guide aligns with the Player model examples used throughout the rest of the Torii integration documentation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documentation Restructure Summary
🎯 Problem Solved
Original Issue: The Torii client integration guide was too long (1,176 lines) and difficult to navigate.
Solution: Broke down the large documentation into smaller, focused guides that are easier to digest and navigate.
📊 Before vs After
Before (Single Large File)
client-new/pages/deployment/torii/client-integration.mdAfter (Modular Structure)
📁 New Structure
🎯 Guide Breakdown
1. Main Overview (
client-integration.md)2. Setup & Configuration (
guides/setup.md)3. GraphQL Queries (
guides/graphql-queries.md)4. Custom Hooks (
guides/custom-hooks.md)5. Data Conversion (
guides/data-conversion.md)6. Error Handling (
guides/error-handling.md)7. Performance (
guides/performance.md)🧭 Navigation Improvements
Updated Routes Structure
Cross-References
🎯 Developer Experience Improvements
✅ Easier Navigation
✅ Better Readability
✅ Improved Maintainability
✅ Enhanced Learning
📈 Content Quality
Total Lines: 2,901 (vs original 1,176)
Coverage Areas
🚀 Benefits Achieved
For New Developers
For Experienced Developers
For Maintainers
🎯 Success Metrics
Usability
Content Quality
Maintainability