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.

Stack Overview

Dioxus 0.7

Fullstack Rust framework with SSR, hydration, server functions, and a React-like component model.

PostgreSQL

Relational database accessed via sqlx. Schema is managed by SQL files in migrations/ and applied at startup with sqlx::migrate!.

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 via sqlx, 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, *_repo.rs data access)

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 sentry enables Sentry error tracking and tracing breadcrumbs (requires SENTRY_DSN).

Next Steps

Navigation