This is a leptos demo application that will help anyone who wants a hands-on and learn by experimenting in a working example.
It includes:
Leptos
actix-web
SSR
DB integration (sqlite)
Modal Window
To test it out, clone the repo and run.
git clone https://github.com/santhosh7403/demo-tools-app-leptos-07-actix-tailwind.git
cd demo-tools-app-leptos-07-actix-tailwind
cargo leptos watch
or cargo leptos serve
This expects cargo-leptos is installed already, if you don't have cargo-leptos
installed you can install it with
cargo install cargo-leptos --locked
By default, cargo-leptos
uses nightly
Rust, cargo-generate
etc. If you run into any trouble, you may need to install one or more of these tools.
rustup toolchain install nightly --allow-downgrade
- make sure you have Rust nightlyrustup target add wasm32-unknown-unknown
- add the ability to compile Rust to WebAssemblycargo install cargo-generate
- install cargo-generate
binary (should be installed automatically in future) # Update(2025-04-18)
This app build seems breaking with 1.88.0.nightly release, with below error:
error[E0599]: no method named `source_file` found for struct `memo::proc_macro::Span` in the current scope
--> /home/santhosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/leptos_macro-0.7.8/src/lib.rs:360:22
|
360 | site.source_file().path(),
| ^^^^^^^^^^^
|
help: there is a method `source` with a similar name
|
360 - site.source_file().path(),
360 + site.source().path(),
As a work around for now, adding a rust-toolchain.toml config file to force it to use 1.87.0 , at the project root folder.
You may need install it with rustup as below.
`rustup toolchain install nightly-2005-03-05-x86_64-unknown-linux-gnu` - add this channel
`rustup target add wasm32-unknown-unknown` - adding wasm target to the newly added channel
Now you may run the build.
`cargo leptos watch` or `cargo leptos serve`
Once application started, access application from you web browser localhost:3000
Here are some screenshots.
References and thanks:
This project is fork of the above (from 1) and in top of it following updates:
leptos version 0.6 to 0.7 upgrade (breaking changes).
tailwindcss applied.
Modal window integrated (from 2).