How kabirsync/particlegarden works
Main System Components
A. Frontend Application Layer
• React Application Core
• Simulation Engine
• UI Components
• Theme System
• Worker System
B. Simulation Core
• Material System
• Behavior System
• Grid Management
• Particle Management
Component Relationships
[Frontend Application Layer]
• [React Core (App.tsx)]
• [Simulation Engine]
• [Grid System]
• [Particle System]
• [Material System]
• [Behavior System]
• [UI Layer]
• [Material Options]
• [Simulation Controls]
• [Drawing Tools]
• [Theme System]
• [Worker System]
Specific Implementation Details
a) Simulation Core:
• Relationship between materials (src/components/simulation/materials)
• Behavior patterns (src/components/simulation/behaviours)
• Demonstrate particle movement and interactions
b) Material System:
• Inheritance from base Material class
• Different material types (Sand, Water, Fire, etc.)
• Behavior associations
c) UI Components:
• Material selection and controls
• Drawing tools and options
• Simulation settings
Key Architectural Patterns to Highlight
• Component-based architecture (React)
• Behavior pattern system for particle movement
• State management for simulation
• Worker-based processing for performance
• Theme provider pattern for styling
Technical Details
• TypeScript as the primary language
• React for UI framework
• Three.js for rendering
• Web Workers for background processing
• Tailwind CSS for styling
Data Flow Indicators
• User input → Simulation state
• Particle behavior calculations
• Material interactions
• Worker communication
• Theme propagation