How cran1ax/virtual-3d-office works
Project Type and Purpose
• This is a full-stack, real-time, web-based 3D “metaverse” or collaborative environment.
• The client (under /client) is a Vite-powered React app that loads 3D models/animations (GLB files) and renders them with Three.js.
• The server (under /server) is a Node.js application (likely using Express + Socket.io) that handles WebSocket signaling for state sync (avatars, lobby, shop, tasks) and voice-call signaling (WebRTC).
File Structure
A. Top-Level
– /client → Frontend source, assets, configs (Vite, Tailwind, PostCSS).
– /server → Backend code, config files (default.json, .env), restart script.
– README.md at root only points to a video tutorial.
B. Frontend Details
– client/src houses React components (Avatar, Room, Lobby, VoiceCall, TaskManager, etc.).
– client/public/models, /textures, /animations store static GLB and HDR assets.
– SocketManager.jsx and hooks handle real-time events.
C. Backend Details
– server/index.js presumably spins up HTTP + WebSocket servers.
– server/default.json and .env define ports, credentials.
– restart.js may auto-restart the server on config or file changes.
README for Insights
• The README contains only a link to a tutorial video—no explicit architecture docs.
Elements
• HTTP GET (asset bundles, models)
• WebSocket connect/send/receive
• WebRTC signaling & media streams
• Frontend components (e.g., green)
• Backend components (e.g., blue)
• External services (e.g., orange)