Introduction
Learn about the DX SaaS Template — a fullstack Rust starter built with Dioxus 0.7
What is DX SaaS Template?
DX SaaS Template is a production-ready fullstack SaaS starter built entirely in Rust. It uses Dioxus 0.7 for both the server and the WASM client, compiled from a single codebase via Cargo feature flags.
Everything compiles to two binaries: a server (Axum + SSR) and a WASM client — from the same source tree.
Stack Overview
Dioxus 0.7
Fullstack Rust framework with SSR, hydration, server functions, and a React-like component model.
PostgreSQL
Relational database accessed with sqlx. Schema lives in migrations/ and is applied automatically on startup.
FerrisKey
Open-source, Rust-native OIDC identity provider with WebAuthn/passkey support. The template ships a custom login UI driving FerrisKey's REST API.
TailwindCSS + DaisyUI
Utility-first CSS with DaisyUI 5 component library. Dark theme by default.
Architecture
The project uses feature-gated compilation to split code between server and client:
#[cfg(feature = "server")]— Server-only code (PostgreSQL, Axum, sessions)#[cfg(feature = "web")]— Client-only code (WASM bindings, browser APIs)
Server functions use the #[post("/api/...")] macro and can accept a session: auth::UserSession parameter for authentication.
Project Structure
src/
├── main.rs # Dual entry point (server + client)
├── routes.rs # Route enum with layouts
├── pages/ # Page components (Home, Dashboard, Settings, Docs)
├── components/ # Shared UI (Navbar, DashboardShell, Toasts)
├── models/ # Shared types (LoggedInData, AppError)
└── server/ # Server-only (AppState, Config, Database)
crates/
├── auth/ # FerrisKey OIDC + custom login UI + session management
├── crypto/ # Argon2, AES-256-GCM, token generation
├── smtp/ # Email sending via lettre
├── polar/ # Polar.sh billing API
└── storage/ # S3-compatible object storage (AWS, MinIO, R2, Spaces)Optional features
--features sentryenables Sentry error tracking and tracing breadcrumbs (requiresSENTRY_DSN).