Synapse Framework
Themes Plugins Docs Home Github
Github - Releases Join Discord

Synapse Framework — Project Overview

Reference map for contributors and agents working in this repository.

What this project is

Synapse Framework is a Windows-focused Tauri 2 desktop app that recreates and extends classic Synapse executor UIs. It provides:

  • A Luau script editor (Monaco)
  • Script Hub (ScriptBlox catalog + legacy embedded scripts)
  • Console (F9 logs from executor)
  • A local executor bridge on 127.0.0.1:31337 with three HTTP methods — Port (Fastest), Stream, and Compat — each with a Lua client and Rust queue. See EXECUTOR_BRIDGE.md.
  • An extensible plugin system (JS modules, overlays, bridge providers). See PLUGINS.md.
  • Four UI shells selectable via settings (uiMode)

This is not a web backend, monorepo, or authenticated SaaS. Persistence uses localStorage, IndexedDB, and Tauri filesystem JSON — there is no SQL/ORM.

flowchart TB
  subgraph desktop [Synapse Framework]
    React["React/Vite src/"]
    Rust["Rust src-tauri/"]
    Axum["Axum bridge :31337"]
  end
  Executor["Executor Luau client (Port / Stream / Compat)"] <-->|HTTP :31337| Axum
  React <-->|Tauri IPC invoke| Rust
  Rust --> Axum
  ScriptBlox["scriptblox.com"] -->|dev proxy /scriptblox-api path| React

Repository layout

PathRole
src/Production frontend — React 18, React Router 7, Monaco, Tailwind 4
src-tauri/Native shell — Tauri 2, IPC commands, Axum bridge
dist/Vite build output → Tauri frontendDist
public/Static Lua samples, fonts
scripts/Dev helpers (run-vite.mjs, port cleanup, Monaco CSS gen)
docs/Project documentation
logo presets/Optional top-bar logo PNGs (runtime glob in src/ui/topBarLogos.ts)

Not in repo (as of this doc): root tsconfig.json, ESLint/Prettier config, .env files, CI workflows, Docker, automated tests.

Tech stack

LayerStack
FrontendTypeScript, React 18.3, Vite 6.3, React Router 7.13, Tailwind 4, Radix/shadcn UI, Motion, Zustand (minimal), Monaco + luaparse
DesktopTauri 2.10 (core invoke, dialog/fs plugins)
BackendRust 2021 — Axum 0.7 HTTP server, Tokio, serde, winreg, arboard
Package mgrnpm (package-lock.json)
Ship targetWindows MSI via WiX (src-tauri/wix/main.wxs)

Entry points and boot flow

