A full-stack web application built with Leptos and Actix Web, featuring server-side rendering (SSR) with client-side hydration.
- 🦀 Rust Full-Stack - Both server and client written in Rust
- ⚡ Server-Side Rendering - Fast initial page loads with SSR
- 💧 Hydration - Seamless client-side interactivity via WebAssembly
- 🎨 SCSS Styling - Modern styling with Sass
- 🔄 Reactive UI - Fine-grained reactivity with Leptos signals
- Rust (nightly)
- cargo-leptos:
cargo install cargo-leptos - wasm-bindgen-cli:
cargo install wasm-bindgen-cli - WASM target:
rustup target add wasm32-unknown-unknown
Windows (PowerShell):
.\scripts\setup.ps1Linux/macOS:
chmod +x scripts/setup.sh && ./scripts/setup.shThe setup script will:
- Install Rust nightly toolchain
- Add wasm32-unknown-unknown target
- Install matching wasm-bindgen-cli version
- Install cargo-leptos
- Set up e2e test dependencies (if npm available)
cd rust-chatbot
cargo leptos serveThis builds both WASM and server, then runs the dev server with hot reload at http://127.0.0.1:3000
For production build:
cargo leptos build --releaseIf cargo-leptos has issues, use the build scripts:
Windows (PowerShell):
.\scripts\build.ps1
.\target\debug\rust-chatbot.exeLinux/macOS:
./scripts/build.sh
./target/debug/rust-chatbotOr run the commands manually:
# 1. Build WASM
cargo build --lib --target wasm32-unknown-unknown --features hydrate --no-default-features
# 2. Generate JS bindings
wasm-bindgen --target web --out-dir target/site/pkg --out-name rust-chatbot target/wasm32-unknown-unknown/debug/rust_chatbot.wasm
# 3. Copy CSS
cp style/main.scss target/site/pkg/rust-chatbot.css
# 4. Build server
cargo build --bin rust-chatbot --features ssr --no-default-features
# 5. Run
./target/debug/rust-chatbotThen open http://127.0.0.1:3000
rust-chatbot/
├── scripts/
│ ├── setup.ps1 # Windows setup script
│ ├── setup.sh # Unix setup script
│ ├── build.ps1 # Windows build script
│ └── build.sh # Unix build script
├── src/
│ ├── app.rs # Main application component
│ ├── lib.rs # WASM hydration entry point
│ └── main.rs # Server entry point
├── style/
│ └── main.scss # Styles
├── assets/ # Static assets
├── end2end/ # Playwright e2e tests
├── Cargo.toml # Dependencies and metadata
├── rust-toolchain.toml # Rust version specifier
└── README.md
cd end2end
npm install
npx playwright testwasm-bindgen version mismatch:
Make sure the CLI version matches your Cargo.toml dependency:
wasm-bindgen --version
cargo tree -p wasm-bindgenIf they differ, install the matching CLI version:
cargo install wasm-bindgen-cli --version <VERSION>ARYPROGRAMMER
This project is released into the public domain under the Unlicense.
See the LICENSE file for details.