A web application completely written in Rust. 🌍
Rust
2,250
1,848 commits
updated Oct 8, 2026
Target of this project is to write a complete web application including backend and frontend within Rust.
graph LR
A[Leptos / WASM<br>in browser] -->|SSR / RPC| B[Axum<br>HTTP Server]
B --> C[SQLx]
C --> D[(PostgreSQL)]
| Component | Technology |
|---|---|
| Frontend | Leptos (WebAssembly with SSR + hydration) |
| Backend | Axum (via leptos_axum) |
| Database | PostgreSQL (via SQLx) |
| Auth | JWT tokens (jsonwebtoken) + Argon2 password hashing |
The application uses Leptos server functions to communicate between frontend and backend, eliminating the need for a separate REST API layer. Both server and client are compiled from a single Rust crate.
/healthz) for container orchestrationcargo install cargo-leptoswasm32-unknown-unknown target: rustup target add wasm32-unknown-unknowncargo install wasm-bindgen-cliStart a PostgreSQL instance:
docker run -d --name postgres \
-e POSTGRES_USER=webapp \
-e POSTGRES_PASSWORD=webapp \
-e POSTGRES_DB=webapp \
-p 5432:5432 \
postgres:17
Run the application:
export DATABASE_URL=postgres://webapp:webapp@localhost/webapp
cargo leptos watch
The application will be available at http://127.0.0.1:3000.
Register a new account using the "Register" link on the login page, then log in with your credentials.
| Environment Variable | Description | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgres://localhost/webapp |
JWT_SECRET | Secret key for JWT token signing | change-me-in-production |
LEPTOS_SITE_ADDR | Server listen address | 127.0.0.1:3000 |
Build and run as a container:
docker build -t webapp .
docker run -p 3000:3000 \
-e DATABASE_URL=postgres://webapp:webapp@host.docker.internal/webapp \
webapp
cargo fmt --check # Check formatting
cargo clippy --features ssr -- -D warnings # Lint server code
cargo test --features ssr # Run tests
cargo leptos build # Build for development
cargo leptos build --release # Build for production
You want to contribute to this project? Wow, thanks! So please just fork it and send me a pull request.
(top 24 of 31)
365 followers · starred Jul 2018
137 followers · starred Jul 2018
312 followers · starred Aug 2022
98 followers · starred Jul 2018
A web application completely written in Rust. 🌍
Rust
2,250
1,848 commits
updated Oct 8, 2026
Target of this project is to write a complete web application including backend and frontend within Rust.
graph LR
A[Leptos / WASM<br>in browser] -->|SSR / RPC| B[Axum<br>HTTP Server]
B --> C[SQLx]
C --> D[(PostgreSQL)]
| Component | Technology |
|---|---|
| Frontend | Leptos (WebAssembly with SSR + hydration) |
| Backend | Axum (via leptos_axum) |
| Database | PostgreSQL (via SQLx) |
| Auth | JWT tokens (jsonwebtoken) + Argon2 password hashing |
The application uses Leptos server functions to communicate between frontend and backend, eliminating the need for a separate REST API layer. Both server and client are compiled from a single Rust crate.
/healthz) for container orchestrationcargo install cargo-leptoswasm32-unknown-unknown target: rustup target add wasm32-unknown-unknowncargo install wasm-bindgen-cliStart a PostgreSQL instance:
docker run -d --name postgres \
-e POSTGRES_USER=webapp \
-e POSTGRES_PASSWORD=webapp \
-e POSTGRES_DB=webapp \
-p 5432:5432 \
postgres:17
Run the application:
export DATABASE_URL=postgres://webapp:webapp@localhost/webapp
cargo leptos watch
The application will be available at http://127.0.0.1:3000.
Register a new account using the "Register" link on the login page, then log in with your credentials.
| Environment Variable | Description | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgres://localhost/webapp |
JWT_SECRET | Secret key for JWT token signing | change-me-in-production |
LEPTOS_SITE_ADDR | Server listen address | 127.0.0.1:3000 |
Build and run as a container:
docker build -t webapp .
docker run -p 3000:3000 \
-e DATABASE_URL=postgres://webapp:webapp@host.docker.internal/webapp \
webapp
cargo fmt --check # Check formatting
cargo clippy --features ssr -- -D warnings # Lint server code
cargo test --features ssr # Run tests
cargo leptos build # Build for development
cargo leptos build --release # Build for production
You want to contribute to this project? Wow, thanks! So please just fork it and send me a pull request.
(top 24 of 31)
365 followers · starred Jul 2018
137 followers · starred Jul 2018
312 followers · starred Aug 2022
98 followers · starred Jul 2018