Frontend bootstrap — src/main.tsx

  1. Tauri detection → adds synapse-tauri class, sets window background from theme
  2. Normalizes /index.html/ (Tauri asset protocol quirk)
  3. applyAlternateShellBootPathFromSettings() — sync redirect to /synapse-original/*, /synapse-x/*, or /synapse-v3/* before React paints
  4. Persists app_settings_snapshot.json via persist_app_settings_snapshot for Rust cold-start routing
  5. Global contextmenu suppression (except Monaco, Radix menus)
  6. Renders src/app/App.tsx

Routing — src/app/routes.tsx

Route prefixShellPages
/Default “Synapse Blue”editor, script-hub, console, settings, themes, integrated-webpage
/synapse-original/*Synapse 2017loading, main, script-hub, settings, console
/synapse-x/*Synapse X (UI replica)same
/synapse-v3/mainSynapse V3main (editor-focused)
/dialog/*Small confirmation webviewsclear tab, close all, etc.

altShellBootRedirectLoader catches edge cases where persisted uiMode does not match the URL.

Rust bootstrap — src-tauri/src/main.rslib.rs

  • Reads app_settings_snapshot.json before webview paint to open the correct initial window route
  • Spawns the Axum server on 127.0.0.1:31337 — Port (/port_bridge/*), Stream (/stream_bridge/*), Compat (/compat_bridge/*), script downloads, and per-method liveness watchdogs
  • Registers all Tauri IPC commands

Tauri IPC commands

CommandPurpose
persist_app_settings_snapshotCold-start routing snapshot
persist_window_icon_presetTaskbar icon preset
read_text_file_abs / write_text_file_absAbsolute-path file I/O
reveal_in_file_manager / open_scripts_folderExplorer integration
list_sidebar_scriptsList .lua in scripts dir
open_external_urlBrowser (http(s) / file:// only)
write_clipboard_textClipboard
bridge_status / bridge_send_executeExecutor attach + run script
is_v3_enabledReads v3.ini beside exe (frontend useV3Enabled always returns true)

UI shells and settings

Settings: src/app/appSettings.ts

  • Storage key: synapse.appSettings.v1
  • uiMode: "default" | "synapseOriginal" | "synapseX" | "synapseV3"
  • Bridge transport: bridgeMethod: "port" | "stream" | "compat" (Settings labels: Fastest / Stream / Compatible). Legacy "websocket" migrates to "port".
  • Other flags: autoAttach, confirmations, resizable window, alwaysOnTop, minimap, error logging, edge curves per shell, integrated webpage URL
ShellDirectoryNotes
Defaultsrc/app/pages/, MainLayout.tsxPrimary 290×355-style UI; full executor bridge
Synapse Original (2017)src/app/synapse-original/Multi-window via Tauri windowOps.ts
Synapse Xsrc/app/synapse-x/WPF-parity sizing; no auth/executor wiring (UI reproduction)
Synapse V3src/app/synapse-v3/Newer theme; Zustand v3Theme.ts; many dormant Figma components

Theming: src/ui/shellTheme.ts — CSS vars, IndexedDB media (synapse-original-shell-media), per-shell keys.

Core feature modules

Editor

  • src/editor/ScriptMonacoEditor.tsx — Monaco mount
  • src/editor/luauLanguage.ts — language registration
  • src/editor/synapseIntellisense.ts — completions
  • src/editor/synapseDiagnostics.tsluaparse markers
  • Tab/workspace: src/app/editorWorkspace/ (EditorWorkspaceContext)
  • Disk I/O: src/app/scripts/editorDiskScripts.ts

Executor bridge

Axum listener on 127.0.0.1:31337 serves three HTTP bridge methods. Full protocol: EXECUTOR_BRIDGE.md.

PieceRole
src-tauri/src/bridge.rsScript downloads, bridge_send_execute, method dispatch, legacy_disabled
src-tauri/src/port_bridge.rsPort /port_bridge/{hello,ping,next,result,log} — long-poll, ~45s liveness
src-tauri/src/stream_bridge.rsStream /stream_bridge/* — NDJSON heartbeat + long-poll next
src-tauri/src/compat_bridge.rsCompat /compat_bridge/* — immediate next, short client poll
src/app/executorBridge/bridgeDispatch.tsCentral execute routing; plugin provider ownership
src/app/executorBridge/useBridgeExecuteReady.tsExecute gating; undock relay to main
ExecutorBridgeContext.tsxBridge UI state, bridge_send_execute, status events
Port Bridge.lua / Stream Bridge.lua / Compat Bridge.luaExecutor-side HTTP clients
Tauri eventssynapse:bridge-status (port_*, stream_*, compat_*, legacy_disabled), synapse:bridge-execute-result, synapse:bridge-log

Plugins

App-wide JS extensions loaded on the main webview. Full guide: PLUGINS.md.

PieceRole
src/app/plugins/GlobalPluginProvider.tsxBootstrap enabled plugins (main window only)
src/app/synapse-v3/plugins/PluginHost.tsHost API, bridge providers, overlays
src/app/synapse-v3/plugins/v3PluginRegistry.tsEnabled/order in localStorage
src-tauri/src/plugins.rsOn-disk layout, ZIP install, tombstone
src-tauri/src/plugin_process_host.rsPlugin subprocess singleton

Script Hub

  • src/app/scriptHub/scriptBloxApi.ts — ScriptBlox fetch layer (dev proxied in vite.config.ts as /scriptblox-api)
  • src/app/scriptHub/synapseLegacyScripts.ts — embedded legacy URLs

Integrated webpage

  • src/app/integratedSiteWebview.ts — secondary native webview (bypasses iframe limits)

Data persistence

StoreKey / fileUsed for
localStoragesynapse.appSettings.v1, theme keys, editor tabsSettings, themes, tabs
IndexedDBsynapse-original-shell-mediaBackground images/videos
Tauri config dirapp_settings_snapshot.json, window_icon_preset.json, scripts/Cold boot, icons, sidebar scripts
FilesystemUser-picked paths via dialog pluginOpen/save scripts

Dev and build commands

npm install
npm run dev          # Vite @ http://127.0.0.1:5173 (browser only)
npm run tauri:dev    # Full desktop (needs VS DevCmd on Windows)
npm run build        # vite build → dist/
npm run tauri:build  # MSI installer
  • Port cleanup: scripts/ensure-dev-port.mjs (5173/4173)
  • Tauri auto-runs npm run dev / npm run build via src-tauri/tauri.conf.json hooks

Key files quick reference

ConcernFile
Frontend entrysrc/main.tsx
App rootsrc/app/App.tsx
Routessrc/app/routes.tsx
Settingssrc/app/appSettings.ts
Editor pagesrc/app/pages/EditorPage.tsx
Bridge UIsrc/app/executorBridge/ExecutorBridgeContext.tsx
Rust appsrc-tauri/src/lib.rs
Bridge serversrc-tauri/src/bridge.rs
Vite configvite.config.ts

Working on this codebase

  1. Identify which UI shell and route are affected
  2. Decide whether logic belongs in React, Tauri IPC, or bridge.rs
  3. Respect boot-path synchronization between main.tsx, routes.tsx, and Rust boot_window_config
  4. Bridge protocols live in src-tauri/src/{port,stream,compat}_bridge.rs and matching * Bridge.lua scripts
  5. Plugin changes may require Restart Framework — see PLUGINS.md

Gaps and conventions

  • No automated tests in the main app
  • No CI/CD — builds are local MSI only
  • No root tsconfig — Vite transpiles TS without strict project config
  • Figma heritagesrc/imports/ SVG path modules; npm package name @figma/my-make-file
  • Auth: none; Synapse X shell is explicitly UI-only
  • Synapse V3 is partially integrated (single main route; many dormant components)

Optional future improvements

Not required for day-to-day development; add when explicitly requested:

  • Root tsconfig.json for stricter TypeScript checking
  • Vitest or similar test runner
  • GitHub Actions CI for npm run build and cargo test