Framework examples

Runnable Bevy-style examples for building Desktop, Web, TUI, Mobile, and Service/Daemon applications on Vmux Framework (DefaultPlugins, MinimalPlugins, ServerPlugins), plus standalone feature apps and low-level ECS primitive references.

Running examples

List or launch any example with the Vmux CLI:

vmux example --list
vmux example counter
vmux example counter --headless

Short names like counter or project resolve automatically and enable required Cargo features. Pass --headless (or VMUX_EXAMPLE_HEADLESS=1) for a one-shot smoke check in a terminal or CI, or forward binary arguments after --. You can also invoke cargo run -p vmux_examples ... directly from the repository root.

Examples are organized under examples/ in three top-level directories:

  • apps/ — full Desktop, Web, TUI, Mobile, and Service/Daemon client apps.
  • features/ — 16 standalone CEF-free desktop apps isolating individual product feature crates.
  • primitives/ — 18 focused ECS, concurrency, layout, menu, and manifest primitive visualizers.

Apps

Desktop (DefaultPlugins — CEF-free vmux_window + vmux_page + Dioxus)

ExampleFileWhat it demonstratesCommand
Counter Appexamples/apps/desktop/counter.rsMinimal desktop app with DefaultPlugins.set(WindowHostPlugin::new(...)), #[ui_state], #[ui_event], and a Dioxus Page.vmux example desktop_counter
Notes Appexamples/apps/desktop/notes.rsPersistent multi-note desktop app combining DefaultPlugins, IdentityIndexPlugin, and AutoSavePlugin.vmux example desktop_notes
Split Workspaceexamples/apps/desktop/workspace.rsMulti-pane desktop workspace combining LayoutPlugin, FlexPlugin, MenuPlugin, and declarative #[app_menu].vmux example desktop_workspace
Web Host Appexamples/apps/desktop/web_host.rsDefaultPlugins + WebHostPlugin + linked Rust native plugin (PingRequest).vmux example desktop_web_host

Web, TUI, Mobile, and Service

TargetExampleFileWhat it demonstratesCommand
WebWeb Clientexamples/apps/web.rsServer-rendered Dioxus web app + JSON API backed by canonical ECS state via ServerPlugins + HttpServerPlugin.vmux example web
TUITUI Workspaceexamples/apps/tui.rsInteractive multi-pane terminal UI built on TuiFrameworkPlugin (15 themes) with FlexPlugin and LayoutPlugin.vmux example tui
MobileMobile Shellexamples/apps/mobile.rsMobile-safe client composing MinimalPlugins, UiIpcPlugin, #[ui_state], #[ui_event], and Dioxus screens with zero desktop deps.vmux example mobile
ServiceService Daemonexamples/apps/service.rsLong-running HTTP service with /healthz, ServerPlugins, and graceful ShutdownBarrier draining.vmux example service

Standalone features

All 16 feature examples launch CEF-free desktop windows via vmux example feature_<name>:

ExampleFileWhat it demonstrates
Project Managerexamples/features/project.rsProjectPlugin + FilesystemPlugin: registration, rename, and .projects.ron persistence.
Accounts & Profilesexamples/features/account.rsAccountPlugin + local::LocalPlugin: SQLite-backed local profile creation and rename.
Extension Catalogexamples/features/extension.rsExtensionPlugin: permission-approved enable/disable and pin toggles.
Sessions & Queueexamples/features/session.rsSessionDomainPlugin + QueuePlugin: session creation, stage transitions, and FIFO prompt queue.
Knowledge Graphexamples/features/knowledge.rsKnowledgeGraphPlugin: Markdown vault search, wikilink resolution, backlinks, and broken links.
History Browserexamples/features/history.rsHistoryCorePlugin: visit recording, visit-count aggregation, and live filtering.
Git Inspectorexamples/features/git.rsJobsPlugin + vmux_git: repository, branch, dirty-file, and worktree inspector.
Vault Studioexamples/features/vault.rsvmux_vault::storage: encrypted vault status, managed-path inspection, and recovery-key generation.
Command Registryexamples/features/command.rsCommandRuntimePlugin + Keymap: command filtering, shortcut resolution, and CommandDispatch log.
Settings Studioexamples/features/setting.rsSettingsRuntimePlugin: AppSettings::apply_update, debounced settings.ron persistence, and live RON diff.
Bookmarks Managerexamples/features/bookmark.rsBookmarkStorePlugin + UiPlugin: bookmarks, pin/unpin toggling, and auto-saved bookmarks.ron.
Remote Admissionexamples/features/remote.rsRemoteDomainPlugin: remote.live cloud snapshot evaluation, kill-switch retention, and dev overrides.
Team Rosterexamples/features/team.rsRosterPlugin: member updates and live TeamUiState agent subtitle projection.
ACP Approvalsexamples/features/acp.rsApprovalPlugin: workspace-scoped tool approval grants and Grants::allows evaluation.
Service Auth & Pairingexamples/features/service.rsvmux_service: relay URL configuration, pairing token rotation, and deep-link generation.
Component Galleryexamples/features/gallery.rsvmux_gallery::Story: story catalog filter and RON preset metadata browser.

