# rojo-rbx/rojo architecture

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

- Interactive diagram: https://gitdiagram.com/rojo-rbx/rojo
- Repository: https://github.com/rojo-rbx/rojo

## Overview

Rojo maps filesystem projects into Roblox instance trees, then supports CLI builds/deployment, live Studio synchronization, and importing Studio changes back to files. The main live path is project/filesystem input → snapshot middleware → snapshot diff/application → served tree and client updates. CLI commands, web/API handling, and syncback are distinct product branches. Relationships reflect the excerpts, source index, or README; unsampled command and integration internals are not inferred.

Main entry points: [`src/snapshot_middleware`](https://github.com/rojo-rbx/rojo/tree/master/src/snapshot_middleware) (Filesystem middleware), [`src/cli/mod.rs`](https://github.com/rojo-rbx/rojo/blob/master/src/cli/mod.rs) (CLI commands), [`src/syncback/mod.rs`](https://github.com/rojo-rbx/rojo/blob/master/src/syncback/mod.rs) (Syncback reconciliation), [`src/web/mod.rs`](https://github.com/rojo-rbx/rojo/blob/master/src/web/mod.rs) (Web server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_cli_commands["CLI commands<br/>[mod.rs]"]
  node_build["Build<br/>[build.rs]"]
  node_upload["Deploy upload<br/>[upload.rs]"]
  node_sourcemap["Sourcemap<br/>[sourcemap.rs]"]
  node_syncback_cli["Syncback command<br/>[syncback.rs]"]
end

subgraph group_project["Project modeling"]
  node_project_config["Project configuration<br/>[project.rs]"]
  node_resolution["Path resolution<br/>[resolution.rs]"]
  node_lua_ast["Lua parsing<br/>[lua_ast.rs]"]
  node_json["JSON handling<br/>[json.rs]"]
  node_path_serializer["Path serialization<br/>[path_serializer.rs]"]
end

subgraph group_live["Live sync"]
  node_change_processor["Change processor"]
  node_serve_session["Serve session<br/>[serve_session.rs]"]
  node_filesystem_middleware["Filesystem middleware"]
  node_project_middleware["Project middleware<br/>[project.rs]"]
  node_lua_middleware["Lua middleware<br/>[lua.rs]"]
  node_csv_middleware["CSV middleware<br/>[csv.rs]"]
  node_metadata_middleware["Metadata middleware<br/>[meta_file.rs]"]
  node_snapshot["Instance snapshots<br/>[mod.rs]"]
  node_patch_compute["Patch computation<br/>[patch_compute.rs]"]
  node_patch_apply["Patch application<br/>[patch_apply.rs]"]
  node_tree["Instance tree<br/>[tree.rs]"]
  node_message_queue["Patch notifications<br/>[message_queue.rs]"]
  node_multimap["MultiMap utility<br/>[multimap.rs]"]
end

subgraph group_syncback["Syncback"]
  node_syncback["Syncback reconciliation<br/>[mod.rs]"]
  node_syncback_snapshot["Syncback snapshots<br/>[snapshot.rs]"]
  node_property_filter["Property filtering<br/>[property_filter.rs]"]
end

subgraph group_web["Web interface"]
  node_web_server["Web server<br/>[mod.rs]"]
  node_web_api["Studio API<br/>[api.rs]"]
  node_web_origin["Origin validation<br/>[origin.rs]"]
  node_web_ui["Web UI<br/>[ui.rs]"]
  node_web_interface["Web interface<br/>[interface.rs]"]
end

node_developer(("Developer"))
node_studio(("Roblox Studio"))
node_filesystem[("Project files")]

node_developer -->|"edits"| node_filesystem
node_filesystem -->|"provides files"| node_filesystem_middleware
node_developer -->|"runs commands"| node_cli_commands
node_cli_commands -->|"dispatches"| node_build
node_cli_commands -->|"dispatches"| node_upload
node_cli_commands -->|"dispatches"| node_sourcemap
node_cli_commands -->|"dispatches"| node_syncback_cli
node_filesystem_middleware -->|"creates snapshots"| node_snapshot
node_snapshot -->|"diffs snapshots"| node_patch_compute
node_patch_compute -->|"produces patch sets"| node_patch_apply
node_patch_apply -->|"updates tree"| node_tree
node_serve_session -->|"starts processor"| node_change_processor
node_serve_session -->|"owns tree"| node_tree
node_serve_session -->|"exposes queue"| node_message_queue
node_change_processor -.->|"watches changes"| node_filesystem_middleware
node_studio -->|"connects for live sync"| node_web_server
node_web_server -->|"validates requests"| node_web_origin
node_web_server -->|"routes API requests"| node_web_api
node_web_server -->|"routes UI requests"| node_web_ui
node_web_api -.->|"uses session"| node_serve_session
node_developer -->|"pulls Instances"| node_syncback_cli
node_syncback_cli -.->|"runs reconciliation"| node_syncback
node_syncback -->|"creates snapshots"| node_syncback_snapshot
node_syncback -->|"filters properties"| node_property_filter
node_studio -->|"provides edited Instances"| node_syncback
node_project_middleware -.->|"implements format"| node_filesystem_middleware
node_lua_middleware -.->|"implements format"| node_filesystem_middleware
node_csv_middleware -.->|"implements format"| node_filesystem_middleware
node_metadata_middleware -.->|"implements format"| node_filesystem_middleware
node_syncback -->|"writes files"| node_studio
node_sourcemap -->|"serializes paths"| node_path_serializer
node_resolution -->|"parses JSON"| node_json
node_patch_apply -->|"uses mappings"| node_multimap

click node_cli_commands "https://github.com/rojo-rbx/rojo/blob/master/src/cli/mod.rs"
click node_build "https://github.com/rojo-rbx/rojo/blob/master/src/cli/build.rs"
click node_upload "https://github.com/rojo-rbx/rojo/blob/master/src/cli/upload.rs"
click node_sourcemap "https://github.com/rojo-rbx/rojo/blob/master/src/cli/sourcemap.rs"
click node_syncback_cli "https://github.com/rojo-rbx/rojo/blob/master/src/cli/syncback.rs"
click node_project_config "https://github.com/rojo-rbx/rojo/blob/master/src/project.rs"
click node_resolution "https://github.com/rojo-rbx/rojo/blob/master/src/resolution.rs"
click node_lua_ast "https://github.com/rojo-rbx/rojo/blob/master/src/lua_ast.rs"
click node_change_processor "https://github.com/rojo-rbx/rojo/blob/master/src/change_processor.rs"
click node_serve_session "https://github.com/rojo-rbx/rojo/blob/master/src/serve_session.rs"
click node_filesystem_middleware "https://github.com/rojo-rbx/rojo/tree/master/src/snapshot_middleware"
click node_project_middleware "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/project.rs"
click node_lua_middleware "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/lua.rs"
click node_csv_middleware "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/csv.rs"
click node_metadata_middleware "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/meta_file.rs"
click node_snapshot "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/mod.rs"
click node_patch_compute "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/patch_compute.rs"
click node_patch_apply "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/patch_apply.rs"
click node_tree "https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/tree.rs"
click node_message_queue "https://github.com/rojo-rbx/rojo/blob/master/src/message_queue.rs"
click node_syncback "https://github.com/rojo-rbx/rojo/blob/master/src/syncback/mod.rs"
click node_syncback_snapshot "https://github.com/rojo-rbx/rojo/blob/master/src/syncback/snapshot.rs"
click node_property_filter "https://github.com/rojo-rbx/rojo/blob/master/src/syncback/property_filter.rs"
click node_web_server "https://github.com/rojo-rbx/rojo/blob/master/src/web/mod.rs"
click node_web_api "https://github.com/rojo-rbx/rojo/blob/master/src/web/api.rs"
click node_web_origin "https://github.com/rojo-rbx/rojo/blob/master/src/web/origin.rs"
click node_web_ui "https://github.com/rojo-rbx/rojo/blob/master/src/web/ui.rs"
click node_web_interface "https://github.com/rojo-rbx/rojo/blob/master/src/web/interface.rs"
click node_json "https://github.com/rojo-rbx/rojo/blob/master/src/json.rs"
click node_multimap "https://github.com/rojo-rbx/rojo/blob/master/src/multimap.rs"
click node_path_serializer "https://github.com/rojo-rbx/rojo/blob/master/src/path_serializer.rs"

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_cli_commands,node_build,node_upload,node_sourcemap,node_syncback_cli toneBlue
class node_project_config,node_resolution,node_lua_ast,node_json,node_path_serializer,node_filesystem toneAmber
class node_change_processor,node_serve_session,node_filesystem_middleware,node_project_middleware,node_lua_middleware,node_csv_middleware,node_metadata_middleware,node_snapshot,node_patch_compute,node_patch_apply,node_tree,node_message_queue,node_multimap toneMint
class node_syncback,node_syncback_snapshot,node_property_filter toneRose
class node_web_server,node_web_api,node_web_origin,node_web_ui,node_web_interface,node_developer,node_studio toneIndigo
```

## Components

### CLI workflows

- [CLI commands](https://github.com/rojo-rbx/rojo/blob/master/src/cli/mod.rs): `src/cli/mod.rs`
- [Build](https://github.com/rojo-rbx/rojo/blob/master/src/cli/build.rs): `src/cli/build.rs`
- [Deploy upload](https://github.com/rojo-rbx/rojo/blob/master/src/cli/upload.rs): `src/cli/upload.rs`
- [Sourcemap](https://github.com/rojo-rbx/rojo/blob/master/src/cli/sourcemap.rs): `src/cli/sourcemap.rs`
- [Syncback command](https://github.com/rojo-rbx/rojo/blob/master/src/cli/syncback.rs): `src/cli/syncback.rs`

### Project modeling

- [Project configuration](https://github.com/rojo-rbx/rojo/blob/master/src/project.rs): `src/project.rs`
- [Path resolution](https://github.com/rojo-rbx/rojo/blob/master/src/resolution.rs): `src/resolution.rs`
- [Lua parsing](https://github.com/rojo-rbx/rojo/blob/master/src/lua_ast.rs): `src/lua_ast.rs`
- [JSON handling](https://github.com/rojo-rbx/rojo/blob/master/src/json.rs): `src/json.rs`
- [Path serialization](https://github.com/rojo-rbx/rojo/blob/master/src/path_serializer.rs): `src/path_serializer.rs`

### Live sync

- [Change processor](https://github.com/rojo-rbx/rojo/blob/master/src/change_processor.rs): `src/change_processor.rs`
- [Serve session](https://github.com/rojo-rbx/rojo/blob/master/src/serve_session.rs): `src/serve_session.rs`
- [Filesystem middleware](https://github.com/rojo-rbx/rojo/tree/master/src/snapshot_middleware): `src/snapshot_middleware`
- [Project middleware](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/project.rs): `src/snapshot_middleware/project.rs`
- [Lua middleware](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/lua.rs): `src/snapshot_middleware/lua.rs`
- [CSV middleware](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/csv.rs): `src/snapshot_middleware/csv.rs`
- [Metadata middleware](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot_middleware/meta_file.rs): `src/snapshot_middleware/meta_file.rs`
- [Instance snapshots](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/mod.rs): `src/snapshot/mod.rs`
- [Patch computation](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/patch_compute.rs): `src/snapshot/patch_compute.rs`
- [Patch application](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/patch_apply.rs): `src/snapshot/patch_apply.rs`
- [Instance tree](https://github.com/rojo-rbx/rojo/blob/master/src/snapshot/tree.rs): `src/snapshot/tree.rs`
- [Patch notifications](https://github.com/rojo-rbx/rojo/blob/master/src/message_queue.rs): `src/message_queue.rs`
- [MultiMap utility](https://github.com/rojo-rbx/rojo/blob/master/src/multimap.rs): `src/multimap.rs`

### Syncback

- [Syncback reconciliation](https://github.com/rojo-rbx/rojo/blob/master/src/syncback/mod.rs): `src/syncback/mod.rs`
- [Syncback snapshots](https://github.com/rojo-rbx/rojo/blob/master/src/syncback/snapshot.rs): `src/syncback/snapshot.rs`
- [Property filtering](https://github.com/rojo-rbx/rojo/blob/master/src/syncback/property_filter.rs): `src/syncback/property_filter.rs`

### Web interface

- [Web server](https://github.com/rojo-rbx/rojo/blob/master/src/web/mod.rs): `src/web/mod.rs`
- [Studio API](https://github.com/rojo-rbx/rojo/blob/master/src/web/api.rs): `src/web/api.rs`
- [Origin validation](https://github.com/rojo-rbx/rojo/blob/master/src/web/origin.rs): `src/web/origin.rs`
- [Web UI](https://github.com/rojo-rbx/rojo/blob/master/src/web/ui.rs): `src/web/ui.rs`
- [Web interface](https://github.com/rojo-rbx/rojo/blob/master/src/web/interface.rs): `src/web/interface.rs`

### Other components

- **Developer**
- **Roblox Studio**
- **Project files**

## Connections

- Developer → Project files: edits (evidence: `README.md`)
- Project files → Filesystem middleware: provides files (evidence: `README.md`)
- Developer → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Build: dispatches (evidence: `src/cli/mod.rs`)
- CLI commands → Deploy upload: dispatches (evidence: `src/cli/mod.rs`)
- CLI commands → Sourcemap: dispatches (evidence: `src/cli/mod.rs`)
- CLI commands → Syncback command: dispatches (evidence: `src/cli/mod.rs`)
- Filesystem middleware → Instance snapshots: creates snapshots (evidence: `src/snapshot/mod.rs`)
- Instance snapshots → Patch computation: diffs snapshots (evidence: `src/snapshot/mod.rs`)
- Patch computation → Patch application: produces patch sets (evidence: `src/snapshot/mod.rs`)
- Patch application → Instance tree: updates tree (evidence: `src/snapshot/mod.rs`)
- Serve session → Change processor: starts processor (evidence: `src/serve_session.rs`)
- Serve session → Instance tree: owns tree (evidence: `src/serve_session.rs`)
- Serve session → Patch notifications: exposes queue (evidence: `src/serve_session.rs`)
- Change processor → Filesystem middleware: watches changes
- Roblox Studio → Web server: connects for live sync (evidence: `README.md`)
- Web server → Origin validation: validates requests (evidence: `src/web/mod.rs`)
- Web server → Studio API: routes API requests (evidence: `src/web/mod.rs`)
- Web server → Web UI: routes UI requests (evidence: `src/web/mod.rs`)
- Studio API → Serve session: uses session
- Developer → Syncback command: pulls Instances (evidence: `README.md`)
- Syncback command → Syncback reconciliation: runs reconciliation
- Syncback reconciliation → Syncback snapshots: creates snapshots (evidence: `src/syncback/mod.rs`)
- Syncback reconciliation → Property filtering: filters properties (evidence: `src/syncback/mod.rs`)
- Roblox Studio → Syncback reconciliation: provides edited Instances (evidence: `README.md`)
- Project middleware → Filesystem middleware: implements format (evidence: `src/snapshot_middleware/mod.rs`)
- Lua middleware → Filesystem middleware: implements format (evidence: `src/snapshot_middleware/mod.rs`)
- CSV middleware → Filesystem middleware: implements format (evidence: `src/snapshot_middleware/mod.rs`)
- Metadata middleware → Filesystem middleware: implements format (evidence: `src/snapshot_middleware/mod.rs`)
- Syncback reconciliation → Roblox Studio: writes files (evidence: `README.md`)
- Sourcemap → Path serialization: serializes paths (evidence: `src/cli/sourcemap.rs`)
- Path resolution → JSON handling: parses JSON (evidence: `src/resolution.rs`)
- Patch application → MultiMap utility: uses mappings (evidence: `src/snapshot/patch_apply.rs`)
