How yuming0929/desk works
Project type and purpose
• This is a single-page, full-stack-style (client-only) React application delivered as static assets.
• Purpose: let end users customize a 3D desk model in real time via a web UI, powered by Three.js (inside React).
File structure
• Top-level files:
– index.html + public/ → static HTML/CSS + 3D assets (desk.glb, textures)
– vite.config.js → build & dev server config
– package.json → dependencies (React, Three.js, state library, etc.)
• src/: contains React entry point (main.jsx), styles (App.css, index.css), components, asset folder, and state stores.
• src/components/:
– Experience.jsx → Three.js canvas setup, scene & renderer
– Desk.jsx → loads the GLTF model + applies textures/materials
• src/stores/: configStore.js, detail.js → centralized state (likely Zustand or similar).
README
• Confirms it’s a “3d桌子选配器” with a deployed demo (Netlify).
• No server-side/microservices—purely static front-end.
Main components
a. Client Browser (User’s device)
b. Web Server/CDN (Netlify or any static host)
c. React Application:
1) UI Layer (Configurator component + standard React tree)
2) State Management Layer (configStore, detailStore)
3) 3D Rendering Layer (Experience, Desk components using Three.js)
d. Static Asset Store (public/models/desk.glb, public/textures)
f. External Services – analytics or hosting, if any
Relationships & interactions
• Client requests index.html + JS/CSS from CDN.
• React App boots (main.jsx → App.jsx).
• Configurator (UI) dispatches actions → State Store.
• Experience subscribes to State Store updates → re-renders Desk.
• Desk component uses GLTFLoader to fetch .glb + textures from the public folder.
• Three.js WebGL context renders the scene back to the browser canvas.
Architectural patterns & design principles
• Component-based UI (React JSX components)
• Unidirectional data flow (Configurator → Store → Experience → UI update)
• Separation of concerns: UI / State / Rendering
• Static asset hosting for 3D models and textures
Essential details to capture
• Labels: name each component (e.g., “Configurator (React)”, “configStore (Zustand)”)
Putting it all together
• Related components with lightly shaded containers.