This project builds on the default Dioxus starter application generated by dx create. The initial boilerplate has been extended into a complete full‑stack template consisting of a Dioxus Web client, an Axum server, and a shared model layer. It includes authentication, session management, user maintenance screens, and a SQLite‑backed API. The goal is to provide a reusable foundation for new applications so common functionality does not need to be rebuilt for every project.
The template is split into two independent packages:
- client — a Dioxus Web application compiled to WASM
- server — an Axum HTTP API with session‑based authentication
- shared — common types used by both packages (e.g.,
User,LoginRequest)
This structure keeps concerns cleanly separated.
- Login form and API endpoint
- Session cookie management
- Server‑side session validation
- Role‑based access control (Admin vs User)
- User listing screen
- Create/edit user form
- Delete user workflow with confirmation modal
- Active/inactive user state
- Shared
Usermodel between client and server
- Axum router with modular handlers
- SQLite database using SQLx
- Database initialization logic
- Environment‑driven configuration (
RUST_SERVER_URL, etc.) - Basic unit tests for core logic
- Dioxus component structure
- Navigation and routing
- Signals for state management
- Async API calls using
gloo-net - Error handling and loading states
Building a new Dioxus project often requires re‑implementing the same foundational pieces:
- login flow
- session handling
- user management
- API wiring
- database setup
- shared types
This template provides all of these components pre‑built so new projects can start from a stable, production‑ready baseline. It reduces boilerplate and accelerates development by letting you focus on application‑specific features rather than infrastructure.
project/
├─ client/
│ ├─ assets/
│ ├─ src/
│ ├─ components/
│ ├─ pages/
│ ├─ services/
│ ├─ state/
│
├─ server/
│ ├─ src/
│ ├─ sql/
│
├─ shared/
├─ src/
-
Set required environment variables:
RUST_SERVER_URL— server bind address (eg. '127.0.0.1:3000')RUST_CLIENT_URL— client bind address (eg. 'https://127.0.0.1:8080')RUST_DB_PATH— path for the default sqlite users.db file (eg. 'C:\db_data\')RUST_ADMIN_EMAIL— admin user's email address (eg. 'initial_admin@email.com')RUST_ADMIN_PASSWORD— admin user's temporary password which has to be changed at first login (eg. 'Rust1s@wesome')
-
Start the server:
cargo run -p server
or
dx serve --package server
-
Set required environment variables:
RUST_SERVER_URL— server bind address (eg. '127.0.0.1:3000')
-
Start the client:
dx serve --package client --platform web --port 8080
-
Open a new tab in your browser and paste in your client url (eg. 'http://127.0.0.1:8080')
-
Log into the application using the initial admin credentials and provide a new password
-
In the user maintenance section, add a new admin and delete the initial admin (recommended once custom emailing code has been set up to send password reset link)