How krikienoid/flagwaver works
Main Architecture Components
The system should be represented as a client-side single-page application (SPA) with the following main components:
a. Frontend Application Layer
• React/Preact Components
• Redux State Management
• UI/UX Components
• SCSS Styling System
b. Core Flag Simulation Layer
• Three.js 3D Rendering
• Physics Engine
• Flag Animation System
Detailed Component Breakdown
a. User Interface Layer (Top Level)
• App Components (/src/assets/js/app/components)
• Container Components (/src/assets/js/app/containers)
• Redux Store & Modules (/src/assets/js/app/redux)
• Context Providers (/src/assets/js/app/contexts)
b. FlagWaver Core (Middle Layer)
• Module System (/src/assets/js/flagwaver/app/core)
• Physics Engine (/src/assets/js/flagwaver/physics)
• Flag Subjects (/src/assets/js/flagwaver/subjects)
• WebGL Shaders (/src/assets/js/flagwaver/webgl)
c. Asset Management (Bottom Layer)
• Static Assets
• Fonts
• Images
• Styles (SCSS)
Data Flow and Interactions
a. User Input Flow:
→ UI Components
→ Redux Actions
→ State Updates
→ FlagWaver Core
→ Three.js Rendering
b. Physics Simulation Flow:
→ Wind Module
→ Physics Calculations
→ Cloth Simulation
→ Flag Animation
→ WebGL Rendering
Technical Stack Indicators
• Preact
• Redux
• Three.js
• WebGL
• SCSS
• Gulp/Rollup
Module Relationships
Relationships between:
• FlagWaver Core and UI Components
• Physics Engine and Flag Subjects
• Wind Module and Cloth Simulation
• State Management and Animation Control
Keep the abstraction level high enough to understand the overall architecture but detailed enough to show the unique aspects of the flag simulation system, particularly the physics engine and WebGL rendering pipeline.