Skip to main content

Crate forge

Crate forge 

Source
Expand description

FORGE - The Rust Full-Stack Framework

A batteries-included framework for building full-stack web applications with a Rust backend and generated SvelteKit or Dioxus frontends.

§Features

Cargo features control which subsystems are compiled in. The default feature set is full — every subsystem enabled. To shrink your binary, disable defaults and opt into a preset:

# Worker-only binary (no HTTP gateway)
forge = { version = "0.9", default-features = false, features = ["worker"] }

# API server (no background workers)
forge = { version = "0.9", default-features = false, features = ["api"] }

Available presets: full, worker, api, minimal. Available subsystems: gateway, jobs, workflows, cron, daemons, geoip, otel.

Re-exports§

pub use forge_core::schemars;

Modules§

prelude
Common imports for Forge applications.
testing

Macros§

assert_err
Assert that a result is Err.
assert_err_matches
Assert that an error matches a pattern, with an optional guard expression.
assert_err_variant
Assert that an error matches a specific variant (pattern matching, not substring).
assert_http_called
Assert that an HTTP call was made.
assert_http_not_called
Assert that an HTTP call was not made.
assert_job_dispatched
Assert that a job was dispatched.
assert_job_not_dispatched
Assert that a job was not dispatched.
assert_ok
Assert that a result is Ok.
assert_workflow_not_started
Assert that a workflow was not started.
assert_workflow_started
Assert that a workflow was started.

Structs§

AutoHandler
A single auto-registration entry emitted by each #[forge::*] macro via inventory::submit!.
Forge
The main FORGE runtime.
ForgeBuilder
Builder for configuring the FORGE runtime.
HandlerRegistries
All registries bundled into one struct so a single AutoHandler closure can target the right sub-registry without needing a separate inventory type per handler kind.
Migration
A single migration with up SQL.

Functions§

auto_register_all
Register all auto-discovered handlers.
get_internal_sql
All internal FORGE schema SQL concatenated. Apply before user migrations in tests.

Attribute Macros§

cron
Marks a function as a scheduled cron task.
daemon
Marks a function as a long-running daemon.
forge_enum
Marks an enum for database storage as a PostgreSQL ENUM type.
job
Marks a function as a background job.
mcp_tool
Marks a function as an MCP tool.
model
Marks a struct as a FORGE model, generating schema metadata for TypeScript codegen.
mutation
Marks a function as a mutation (transactional write).
query
Marks a function as a query (read-only, cacheable, subscribable).
webhook
Marks a function as a webhook handler.
workflow
Marks a function as a durable workflow.