Primitives

Run any primitive visualizer with vmux example <name>.

ECS vocabulary and state

ExampleFileWhat it demonstrates
selectionexamples/primitives/selection.rsScoped single-entity selection with SelectionPlugin and SelectRequest.
leaseexamples/primitives/lease.rsFIFO shared/exclusive resource leases with LeasePlugin and release on despawn.
generation_dirtyexamples/primitives/generation_dirty.rsStale-operation rejection with GenerationPlugin and dirty projections with DirtyPlugin.
vocabularyexamples/primitives/vocabulary.rsShared RenamePlugin, OrderPlugin, TogglesPlugin, and StatusPlugin entity vocabulary.
operation_policyexamples/primitives/operation_policy.rsPer-target SerializePerTarget and SupersedePrevious policies via OperationPlugin.
autosave_storeexamples/primitives/autosave_store.rsMacro-tracked dirty detection and debounced persistence with AutoSavePlugin and #[vmux_ecs::store(track; ...)].

Async, concurrency & time

ExampleFileWhat it demonstrates
async_channelexamples/primitives/async_channel.rsBackground-thread streaming messages and entity-bound channels via AsyncChannelPlugin.
async_taskexamples/primitives/async_task.rsEntity-owned AsyncTask<T> completion and TaskToken cancellation with TaskPlugin<T>.
io_taskexamples/primitives/io_task.rsTyped async IO outcomes (Ok component insertion and TaskError<T>) with IoTaskPlugin.
jobsexamples/primitives/jobs.rsBlocking thread-pool JobPlugin<J> integrated with Operation completion.
deadlineexamples/primitives/deadline.rsDeterministic Clock::fake, DeadlinePlugin, Debounce, and ExpiresAt.
watchexamples/primitives/watch.rsDirectory watching and FileWatchEvent messages through FileWatchPlugin.

Layout, menus & manifests

ExampleFileWhat it demonstrates
panesexamples/primitives/panes.rsPane tree splits, scoped selection, and neighbor queries via LayoutPlugin and PaneHierarchy.
flexexamples/primitives/flex.rsRenderer-independent flexbox layout calculation via FlexPlugin and ComputedNode.
workspace_overlaysexamples/primitives/workspace_overlays.rsRenderer-free workspace tabs, resizable side panels, and modals via LayoutPlugin.
declarative_menuexamples/primitives/declarative_menu.rsTyped application menus with #[vmux_app::menu::menu] and MenuActionPlugin.
external_featureexamples/primitives/external_feature.rsRON feature manifests and dependency/permission validation via FeaturePlugin and CompositionPlugin.
manifest_web_hostexamples/primitives/manifest_web_host.rsPinned web application envelope validation and HostedApplicationReady via WebHostPlugin.
trayexamples/primitives/tray.rsSystem tray items and live updates via vmux_tray::TrayPlugin, TrayItem, TrayItemUpdate, and TrayItemSelected.
updaterexamples/primitives/updater.rsRelease-channel switching and manual update checks via vmux_update::UpdatePlugin, UpdatePolicy, and UpdateStatus.
captureexamples/primitives/capture.rsWindow screenshot and recording plugins plus CaptureSize/CropRect geometry via vmux_capture.

Containers

examples/containers/ contains a minimal Nginx Dockerfile and compose.yaml for testing VM port forwarding (see VM and Docker).