How try-supernova/supernova works
Project Type and Purpose
• The README and file tree show that Supernova is a Web OS (similar in spirit to Windows93/96) that boots as an offline, static web application.
• It has multiple subcomponents including the OS kernel (in /src), runtime components (the “41worker” under /src/41worker, which handles program execution in isolated workers), installer systems (various executables under /executables/installer and /executables/root), and the Tauri setup (in /src-tauri) that packages the app as a desktop application.
• Build scripts (in /scripts) and public static assets (in /public) support the build and delivery pipeline.
Analyzing the File Structure
• /src: Contains the core OS kernel. It includes directories for modules like:
• 41worker: Directly responsible for runtime process management, creating a sandboxed environment for Supernova applications.
• Assembly, FS, Startup (background processes, boot tasks, installer tasks), and utility modules.
• /executables: Contains different installer and runtime executable bundles that get built into zip files (installer.zip and rootfs.zip). These represent the packaged and deployable modules of the system.
• /public: Hosts static files (e.g., index.html, manifest.json, legal info) used by the static web version.
• /scripts: Build and pre-/post-build scripts that automate tasks such as cleaning, serving, and other custom build tasks.
• /src-tauri: Contains Rust code with Tauri configuration (Cargo.toml, build.rs, main.rs) that is used to generate the native desktop application.
• Configuration and environment files (.env.example, .gitignore, etc.) that manage linting, hot commit hooks, and overall project constraints.
Main Components
a. OS Kernel (Core of Supernova)
• Module: /src (including its subdivisions for runtime components, OS bootstrapping, FS management, and utilities).
• Submodules: “41worker” (responsible for program runtime), “Assembly” (handling low-level tasks), “Startup” (boot, background, installer setup).
b. Installers and Bundling System
• Components under /executables/installer and /executables/root.
• Packaging process that bundles these into zip files (installer.zip, rootfs.zip).
c. Build and Deployment Pipeline
• Build scripts under /scripts (prebuild and postbuild) and the build process in /src/build.
• How these scripts compile, bundle, and move assets to the /dist folder.
d. Public Static Assets
• /public directory representing the UI entry point (e.g., index.html, manifest, vendor.js) used to serve the Web OS.
e. Desktop Application Layer via Tauri
• /src-tauri serving as the connection between the web OS and native desktop features using Tauri (via Rust code).
Relationships and Interactions Between Components
• The OS kernel (from /src) is the heart of Supernova. It interacts closely with the 41worker runtime module for executing individual applications.
• The startup scripts (under /src/startup) ensure proper initialization by booting components like the GUI and background services.
• The installer and runtime executables (in /executables) are built separately from the core kernel; they are later zipped and used for installation or runtime provisioning.
• The build pipeline (using scripts and modules under /src/build) collects various aspects of the codebase and outputs a ready–to–run build into the /dist folder.
• The Tauri module ties the web OS with desktop capabilities by wrapping the static build in a native application shell.
• Static assets in /public serve the UI over HTTP (locally or on cloud deployments such as Cloudflare Pages as mentioned in the README).
Highlighting Architectural Patterns and Design Principles
• Modularization: The system is divided into distinct modules (OS kernel, runtime, installer, build scripts) to encourage separation of concerns.
• Build-Time Environment Differentiation: The use of NODE_ENV to toggle features (like devtools detection and obfuscation) illustrates environment-based compilation strategies.
• Isolation and Security: The use of Web Workers ("41worker") for running applications reflects an emphasis on process isolation to enhance security and performance.
• Multi-Platform Packaging: The Tauri (Rust) integration under /src-tauri adds an abstraction layer, supporting both web and desktop delivery models.