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)
| Example | File | What it demonstrates | Command |
|---|---|---|---|
| Counter App | examples/apps/desktop/counter.rs | Minimal desktop app with DefaultPlugins.set(WindowHostPlugin::new(...)), #[ui_state], #[ui_event], and a Dioxus Page. | vmux example desktop_counter |
| Notes App | examples/apps/desktop/notes.rs | Persistent multi-note desktop app combining DefaultPlugins, IdentityIndexPlugin, and AutoSavePlugin. | vmux example desktop_notes |
| Split Workspace | examples/apps/desktop/workspace.rs | Multi-pane desktop workspace combining LayoutPlugin, FlexPlugin, MenuPlugin, and declarative #[app_menu]. | vmux example desktop_workspace |
| Web Host App | examples/apps/desktop/web_host.rs | DefaultPlugins + WebHostPlugin + linked Rust native plugin (PingRequest). | vmux example desktop_web_host |
Web, TUI, Mobile, and Service
| Target | Example | File | What it demonstrates | Command |
|---|---|---|---|---|
| Web | Web Client | examples/apps/web.rs | Server-rendered Dioxus web app + JSON API backed by canonical ECS state via ServerPlugins + HttpServerPlugin. | vmux example web |
| TUI | TUI Workspace | examples/apps/tui.rs | Interactive multi-pane terminal UI built on TuiFrameworkPlugin (15 themes) with FlexPlugin and LayoutPlugin. | vmux example tui |
| Mobile | Mobile Shell | examples/apps/mobile.rs | Mobile-safe client composing MinimalPlugins, UiIpcPlugin, #[ui_state], #[ui_event], and Dioxus screens with zero desktop deps. | vmux example mobile |
| Service | Service Daemon | examples/apps/service.rs | Long-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>:
| Example | File | What it demonstrates |
|---|---|---|
| Project Manager | examples/features/project.rs | ProjectPlugin + FilesystemPlugin: registration, rename, and .projects.ron persistence. |
| Accounts & Profiles | examples/features/account.rs | AccountPlugin + local::LocalPlugin: SQLite-backed local profile creation and rename. |
| Extension Catalog | examples/features/extension.rs | ExtensionPlugin: permission-approved enable/disable and pin toggles. |
| Sessions & Queue | examples/features/session.rs | SessionDomainPlugin + QueuePlugin: session creation, stage transitions, and FIFO prompt queue. |
| Knowledge Graph | examples/features/knowledge.rs | KnowledgeGraphPlugin: Markdown vault search, wikilink resolution, backlinks, and broken links. |
| History Browser | examples/features/history.rs | HistoryCorePlugin: visit recording, visit-count aggregation, and live filtering. |
| Git Inspector | examples/features/git.rs | JobsPlugin + vmux_git: repository, branch, dirty-file, and worktree inspector. |
| Vault Studio | examples/features/vault.rs | vmux_vault::storage: encrypted vault status, managed-path inspection, and recovery-key generation. |
| Command Registry | examples/features/command.rs | CommandRuntimePlugin + Keymap: command filtering, shortcut resolution, and CommandDispatch log. |
| Settings Studio | examples/features/setting.rs | SettingsRuntimePlugin: AppSettings::apply_update, debounced settings.ron persistence, and live RON diff. |
| Bookmarks Manager | examples/features/bookmark.rs | BookmarkStorePlugin + UiPlugin: bookmarks, pin/unpin toggling, and auto-saved bookmarks.ron. |
| Remote Admission | examples/features/remote.rs | RemoteDomainPlugin: remote.live cloud snapshot evaluation, kill-switch retention, and dev overrides. |
| Team Roster | examples/features/team.rs | RosterPlugin: member updates and live TeamUiState agent subtitle projection. |
| ACP Approvals | examples/features/acp.rs | ApprovalPlugin: workspace-scoped tool approval grants and Grants::allows evaluation. |
| Service Auth & Pairing | examples/features/service.rs | vmux_service: relay URL configuration, pairing token rotation, and deep-link generation. |
| Component Gallery | examples/features/gallery.rs | vmux_gallery::Story: story catalog filter and RON preset metadata browser. |
Primitives
Run any primitive visualizer with vmux example <name>.
ECS vocabulary and state
| Example | File | What it demonstrates |
|---|---|---|
selection | examples/primitives/selection.rs | Scoped single-entity selection with SelectionPlugin and SelectRequest. |
lease | examples/primitives/lease.rs | FIFO shared/exclusive resource leases with LeasePlugin and release on despawn. |
generation_dirty | examples/primitives/generation_dirty.rs | Stale-operation rejection with GenerationPlugin and dirty projections with DirtyPlugin. |
vocabulary | examples/primitives/vocabulary.rs | Shared RenamePlugin, OrderPlugin, TogglesPlugin, and StatusPlugin entity vocabulary. |
operation_policy | examples/primitives/operation_policy.rs | Per-target SerializePerTarget and SupersedePrevious policies via OperationPlugin. |
autosave_store | examples/primitives/autosave_store.rs | Macro-tracked dirty detection and debounced persistence with AutoSavePlugin and #[vmux_ecs::store(track; ...)]. |
Async, concurrency & time
| Example | File | What it demonstrates |
|---|---|---|
async_channel | examples/primitives/async_channel.rs | Background-thread streaming messages and entity-bound channels via AsyncChannelPlugin. |
async_task | examples/primitives/async_task.rs | Entity-owned AsyncTask<T> completion and TaskToken cancellation with TaskPlugin<T>. |
io_task | examples/primitives/io_task.rs | Typed async IO outcomes (Ok component insertion and TaskError<T>) with IoTaskPlugin. |
jobs | examples/primitives/jobs.rs | Blocking thread-pool JobPlugin<J> integrated with Operation completion. |
deadline | examples/primitives/deadline.rs | Deterministic Clock::fake, DeadlinePlugin, Debounce, and ExpiresAt. |
watch | examples/primitives/watch.rs | Directory watching and FileWatchEvent messages through FileWatchPlugin. |
Layout, menus & manifests
| Example | File | What it demonstrates |
|---|---|---|
panes | examples/primitives/panes.rs | Pane tree splits, scoped selection, and neighbor queries via LayoutPlugin and PaneHierarchy. |
flex | examples/primitives/flex.rs | Renderer-independent flexbox layout calculation via FlexPlugin and ComputedNode. |
workspace_overlays | examples/primitives/workspace_overlays.rs | Renderer-free workspace tabs, resizable side panels, and modals via LayoutPlugin. |
declarative_menu | examples/primitives/declarative_menu.rs | Typed application menus with #[vmux_app::menu::menu] and MenuActionPlugin. |
external_feature | examples/primitives/external_feature.rs | RON feature manifests and dependency/permission validation via FeaturePlugin and CompositionPlugin. |
manifest_web_host | examples/primitives/manifest_web_host.rs | Pinned web application envelope validation and HostedApplicationReady via WebHostPlugin. |
tray | examples/primitives/tray.rs | System tray items and live updates via vmux_tray::TrayPlugin, TrayItem, TrayItemUpdate, and TrayItemSelected. |
updater | examples/primitives/updater.rs | Release-channel switching and manual update checks via vmux_update::UpdatePlugin, UpdatePolicy, and UpdateStatus. |
capture | examples/primitives/capture.rs | Window 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).