# lalosslazsulin-hub/neolight architecture

> Architecture diagram of the GitHub repository lalosslazsulin-hub/neolight, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lalosslazsulin-hub/neolight
- Repository: https://github.com/lalosslazsulin-hub/neolight

## Overview

NeoLight is a Scratch project player and compiler, with project packaging and documented addon and personalization features. The main browser workflow uploads an SB3, extracts its project data and costume images, compiles Scratch blocks into JavaScript, then repeatedly renders targets to the stage. A separate script packages an SB3 through TurboWarp; a Python utility downloads shared Scratch projects and assets. The README also names addon and customization capabilities, but their implementation is not present in the sampled source, so those links are limited to documented claims.

Main entry points: [`neolight-bridge.js`](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-bridge.js) (SB3 loader), [`neolight-renderer.js`](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-renderer.js) (Stage renderer), [`Neolightweb.html`](https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html) (NeoLight interface), [`neolight-vm.js`](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-vm.js) (Compiler and VM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser runtime"]
  node_web_ui["NeoLight interface<br/>[Neolightweb.html]"]
  node_bridge["SB3 loader<br/>[neolight-bridge.js]"]
  node_archive["SB3 archive"]
  node_project_json["Project data"]
  node_renderer["Stage renderer"]
  node_vm["Compiler and VM<br/>[neolight-vm.js]"]
  node_assets[("Costume cache")]
  node_stage["Canvas stage<br/>[neolight-bridge.js]"]
end

subgraph group_authoring["Project tools"]
  node_packaging_script["Standalone compiler<br/>[compile.js]"]
  node_packager["TurboWarp packager"]
  node_fetcher["Project downloader<br/>[fetch_project.py]"]
end

subgraph group_personalization["Customization"]
  node_addon_menu["Addon menu<br/>[Neolightweb.html]"]
  node_settings["Customization settings<br/>[Neolightweb.html]"]
  node_personalize["Theme personalization<br/>[Neolightweb.html]"]
end

node_user(("Project user"))
node_scratch["Scratch project service"]

node_user -.->|"uses"| node_web_ui
node_web_ui -.->|"hosts"| node_bridge
node_user -->|"uploads SB3"| node_bridge
node_bridge -->|"opens"| node_archive
node_bridge -->|"parses"| node_project_json
node_bridge -->|"registers images"| node_assets
node_bridge -->|"loads and starts"| node_vm
node_vm -->|"draws targets"| node_renderer
node_renderer -->|"reads costumes"| node_assets
node_renderer -->|"draws"| node_stage
node_packaging_script -->|"packages project"| node_packager
node_fetcher -->|"downloads project and assets"| node_scratch
node_user -.->|"requests project"| node_fetcher
node_user -.->|"manages addons"| node_addon_menu
node_user -.->|"customizes"| node_settings
node_user -.->|"personalizes theme"| node_personalize
node_addon_menu -->|"uses exposed runtime"| node_bridge

click node_web_ui "https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html"
click node_bridge "https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-bridge.js"
click node_renderer "https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-renderer.js"
click node_vm "https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-vm.js"
click node_assets "https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-renderer.js"
click node_stage "https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-bridge.js"
click node_packaging_script "https://github.com/lalosslazsulin-hub/neolight/blob/main/compile.js"
click node_fetcher "https://github.com/lalosslazsulin-hub/neolight/blob/main/fetch_project.py"
click node_addon_menu "https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html"
click node_settings "https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html"
click node_personalize "https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_ui,node_bridge,node_archive,node_project_json,node_renderer,node_vm,node_assets,node_stage,node_user toneBlue
class node_packaging_script,node_packager,node_fetcher toneAmber
class node_addon_menu,node_settings,node_personalize toneMint
class node_scratch toneIndigo
```

## Components

### Browser runtime

- [NeoLight interface](https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html): `Neolightweb.html`
- [SB3 loader](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-bridge.js): `neolight-bridge.js`
- **SB3 archive**
- **Project data**
- [Stage renderer](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-renderer.js): `neolight-renderer.js`
- [Compiler and VM](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-vm.js): `neolight-vm.js`
- [Costume cache](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-renderer.js): `neolight-renderer.js`
- [Canvas stage](https://github.com/lalosslazsulin-hub/neolight/blob/main/neolight-bridge.js): `neolight-bridge.js`

### Project tools

- [Standalone compiler](https://github.com/lalosslazsulin-hub/neolight/blob/main/compile.js): `compile.js`
- **TurboWarp packager**
- [Project downloader](https://github.com/lalosslazsulin-hub/neolight/blob/main/fetch_project.py): `fetch_project.py`

### Customization

- [Addon menu](https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html): `Neolightweb.html`
- [Customization settings](https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html): `Neolightweb.html`
- [Theme personalization](https://github.com/lalosslazsulin-hub/neolight/blob/main/Neolightweb.html): `Neolightweb.html`

### Other components

- **Project user**
- **Scratch project service**

## Connections

- Project user → NeoLight interface: uses (evidence: `README.md`)
- NeoLight interface → SB3 loader: hosts (evidence: `neolight-bridge.js`)
- Project user → SB3 loader: uploads SB3 (evidence: `neolight-bridge.js`)
- SB3 loader → SB3 archive: opens (evidence: `neolight-bridge.js`)
- SB3 loader → Project data: parses (evidence: `neolight-bridge.js`)
- SB3 loader → Costume cache: registers images (evidence: `neolight-bridge.js`)
- SB3 loader → Compiler and VM: loads and starts (evidence: `neolight-bridge.js`)
- Compiler and VM → Stage renderer: draws targets (evidence: `neolight-vm.js`)
- Stage renderer → Costume cache: reads costumes (evidence: `neolight-renderer.js`)
- Stage renderer → Canvas stage: draws (evidence: `neolight-renderer.js`)
- Standalone compiler → TurboWarp packager: packages project (evidence: `compile.js`)
- Project downloader → Scratch project service: downloads project and assets (evidence: `fetch_project.py`)
- Project user → Project downloader: requests project (evidence: `README.md`)
- Project user → Addon menu: manages addons (evidence: `README.md`)
- Project user → Customization settings: customizes (evidence: `README.md`)
- Project user → Theme personalization: personalizes theme (evidence: `README.md`)
- Addon menu → SB3 loader: uses exposed runtime (evidence: `neolight-bridge.js`)
