From the course: Full-Stack Web Applications with Rust and Leptos
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Leptos project structure and build process
From the course: Full-Stack Web Applications with Rust and Leptos
Leptos project structure and build process
- [Instructor] Now that you have your first Leptos project up and running, let's get a high-level overview of how the project is structured. Leptos is somewhat unique in that it's a full-stack framework. So in the same project, you'll have code that is run only on the back end, code that is run only on the front end, and some code that might be run in either place. The way Leptos projects are structured is influenced by the way Rust projects are structured in general. You might recall that there are two main types of Rust crates, binaries and libraries. A Rust package, which is represented by the directory that the cargo.toml file is in may contain multiple crates; at most one library crate and an unlimited number of binary crates. A Leptos project puts the front-end code in a library crate and the back-end code in a binary crate. Both crates are located inside the package represented by the project directory, and the cargo.toml file in it. If we look at the cargo.toml of our project,…