Project Structure

ResumaApp (basic/todo templates) and FlowApp (multi-page) project layouts.

Top-level layout

A flow starter is a standard Rust binary crate. The CLI generates Cargo.toml, src/main.rs, and a pages directory for file-based routing.

my-app/
├── Cargo.toml
├── src/
│   ├── main.rs
│   └── pages/
│       ├── index.rs
│       ├── layout.rs
│       ├── mod.rs
│       └── _registry.rs

Cargo.toml

Depend on the umbrella crate — core + Flow in one dependency.

[package]
name = "my-app"
version = "0.1.0"
edition = "2021"

[dependencies]
resuma = { version = "0.3", default-features = false }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }

src/main.rs

Wire FlowApp, layouts, and auto-discovered pages. Layouts use #[layout] with a URL prefix; pages live under src/pages.

use resuma::prelude::*;
mod pages;
use pages::PagesRegistry;

#[layout("/")]
fn AppLayout() -> View {
    view! {
        <header>"My App"</header>
        <Slot />
    }
}

#[tokio::main]
async fn main() -> std::io::Result<()> {
    FlowApp::new()
        .with_title("My App")
        .streaming(true)
        .auto_pages("src/pages", PagesRegistry)
        .not_found(|| not_found_page())
        .serve(FlowServeOptions::default())
        .await
}

Pages directory

Each .rs file under src/pages maps to a URL. Run resuma routes --generate after adding or renaming pages.

src/pages/
├── index.rs          → /
├── about.rs          → /about
├── blog/
│   ├── index.rs      → /blog
│   └── [slug].rs     → /blog/:slug
├── users/
│   └── [id].rs       → /users/:id
├── layout.rs         → layout marker (not a route)
├── mod.rs            → generated module tree
└── _registry.rs      → generated PagesRegistry

Generated files

Do not edit mod.rs or _registry.rs by hand — regenerate with:

resuma routes --generate --path src/pages

CLI templates

Scaffold with resuma new --template basic or --template todo.

basic / todo (ResumaApp)

my-app/
├── Cargo.toml
└── src/
    ├── main.rs          # ResumaApp + routes
    ├── security.rs      # (todo template only)
    └── todo_store.rs    # (todo template only)

Flow (manual or flow-pages example)

Multi-page apps use FlowApp and src/pages/. See examples/flow-pages in the repo.