Skip to content

Examples

Forge includes several example applications demonstrating different framework capabilities. Each example is a complete, runnable app you can use as a starting point for your own projects.

Running Examples

Terminal window
# Run any example with the CLI
forge dev examples/todo-app
# Or using cargo during development
cargo run -p forge_cli -- dev examples/todo-app

Example Applications

Beginner

ExampleDescriptionKey Features
example-deno-appMinimal starter appBasic window, IPC
react-appReact + TypeScript starterReact integration, bundling
nextjs-appNext.js integrationSSR patterns

Intermediate

ExampleDescriptionKey Features
todo-appTodo list with persistenceruntime:fs, file storage
weather-appWeather with API callsruntime:net, runtime:sys
text-editorSimple text editorDialogs, clipboard, menus

Advanced

ExampleDescriptionKey Features
system-monitorSystem resource monitorMulti-window, tray, process
svelte-appSecure vault with SvelteKitruntime:svelte, encryption
wasm-forge-exampleWebAssembly integrationruntime:wasm
developer-toolkitFull-featured dev toolsCode signing, crypto, shell

Creating a New App

The quickest way to start a new Forge app is copying an example:

Terminal window
# Copy the todo-app as a starting point
cp -r examples/todo-app my-new-app
# Edit the manifest
nano my-new-app/manifest.app.toml
# Run your app
forge dev my-new-app

App Structure

All examples follow the standard Forge app structure:

my-app/
├── manifest.app.toml # App configuration and capabilities
├── deno.json # Deno configuration (TypeScript, imports)
├── src/
│ └── main.ts # Deno entry point (app logic)
└── web/
└── index.html # WebView content (UI)

Capability Patterns

Examples demonstrate different capability configurations:

Minimal (example-deno-app)

[capabilities.channels]
allowed = ["*"]

File Access (todo-app)

[capabilities.fs]
read = ["~/.forge-todo.json"]
write = ["~/.forge-todo.json"]

Network + Notifications (weather-app)

[capabilities.net]
fetch = ["https://api.open-meteo.com/*"]
[capabilities.sys]
notifications = true

Full Access (developer-toolkit)

[permissions.fs]
read = ["**/*"]
write = ["**/*"]
[permissions.process]
allow = ["codesign", "signtool", "openssl"]