How ray053/unitydancesystem works
Project Type and Purpose
• From the README and file tree, “UnityDanceSystem” is a full-stack, interactive dance-learning platform that fuses:
• A Nuxt 3 + Vue 3 front end (with Tailwind CSS and shadcn/vue UI components)
• Unity WebGL for 3D rendering of dance guidance
• Kinect for motion capture
• A Node.js + Express back end (API + Laban motion-analysis engine)
• Persistent storage for users, courses, and learning history
File-Structure Analysis
• Top-level npm project with pnpm-lock.yaml, package.json, tsconfig.json
• Frontend in root:
• nuxt.config.ts, app.vue, layouts/, pages/, components/ (shadcn/vue under components/ui), assets/, public/
• .nuxt/ is the generated Nuxt build output
• Routing defined by pages/ and router/index.ts
• Server/API code under server/ (TypeScript) – Nuxt’s server/ directory auto-exposes API endpoints via file conventions
• Shared utilities in lib/utils.ts
• Tailwind config and ESLint config for styling and linting
Key Architectural Components
a. Frontend Layer (Nuxt 3)
• Pages & Views (pages/)
• UI Components (components/ui)
• Layouts (layouts/AdminLayout.vue)
• Assets & Static Content (assets/, public/)
• Unity WebGL embed (likely loaded in a page via <iframe> or custom component)
b. Kinect Motion-Capture Service
• External hardware client that streams raw skeletal/motion data to the back end
c. Motion-Analysis Engine (Node.js/Express)
• Server/API (server/ folder)
• Implements Laban analysis (via HumanMotionAnalysis lib)
• Exposes REST or WebSocket endpoints for real-time feedback
d. Database Layer
• Stores users, roles, courses, progress, analysis results (could be PostgreSQL, MongoDB, etc.)
Relationships and Data Flows
1. User’s browser loads the Nuxt3 app.
2. Unity WebGL module is initialized inside the front end for 3D visualization.
3. Kinect device streams motion data to the Node.js back end (via WebSocket or REST).
4. Back end performs Laban analysis and persists raw data + analysis results in the DB.
5. Back end pushes analysis results back to the front end (via WebSocket or HTTP).
6. Front end updates Unity WebGL visualization in real time and updates UI components (scores, guidance).
7. Admin users access pages under /admin to manage courses, users, and view learning history via HTTP calls to the back end.
Architectural Patterns and Principles
• Separation of Concerns: UI vs. business logic vs. data persistence
• Modular UI: shadcn/vue component library under components/ui
• API-First: server/ auto‐exposes endpoints; front end consumes these exclusively
• Real-Time Feedback Loop: Kinect → Back end → Front end → Unity WebGL
Technologies & Frameworks
• Front end: Vue 3, Nuxt 3, Tailwind CSS, shadcn/vue, TypeScript
• 3D Rendering: Unity WebGL build served from public/ or assets/
• Motion Capture: Kinect SDK (external)
• Back end: Node.js, Express, TypeScript, Nuxt server middleware
• Persistence: (configure in server code; e.g., PostgreSQL/MongoDB)
• Build/Dev: pnpm, ESLint, Tailwind, Nuxt CLI