Part 1 will introduce you to the basic tools you need to build a reactive user interface powered by Leptos and Rust. By the end of Part 1, you should be able to build a snappy synchronous website that's rendered in the browser and which you can deploy on any static-site hosting service, like Github Pages or Vercel.
To get the most out of this book, we encourage you to code along with the examples provided. In the Getting Started and Leptos DX chapters, we showed you how to set up a basic project with Leptos and Trunk, including WASM error handling in the browser. That basic setup is enough to get you started developing with Leptos.
If you'd prefer to get started using a more full-featured template which demonstrates how to set up a few of the basics you'd see in a real Leptos project, such as routing, (covered later in the book), injecting
<Meta> tags into the page head, and a few other niceties, then feel free to utilize the leptos-rs
start-trunk template repo to get up and running.
start-trunk template requires that you have
cargo-generate installed, which you can get by running
cargo install trunk and
cargo install cargo-generate.
To use the template to set up your project, just run
cargo generate --git https://github.com/leptos-community/start-csr
trunk serve --port 3000 --open
in the newly created app's directory to start developing your app. The Trunk server will reload your app on file changes, making development relatively seamless.