Loading...
Loading...
Everything you need to be productive with Ossido, grouped by subject and ordered roughly from your first day to advanced topics. More chapters are landing soon.
How Ossido fits a React frontend and a Rust (axum) backend into one project: the two runtimes, the request lifecycle, and the Rust/React boundary.
Prerequisites, scaffolding with create-ossido or the ossido CLI, the wizard, feature flags, and the project layout.
"ossido dev", "build", "new", "doctor", and "upgrade" - what each command does, and the generated .ossido/ directory.
ossido.config.ts: server options, output mode, render threads, logging, Vite passthrough, and path aliases.
The src/routes convention: pages and handlers, dynamic and catch-all segments, layouts, loading, error and not-found UI, API routes, and middleware.
The src/app.rs entry: application state, dependency injection by parameter name, and logging.
A typed Environment struct as the source of truth: parsed at startup, read with get_env! in Rust and getEnv on the frontend, with #[public] fields exposed and .env files loaded automatically.
Page and layout handlers, how they run, the Request extractor, the Props/Type macros, returning data, and cookies.
HTTP endpoints with #[api] under src/routes/api: methods, returning JSON, reading the request body, and API-scoped middleware.
Mutations with #[action]: a Rust function the build mirrors into a typed TypeScript one, called from React as an RPC, a <Form>, or with useActionState - plus stateful actions and error handling.
First-class realtime: typed, directional events declared with #[server_ws_event] / #[client_ws_event], a single #[ws] handler in src/ws.rs, the global SocketManager connection store keyed by anything, and a typed connect() client.
Tower layers on the request pipeline: defining middleware, composing several with ServiceBuilder, and ordering.
How handler panics and expected failures are handled, the error page and dev overlay, and hooking every error with set_error_handler.
Server rendering, static generation with #[static_paths], streaming HTML, top-level await, and the render pool.
Typed page components, layouts and children, client navigation with ossido-router, head/metadata, boundaries, hydration, and preloading.
Call your #[api] routes from the frontend with ossido/client: paths, params, and JSON responses inferred from your Rust routes.
Generated types from Rust Type macros, end-to-end type-safe props, and keeping tsconfig and path aliases in agreement.