How playcanvas/supersplat works
Project Type and Purpose
Project Type:
SuperSplat is a web-based full-stack application designed for creating, editing, optimizing, and publishing 3D Gaussian Splats. It leverages modern web technologies to provide a seamless experience directly in the browser, eliminating the need for downloads or installations.
Purpose:
The tool serves artists and developers working with 3D splat data, offering functionalities such as inspection, editing, optimization, and publishing of 3D Gaussian Splats. Its real-time capabilities and browser-based deployment make it accessible and efficient for collaborative and individual workflows.
Top-Level Directories and Files
• .github: Contains GitHub workflows for continuous integration (ci.yml).
• docs: Documentation files, including index.md.
• src: Core source code of the application.
• anim, shaders, serialize, tools, ui: Subdirectories indicating modular architecture.
• index.html, main.ts, index.ts, etc.: Entry points and main application files.
• Configuration Files: package.json, rollup.config.mjs, tsconfig.json, eslint.config.mjs, etc., indicating a robust build and development setup.
Architectural Patterns
• Modular Architecture: Subdirectories within src (e.g., anim, shaders, tools, ui) suggest a component-based structure, promoting reusability and maintainability.
• Service Workers: Presence of src/sw.ts indicates the use of service workers for offline capabilities and caching.
• Build and Deployment: Use of Rollup (rollup.config.mjs) for bundling, ESLint for linting, and GitHub Actions for CI/CD.
README for Additional Insights
The README highlights that SuperSplat is built with web technologies and runs entirely in the browser. It outlines the setup for local development using Node.js and includes instructions for live-reloading during development. The absence of backend-specific instructions suggests that the application is primarily frontend-focused, possibly utilizing serverless functions or relying entirely on client-side processing.
a. Main Components of the System
• Frontend Application:
• UI Module: Manages user interfaces such as toolbars, panels, dialogs (src/ui).
• Core Functionality Modules: Handle animations (src/anim), shaders (src/shaders), serialization (src/serialize), tools (src/tools), and more.
• Build Tools:
• Rollup: Bundles JavaScript and TypeScript files.
• ESLint & Prettier: Enforce code quality and formatting.
• Service Worker: Manages caching and offline capabilities (src/sw.ts).
• Continuous Integration:
• GitHub Workflows: Automates testing and deployment (.github/workflows/ci.yml).
b. Relationships and Interactions Between Components
• UI Module interacts with Core Functionality Modules to reflect user actions and updates.
• Core Functionality Modules communicate with Shaders for rendering and Serialization for data handling.
• Service Worker intercepts network requests to cache assets and provide offline support.
• Build Tools process and bundle code from src and manage dependencies from static/lib.
• CI Workflows automate testing and deployment processes upon code commits.
c. Architectural Patterns or Design Principles
• Component-Based Architecture: Facilitates separation of concerns and modularity.
• Single Page Application (SPA): Ensures seamless user experience without full page reloads.
• Progressive Web App (PWA): Utilizes service workers for offline functionality and improved performance.
• TypeScript Usage: Enhances code reliability and maintainability through static typing.
d. Relevant Technologies, Frameworks, or Libraries
• Languages and Frameworks: TypeScript, JavaScript, HTML, CSS.
• Build Tools: Rollup, ESLint, Prettier.
• Libraries: WebGL for rendering shaders, various UI libraries within src/ui.
• Service Workers: For caching and offline capabilities.
• Version Control and CI: GitHub Actions for continuous integration.
Frontend Layer
• UI Components
• Toolbar
• Panels
• Dialogs
• Core Functionality
• Animation Module
• Shader Management
• Tools (e.g., Brush, Lasso, Move)
• Serialization and Data Processing
Infrastructure Layer
• Build Tools
• Rollup Bundler
• ESLint and Prettier
• Service Workers
• Caching Strategy
• Offline Support
Asset Management
• Static Assets
• Third-Party Libraries
Continuous Integration
• GitHub Workflows
• CI Pipelines
• Automated Testing
Deployment
• Live Application
• Hosting Details (e.g., GitHub Pages, Netlify)