How cadje/radical-canvatorium works
Project Type and Purpose
• The project is an experimental design lab for spatial computing. It leverages Nuxt and VueJS for the frontend and integrates BabylonJS to power 3D scenes for both “Labs” (which are intended for VR/AR and spatial computing experiments) and “Benches” (simple 3D concept explorations).
• The README and file layout indicate a focus on immersive 3D environments with distinct experiences (Labs vs. Benches). WebXR support with self-signed certs suggests real-time, interactive VR/AR deployment.
Breakdown of the File Structure
• Frontend Framework & Configuration: Key files such as app.vue, nuxt.config.ts, and pages/* directories indicate the use of Nuxt/Vue.
• Views/Pages:
• The “pages/benches” directory holds several components (bench000.vue through bench005.vue, benchTemplate.vue) representing standalone 3D demonstrations not requiring VR/AR.
• The “pages/labs” directory contains many lab components (lab000.vue to lab057.vue, plus index.vue) that are designed to explore concepts in spatial computing and immersive environments.
• The “pages/sidequests” directory suggests additional experimental or auxiliary features.
• Scene and 3D Engine Integration:
• The inclusion of BabylonJS-specific instructions in the README (and installation commands for BabylonJS packages) in conjunction with Vue components indicates that these pages integrate BabylonJS scenes.
• The “composables/useCanvatoriumScene.ts” file likely encapsulates reusable logic for initializing or controlling BabylonJS scenes across various pages.
• Assets and Data:
• The “assets” and “public/assets” directories contain fonts, 3D models (e.g., GLB files), images, and maps which are used for visual styling and 3D content.
• The “data” directory includes JSON files that might feed content or configuration data into the scenes.
• Utility and Helper Scripts:
• The “utils” directory contains helper scripts (like svg-helpers.js, lab-theme.ts) for potentially styling the labs or handling SVG and theme generation.
• Development, Build, and Deployment:
• Configuration files (nuxt.config.ts, tsconfig.json, package.json) and scripts within package.json demonstrate how the project is built, run, and configured for development deployments (including HTTPS for WebXR).
a. Components to Identify:
• Frontend/UI Layer: Represented by Nuxt/Vue files (app.vue, pages, layouts). This is the user’s entry point and contains route-based components for labs and benches.
• 3D Engine Integration: Include a dedicated component (or module) for BabylonJS. Represent the composable (useCanvatoriumScene.ts) that encapsulates scene logic and interactions.
• Data Layer: A node for JSON data from the “data” directory that feeds configuration or assets metadata into the 3D scenes.
• Assets/Resources: Create nodes for assets including fonts, images, maps, and GLB 3D models found in “assets” and “public/assets”.
• Utilities/Helpers: A smaller component to encompass modules in “utils” and “composables” that assist with theming and enhanced functionality.
• External Service Integration: Optionally include the integration with WebXR and the corresponding HTTPS setup to enable VR/AR features (highlighted in the README), as well as any external libraries like BabylonJS.
b. Relationships and Data Flow:
• Link the Data Layer to the UI and 3D Engine to show that JSON configurations or demo setups are fed into the scene logic.
• Assets to both the UI and 3D engine, as visual resources (e.g., fonts, maps, 3D models) are utilized during rendering.
• Configuration and utility modules as supporting services that interact with both the UI and 3D components.
c. Architectural Patterns & Design Principles:
• Separation of concerns where UI rendering (via Nuxt/Vue) is kept separate from the 3D graphics logic (via BabylonJS through composables).
• That the application leverages modular, component-based design, with clearly separated directories for labs, benches, and utilities.
• Use of standard patterns provided by Nuxt such as page-based routing combined with composable functions for reusable logic.
d. Technologies & Frameworks:
• Nuxt and VueJS manage the view layer, with files in “pages”, “layouts”, and app.vue.
• BabylonJS is the engine powering 3D scenes (labs and benches), as installed via npm and referenced in the README.
• Supporting styling and data files from “assets”, “public/assets”, and “data”.
• Tools such as mkcert for HTTPS certificate generation are used to enable secure WebXR development.