Repository tour
The repository holds the desktop app (a Vite project at the root and a Rust crate in
src-tauri), the widget schemas, release scripts, the website and these docs in site, and the
GitHub Actions workflows that test, release, and publish everything. This page walks through it
from the top.
Overview
Section titled “Overview”Directory.github/
Directoryworkflows/
- ci.yml checks every pull request and push to main
- docs.yml generates the Rust API docs
- pages.yml the only workflow that deploys GitHub Pages
- release.yml builds, signs, and publishes a release
Directorybot/ Discord bot, a Cloudflare Worker
- …
Directorychangelogs/ one Discord-ready Markdown file per version
- …
Directorydocs/
- RELEASING.md release, signing, and hosting runbook
- WIDGETS.md the widget contract
Directoryexamples/
Directoryhello_world/ the example widget in development builds
- …
Directorypublic/
Directoryassets/ logo and icons served at /assets/
- …
Directoryschemas/
- widget-manifest-v1.schema.json
- widget-ipc-v1.schema.json
Directoryscripts/
- publish-updates.mjs
- release-notes.mjs
- set-version.mjs
- third-party-notices.mjs
- widgets.mjs checks and packages catalogue widgets
Directorysite/ Astro and Starlight website
- astro.config.mjs
Directorypublic/
- …
Directorysrc/
Directorycontent/docs/docs/ these pages
- …
- pages/index.astro the download page
Directorysrc/ React interface
Directorycomponents/ui/ shadcn/ui components
- …
- lib/utils.ts
Directoryscreens/
- Accounts.tsx
- Dashboard.tsx
- Settings.tsx
- Widgets.tsx
- widgets/host.tsx module widget host
- App.tsx
- bridge.ts
- index.css
- logic.ts
- logic.test.ts
- main.tsx
- shared.tsx
- types.ts
Directorysrc-tauri/ Rust host
- capabilities/default.json
Directoryicons/
- …
Directoryresources/multi-instance/
- …
Directorysrc/ one file per module
- …
- windows/installer-hooks.nsh
- build.rs
- Cargo.toml
- tauri.conf.json
- tauri.demo.conf.json
- tauri.macos.conf.json
- tauri.preview.conf.json
- tauri.windows.conf.json
- AGENTS.md
- components.json
- CONTRIBUTING.md
- index.html
- package.json
- PRODUCT.md
- README.md
- SECURITY.md
- tsconfig.json
- vite.config.ts
Root files
Section titled “Root files”| File | Contents |
|---|---|
README.md |
A pointer to toolblox.dev for downloads, then the development and verification commands, project layout, and documentation links. |
PRODUCT.md |
The product authority: platform, stack, users, purpose, constraints, planned widget capabilities, brand commitments, and principles. When a behavior is in doubt, this file decides. |
AGENTS.md |
Engineering rules for contributors and AI agents: stack boundaries, code style, UI rules, and required verification. |
CONTRIBUTING.md |
How to propose changes, the expectation that every Rust item has a /// comment, and what must stay in Rust. |
SECURITY.md |
How to report a vulnerability, and a link to the full security policy on the website. |
package.json |
Interface dependencies and the npm scripts (dev, build, check, test, tauri, demo, preview:installer). |
index.html |
The Vite entry page. It holds only <div id="root"> and loads /src/main.tsx. |
vite.config.ts |
Vite with the React and Tailwind CSS plugins, the @ alias for /src, a fixed dev port of 1420 (strictPort), and src-tauri excluded from file watching. |
tsconfig.json |
Strict TypeScript for src, with noUnusedLocals, noUnusedParameters, and the @/* path alias. tsconfig.node.json covers vite.config.ts. |
components.json |
The shadcn/ui configuration used by npx shadcn@latest add <name>. |
LICENSE |
The MIT license. The website’s Legal page reads it at build time. |
The privacy policy, security policy, license, and third-party notices share the website’s Legal
page, site/src/pages/legal.astro. It renders site/src/legal/privacy.md and security.md,
then the disclaimer and LICENSE, then a table of every package in the latest release’s
THIRD-PARTY-NOTICES.txt, which it downloads at build time. When that download fails, the table
is left out and the page links to the file instead. /privacy/ and /security/ redirect to their
sections, and /policies/, the page’s former address, redirects to /legal/ while keeping the
section in the URL fragment so links from older app versions still resolve. The app’s Settings
links to the Legal page on toolblox.dev.
.gitignore excludes node_modules, dist, logs, _site (the assembled Pages output),
THIRD-PARTY-NOTICES.txt, and .astro. .vscode/extensions.json recommends the Tauri and
rust-analyzer extensions.
src: the interface
Section titled “src: the interface”The React interface. The architecture page maps each file; this section adds what lives in the folders.
src/components/ui
Section titled “src/components/ui”The shadcn/ui components the app is built from, generated in the base-nova style on
Base UI: alert-dialog, badge, button, checkbox, dropdown-menu,
input, switch, tabs, toggle, toggle-group, and tooltip. New components are added with
npx shadcn@latest add <name>, which reads components.json:
style: "base-nova",baseColor: "neutral", CSS variables on, no prefix.tailwind.css: "src/index.css", where theme tokens live.iconLibrary: "lucide", so icons come fromlucide-react.- Aliases map
@/components,@/components/ui,@/lib,@/lib/utils, and@/hooks.
Most of these components are also handed to module widgets through toolblox.ui, alongside
app-level pieces from src/shared.tsx. See Host API.
src/screens
Section titled “src/screens”One file per core screen. Each exports a component that receives ScreenProps from App.tsx:
the current state, refresh, navigate, notify, confirm, join, askPlace, and
patchSettings.
| Screen | Contents |
|---|---|
Dashboard.tsx |
Account, In game, and enabled widget tiles, a Recently played list with one-click rejoin, iframe widget dashboard tiles, and the dashboard.stats and dashboard.sections slots. |
Accounts.tsx |
The account list: add, remove, notes, per-account places, ordering, and joining, with the accounts.toolbar and accounts.row slots. |
Widgets.tsx |
Installed widgets (enable, open, update, settings, uninstall), the catalogue with install confirmation, load errors, and in development builds the widgets folder path. |
Settings.tsx |
Appearance, window, list, joining, and disconnect settings, the About group with update checks and privacy and legal links, and Diagnostics with the log viewer. Widgets can’t replace it. |
src/widgets
Section titled “src/widgets”host.tsx is the module widget host. It keeps module-level registries of replaced screens,
widget pages, widget settings pages, and slot contributions; builds the host API object
(createApi) passed to each module’s activate; loads and unloads modules as widgets are
enabled, disabled, or removed (syncWidgetModules); and provides WidgetBoundary and
WidgetSlot. Every widget-facing behavior in the interface starts here.
Other files
Section titled “Other files”src/lib/utils.ts re-exports cn for class name merging. src/assets is empty; static assets
the interface references by URL, such as /assets/logo.svg and /assets/splash.svg, live in
public/assets and are served at the root.
src-tauri: the Rust host
Section titled “src-tauri: the Rust host”src-tauri/src
Section titled “src-tauri/src”One file per module, described in the
Rust module map. lib.rs wires them together and
main.rs is the executable entry point.
Cargo.toml
Section titled “Cargo.toml”The package is named toolblox and its library toolblox_lib, built as staticlib, cdylib,
and rlib. The edition is 2024. Notable dependencies:
| Crate | Used for |
|---|---|
tauri (pinned to =2.11.6, tray-icon) |
The application shell |
tauri-plugin-opener, -autostart, -single-instance, -updater, -notification |
Opening URLs, launch at login, second-launch activation, installer updates, disconnect notifications |
reqwest (rustls-tls, json) |
All HTTP |
keyring (windows-native or apple-native) |
The OS credential store, per platform |
windows-sys |
Atomic file replacement on Windows |
ed25519-dalek, sha2, base64, hex |
Manifest and catalogue signatures, package hashes |
zip (deflate only) |
Widget package extraction |
semver, url, uuid, serde, serde_json |
Versions, URL validation, session IDs, JSON |
zeroize |
Zeroing session memory |
opener |
Opening launch URIs and the log folder |
log, tokio (time) |
The logging facade and async sleeps |
tempfile is the only dev dependency. The release profile uses one codegen unit, LTO,
opt-level = 3, panic = "abort", and stripped symbols. build.rs only calls
tauri_build::build().
Tauri configuration files
Section titled “Tauri configuration files”Tauri merges platform and override files on top of
tauri.conf.json.
| File | Purpose |
|---|---|
tauri.conf.json |
The base configuration. Identifier com.bakedaleska.toolblox. Runs npm run dev against http://localhost:1420 in development and npm run build into ../dist for builds. Declares one hidden main window, 900×500 with a 720×480 minimum. Sets the main window CSP and the default capability. Bundles the multi-instance helper resources, sets NSIS to currentUser install mode with windows/installer-hooks.nsh, and configures the updater public key with requireSignedVersion and passive Windows install mode. Updater endpoints are empty because startup.rs supplies the endpoint at runtime. |
tauri.windows.conf.json |
Bundles only the NSIS installer on Windows. |
tauri.macos.conf.json |
Bundles the app and dmg targets on macOS, ad-hoc signs the app, and leaves out the Windows multi-instance helper. |
tauri.demo.conf.json |
Used by npm run demo. Changes beforeDevCommand to npm run dev -- --mode demo so the interface runs on sample data. |
tauri.preview.conf.json |
Used by npm run preview:installer. Turns off createUpdaterArtifacts so a debug NSIS installer builds without signing keys. |
capabilities/default.json
Section titled “capabilities/default.json”The only capability. It applies to the main window and grants core:default and
opener:default. Toolblox’s own commands are registered through generate_handler! in lib.rs.
No capability names the Roblox sign-in window, which is what keeps remote pages away from IPC.
resources/multi-instance
Section titled “resources/multi-instance”The Windows helper that lets several Roblox clients run at once:
helper.cis the source. It closes theROBLOX_singletonEventhandle held by the Roblox processes whose IDs it’s given.multi_instance_helper.exeis the built binary, bundled as a resource and located at runtime under the app’s resource directory.build.ps1rebuilds the binary with MSVC.README.mdexplains the technique in detail.
All three of helper.c, the binary, and the README ship with the installer, so the bundled
binary can be inspected against its source.
windows/installer-hooks.nsh
Section titled “windows/installer-hooks.nsh”An NSIS hook that runs before uninstall and removes the Toolblox value from
HKCU\Software\Microsoft\Windows\CurrentVersion\Run, so launch at login doesn’t outlive the app.
Application icons for every bundle target. tauri.conf.json uses the 32, 128, and 256 pixel PNGs,
icon.icns, and icon.ico.
schemas
Section titled “schemas”JSON Schemas (draft 2020-12) for the widget contract, published with $ids under
https://toolblox.dev/schemas/:
widget-manifest-v1.schema.jsondescribeswidget.json. It disallows additional properties.widget-ipc-v1.schema.jsondescribes widget IPC requests.
The Rust types in widgets.rs and widget_ipc.rs are the source of truth at runtime. The schemas
are for editor validation and tooling. See Manifest and
IPC.
scripts
Section titled “scripts”Node scripts used by the release and Pages workflows. All can also run locally.
| Script | What it does |
|---|---|
set-version.mjs |
node scripts/set-version.mjs 0.3.0-beta writes the version into package.json, package-lock.json, src-tauri/tauri.conf.json, src-tauri/Cargo.toml, and src-tauri/Cargo.lock. The demo state in src/bridge.ts reads it from package.json. With --check it only verifies the version is newer than the current one. Every file must agree because the update gate compares the Cargo version with the signed manifest. |
release-notes.mjs |
Prints release notes from the feat, fix, and perf commit subjects since the previous tag, under a fixed download section with the installer’s SHA-256. |
publish-updates.mjs |
Copies the built site from site/dist into _site, then writes updates/stable.json (for the latest release’s installer, valid for seven days) and catalogue/v1.json, each with a detached Ed25519 .sig. The catalogue lists every widget in widgets/. |
widgets.mjs |
node scripts/widgets.mjs checks every folder in widgets/. publish-updates.mjs uses it to package each one into a reproducible ZIP and build its catalogue entry. |
third-party-notices.mjs |
Writes the license texts of every Rust crate and npm package that ships in a release build into THIRD-PARTY-NOTICES.txt. |
The website at toolblox.dev, an Astro project with the
Starlight docs integration.
astro.config.mjssetssite: "https://toolblox.dev"and configures Starlight: title, logo, GitHub link, an edit link pointing intosite/on GitHub, and the sidebar groups (Introduction, Start here, The app, Widget tutorials, Widget reference, Publishing), each autogenerated from a folder undersrc/content/docs/docs/.src/pages/index.astrois the standalone download page at the site root.src/content/docs/docs/holds these pages, so they’re served under/docs/. Page order within a group comes from each page’ssidebar.orderfrontmatter.src/content.config.tsregisters the Starlight docs collection.public/logo.svgis the site logo and favicon.
It has its own package.json with dev, build, and preview scripts. Run them from site/.
Two Markdown documents kept beside the code:
docs/WIDGETS.mdis the concise widget contract: module and iframe widgets, the host API, slots, IPC methods, and packaging. The widget reference pages here expand on it.docs/RELEASING.mdis the release runbook: publishing, the update manifest and its daily re-signing, Pages deployments, thetoolblox.devdomain, endpoints and public keys, release assets, and download counts.
.github/workflows
Section titled “.github/workflows”ci.yml
Section titled “ci.yml”Runs on every pull request and every push to main, on both windows-latest and
macos-latest. It installs Node.js 22 and stable Rust with rustfmt and clippy, then runs, in
order:
npm cinpm auditnpm run checknpm testnpm run buildcargo fmt --check # in src-tauricargo clippy --all-targets -- -D warnings # in src-tauricargo test # in src-tauricargo doc --no-deps --document-private-items --lib # RUSTDOCFLAGS=-D warningscargo clippy --release --all-targets -- -D warnings # in src-taurinpm run tauri build -- --debug --no-bundleA separate widgets job on ubuntu-latest runs node scripts/widgets.mjs to check every
catalogue widget folder.
The cargo doc step fails on any rustdoc warning, such as a broken intra-doc link. The release
clippy pass matters because much of startup.rs only compiles outside debug builds.
docs.yml
Section titled “docs.yml”Runs on pushes to main that change src-tauri/src/**, src-tauri/Cargo.toml, or the workflow
itself, and on demand. On Windows it builds the interface first, because tauri::generate_context! embeds dist, then
runs cargo doc --no-deps --document-private-items --lib, adds a redirect index.html to
toolblox_lib/index.html, and force-pushes the output as a single commit to the docs branch.
It then calls pages.yml to redeploy. Private items are documented, so module pages such as
app_commands exist in the
API reference.
pages.yml
Section titled “pages.yml”The only workflow that deploys GitHub Pages. It runs daily at 06:17 UTC, on pushes to main that
change widgets/, when called by the release and docs workflows, and on demand. It:
- Checks out
mainand thedocsbranch. - Builds the Astro site in
site/. - Runs
publish-updates.mjswith the manifest and catalogue private keys, producing_site. - Moves the API docs into
_site/api. - Uploads and deploys the Pages artifact.
- Deletes every Pages deployment except the one this run created.
- Re-enables its own schedule, because GitHub disables scheduled workflows after 60 days without repository activity.
release.yml
Section titled “release.yml”Started manually from main with a version and an optional dry run. A check job confirms
the version is new and untagged. Then a build job runs on Windows and macOS in parallel: each
sets the version with set-version.mjs, runs npm run check, npm test, and cargo test, and
builds with npm run tauri build -- --bundles nsis on Windows or
npm run tauri build -- --target universal-apple-darwin --bundles app,dmg on macOS.
The build receives the endpoints and public keys as compile-time environment variables, which
startup.rs and app_commands.rs read with option_env!:
| Variable | Read by |
|---|---|
TOOLBLOX_UPDATE_MANIFEST_URL |
startup::run_inner |
TOOLBLOX_MANIFEST_PUBLIC_KEY |
startup::run_inner |
TOOLBLOX_UPDATER_PUBLIC_KEY |
startup::run_inner (taken from tauri.conf.json) |
TOOLBLOX_CATALOGUE_URL |
refresh_catalogue_data |
TOOLBLOX_CATALOGUE_PUBLIC_KEY |
refresh_catalogue_data |
Windows prepares Toolblox-Setup.exe, its .sig, the identical Toolblox-Update.exe, and
THIRD-PARTY-NOTICES.txt; macOS prepares Toolblox.dmg, Toolblox.app.tar.gz, and its .sig.
Each uploads them as a workflow artifact. Unless it’s a dry run, a release job writes
SHA256SUMS for both installers and both updates, then commits
chore(release): <version>, tags v<version>, publishes the GitHub release with both platforms’
files, and calls pages.yml so installed apps move to the new version on their next launch.