Cookbook
Cookbook
Recipes for what every app does. Each is a module of one Rust crate that is compiled and tested, with the lines that call it from Swift, Kotlin and TypeScript.
RecipeAuthRecipePaginationRecipeFormsRecipeFile uploadRecipeReal-timeRecipeLive leaderboardRecipeOffline-firstRecipeYour network stackRecipeYour own portMovingFrom Kotlin MultiplatformMovingFrom UniFFIRecipeiOS 15 and 16SampleSample app: Fieldbook
How these are made#
- Every Rust sample is compiled and run. The recipes are one crate,
examples/cookbook, a module each, and every page quotes it.cargo test -p cookbookruns each against the test runtime and the fakes, so a recipe is a test, not a paragraph. - Every platform line compiles. The Swift, Kotlin and TypeScript on these pages are checked in CI against the bindings generated from that crate:
swift buildin Swift 6 mode,kotlinc -Werrorandtsc --strict. - Code is collapsed. Each page says the idea in a few lines and keeps the code one click away.
Where to start#
- An app with a login? Auth, then offline-first.
- A big list that changes fast? Live leaderboard: 100,000 players, a snapshot and a delta stream, with the core lock held for under a microsecond.
- Something only the platform can do? Your own port: declared in Rust, implemented in Swift, Kotlin and TypeScript, with what Xcode 26's default main-actor isolation makes of a Swift conformer.
- An existing codebase? From Kotlin Multiplatform or from UniFFI: three steps, the first one small.
- Want it all in one place? Fieldbook, field notes with photos, uses the recipes together on the web, iOS and Android.