This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run dev- Start development server with host flag enablednpm run build- Build production version using Vitenpm run serve- Preview production build locally
npm run lint- Run both JavaScript and Prettier lintingnpm run lint:js- Run ESLint on JavaScript/JSX files in src/npm run lint:prettier- Check code formatting with Prettier
npm run get-assets- Clone required loot-assets from GitHub into public/ directory
npm run deploy- Deploy to GitHub Pages (runs build first)
- make a todo.md list and remember to update it after each task is complete
- Frontend: React 18 with Vite build system
- 3D Graphics: Three.js for WebGL rendering, @pixiv/three-vrm for VRM model support
- State Management: Zustand for application state
- Styling: CSS Modules and Styled Components
- Blockchain: Ethereum (ethers.js) and Solana (@solana/web3.js) integration
- Audio: Web Audio API with lip sync capabilities
Located in src/library/characterManager.js - This is the central class that orchestrates all character-related functionality:
- Manages 3D character models and their traits
- Handles loading, displaying, and manipulating VRM models
- Integrates with AnimationManager, EmotionManager, BlinkManager, and LookAtManager
- Provides VRM export capabilities with optimization features
The library directory contains modular utility classes:
- Character Management:
vrmManager.js,characterManager.js,manifestDataManager.js - Animation System:
animationManager.js,blinkManager.js,lookatManager.js,lipsync.js - Export/Import:
VRMExporter.js,VRMExporterv0.js,load-utils.js,download-utils.js - Optimization:
merge-geometry.js,cull-mesh.js,create-texture-atlas.js - Media Generation:
screenshotManager.js,thumbnailsGenerator.js,spriteAtlasGenerator.js - Blockchain:
solanaManager.js,mint-utils.js,walletCollections.js
React contexts manage different application domains:
SceneContext- 3D scene and rendering stateViewContext- UI view modes and navigationAccountContext- User authentication and wallet integrationAudioContext- Audio playback and recordingLanguageContext- Internationalization
- Assets are loaded from
/public/directory structure - Manifest-driven asset loading with
manifest.jsonfiles - Support for multiple asset collections (loot-assets, FUMO, milady, etc.)
- Texture atlasing and optimization for performance
- Loading: VRM models loaded via VRMLoaderPlugin
- Customization: Trait-based system for mixing and matching components
- Animation: Mixamo animation integration with bone remapping
- Export: Optimized VRM export with texture atlasing and mesh merging
- Optimization: One-click optimization reducing models to single draw calls
- Multi-chain support (Ethereum via Web3-React, Solana via @solana/web3.js)
- NFT trait verification and ownership checking
- Batch generation and minting capabilities
- Integration with Metaplex for Solana NFTs
- Automatic face culling system for hidden meshes
- Texture atlas generation to reduce draw calls
- Mesh merging for optimized rendering
- KTX2 texture compression support
The application requires external assets to function properly. Run npm run get-assets to clone the required loot-assets repository into the public directory.
The application uses VITE_ASSET_PATH environment variable for asset path configuration.
The development server runs with --host flag enabled for network access, useful for testing on mobile devices.
- Uses Vite with React SWC plugin for fast builds
- Output directory is configured to
./buildfor GitHub Pages compatibility - Buffer polyfill is configured for blockchain libraries
- ESLint configured with React and import plugins
- Prettier integration for consistent code formatting
- No-inline-styles plugin enforces CSS Modules usage
- Component-based architecture with CSS Modules
- Separation of concerns between UI components and business logic
- Utility functions centralized in library directory