Docs
Quickstart
Create a Proa site, run it, and edit your first route in five minutes.
1. Install Proa
Install Rust 1.98 or newer with rustfmt and a C linker. On macOS, Xcode Command Line Tools provides cc. On Linux, install your distribution’s C build tools. On Windows, use Visual Studio Build Tools with the C++ workload.
On macOS and Linux, install Proa with:
curl -fsSL https://proa.so/install.sh | sh
The installer reuses Tailwind CSS v4 from your PATH when available. If it's missing, interactive installs prompt and non-interactive installs include the standalone binary. That download accounts for most of the installer payload. Pass --no-tailwind for a CLI-only install if your site uses plain CSS.
You can also install the CLI from crates.io:
cargo install proa-cli --locked
On Windows, or after a Cargo install, install Tailwind separately: see Tailwind prerequisite.
Coding agents can start at the documentation index. See Troubleshooting for toolchain setup.
2. Create A Site
A minimal Axum-backed application with the core boundaries in place:
proa new site hello-proa
Cargo.tomlproa.config.rsproa.lock.jsonbuild.rssrc/components/endpoints/layouts/pages/app.rslib.rsmain.rsroutes.rsmigrations/public/favicon.svgstyles.cssstyles/input.csstests/Checkpoint: Cargo.toml, src/lib.rs, src/pages/home.rs, and
src/layouts/root.rs should exist.
The kitchen-sink starter, and the fastest way to see a production Proa app fit together:
proa new site origin-atlas --template origin
This scaffolds ORIGIN, a live routing atlas that exercises the whole
framework: a custom RIPEstat DataLoader with request-scoped deduplication
and a TTL cache, streamed Suspense sections, proa-ui components that each
carry a Markdown representation (the same page serves /site/<host>.md for
command-line clients, retrieval pipelines, and agents), rsjs islands for the
interactive surfaces, Tailwind styling with a themed token set, self-hosted
fonts. The generated README.md doubles as
an editing guide.
Checkpoint: src/lib.rs, src/loader.rs, and src/components/ should
exist, and proa run dev --open shows the atlas.
Generated sites use the proa crate for their application API. Common types and
macros come from proa::, the Axum integration is proa::axum, and loaders live
under proa::stream. To add Proa 0.4 to an existing Axum application, use the following Cargo dependency.
[dependencies]
proa = { version = "0.4", features = ["axum", "rt-tokio"] }
You do not have to build common UI from scratch: proa-ui is a shadcn-style catalog of Proa components (badge, button, and card are already vendored in the starter). Run proa ui add alert to vendor another component into src/components/ where you own and edit the source directly.
The starter uses managed metadata. src/routes.rs enables the managed head once for the whole router with FrameworkBuilder::with_head, RootDocument declares ROLE = LAYOUT and places the {cx.head()} outlet, and each page declares ROLE = PAGE and sets its own metadata in render_head. The Basic app's home page sets a title and description, and the About page below sets only its title. See Layouts and Pages.
The remaining steps use the Basic app named hello-proa. If you chose
ORIGIN, follow its generated README.md and run commands inside origin-atlas.
3. Run The Server
cd hello-proa && proa run dev --open
proa dev builds configured assets, runs the linked RSJS pipeline, starts the
Axum server on http://localhost:3000, and restarts
when Rust, style, or config files change.
It compiles the site with your local Rust toolchain, and the generated
Cargo.toml declares rust-version = "1.98". If the build stops with a Cargo
error about the Rust version, check rustc --version and run
rustup update stable.
The first build downloads dependencies and compiles the Rust crates, which can
take several minutes. The terminal reports each build stage; --open waits
until the server accepts connections before opening your browser.
Open tabs reload themselves once the rebuilt server is accepting connections
again, so you do not have to refresh by hand. Stylesheet edits are applied
without navigating, which keeps scroll position and form state. Turn it off or
retune it with --no-reload, --no-css-hot-swap, and --debounce-ms; see
Live reload.
4. Edit The First Page
Set up your editor for Rust navigation and completion, including expressions inside raw Markdown templates.
Open src/pages/home.rs. The page's copy is defined once, in constants at the
top of the file. Change HEADLINE and LEDE:
const HEADLINE: &str = "Fast SSR, typed in Rust";
const LEDE: &str = "This page renders from a compiled template macro.";
Both representations read these constants. The HTML template in
impl<L: DataLoader> WebRender<L> for HomePage renders them as
<h1>{HEADLINE}</h1> and <p class="lede">{LEDE}</p>, and the Markdown
template in impl<L: DataLoader> MdRender<L> for HomePage renders them as
# {HEADLINE} and {LEDE}. The same templates compose DatabaseBadge and
DatabaseCard. Those children load the database status, so this page uses
async WebRender and html!. A static component can use WebRenderSync and
html_sync!, as shown by the About page below.
Proa's content-coverage lint compares rendered content across the two
implementations: remove {HEADLINE} from only one template and proa lint
reports render/content-coverage.
Your open tab reloads automatically once the rebuild finishes; open /index.md to see the Markdown representation too. Edit styles/starter.css to change the starter's design;
public/styles.css is the generated output and is rebuilt by Tailwind.
5. Add A Route
Create src/pages/about.rs:
use axum::response::IntoResponse;
use proa::{
to_async, ComponentRole, DataLoader, SyncHeadOperation, WebContext, WebRenderSync,
WriteError,
};
use proa::axum::RouteResponse;
use proa::html_sync;
use crate::layouts::RootDocument;
pub async fn handler() -> impl IntoResponse {
RouteResponse::ssr_async(RootDocument {
content: to_async(AboutPage {
heading: "About",
body: "This route renders from src/pages/about.rs.",
}),
})
}
struct AboutPage {
heading: &'static str,
body: &'static str,
}
impl<L: DataLoader> WebRenderSync<L> for AboutPage {
const ROLE: ComponentRole = ComponentRole::PAGE;
fn render_head(&self, cx: &mut WebContext<L>) -> impl SyncHeadOperation {
cx.head_mut().title(self.heading)
}
fn render(self, cx: &mut WebContext<L>) -> Result<(), WriteError> {
html_sync! {
<main data-component="about-page" class="mx-auto max-w-3xl px-6 py-16">
<h1 class="text-4xl font-semibold">{self.heading}</h1>
<p class="mt-4 text-zinc-600">{self.body}</p>
</main>
}
.render(cx)
}
}
Export it from src/pages/mod.rs, keeping the generated home module:
pub mod about;
pub mod home;
Register it in src/routes.rs, between the markers the generator maintains:
let (router, metadata) = router_from_spec(vec![
// proa:route-specs:start
Route::endpoint("/", get(pages::home::handler)),
Route::endpoint("/about", get(pages::about::handler)),
// proa:route-specs:end
]);
That is the whole route flow. RouteResponse renders the page and finalizes
the HTTP response, RootDocument supplies the shared page shell (it is
async-capable, so a synchronous page goes in through to_async), AboutPage
declares ROLE = PAGE and sets the document title in render_head (the router
already enables the managed head), and the fields passed to AboutPage are
compile-time-checked props. Add
page caching to the route spec when the
response should carry CDN cache headers. Add Axum extractors such as Path,
Query, or State to handler when the route needs request data.
Open http://localhost:3000/about. Check the route table:
proa site routes
Checkpoint: /about appears in the route report and renders in the browser.
6. Validate Before Moving On
Run Proa's source-aware checks before the full build:
proa fmt --check --verify src
proa lint src --deny warnings
proa test
proa build
proa fmt --check --verify checks the canonical template layout and verifies
that formatting would preserve the rendered output. proa lint understands
Proa render paths, so --deny warnings catches performance problems such as
intermediate rendered strings, avoidable allocations, and async renderers that
never await. Once those focused checks are clean, proa build validates the
complete linked application. proa test also checks both page representations
and that the two database components share one origin query.
Next steps
- Tutorial
- Add typed data, components, routes, and a form action.
- proa new site
- Scaffold a project and see where pages, layouts, components, and assets live.
- HTML rendering
- Render typed Rust values to HTML with render traits and the html! macros.
- Troubleshooting
- Fix the most common Proa setup, registry, template, component, island, routing, and CI failures.
- Deploy
- Pick a deployment target, then follow the guide for it.