Getting Started#

Use these guides to move from installation to production runtime without bouncing between framework pages, demos, and reference docs.

Install and Wire It

Start with the plugin, the bridge file, path configuration, and the assets CLI.

Install and Configure
Development Workflow

Keep HMR, proxy mode, direct mode, and manual dev-server workflows on one page.

Development Workflow
Choose a Runtime Mode

Pick SPA, template, hybrid, or framework proxy mode based on how much frontend runtime you want.

Operation Modes
Generate Types

Export OpenAPI, routes, and Inertia page props into frontend-friendly TypeScript outputs.

Type Generation
Production and Deploy

Build assets, publish them, and hand manifest-backed bundles back to Litestar cleanly.

Production and Deploy

Quick Start#

app.py#
from litestar import Litestar
from litestar_vite import VitePlugin

app = Litestar(plugins=[VitePlugin()])
bootstrap a frontend#
litestar assets init --template react-inertia
litestar assets install
litestar run --reload

VitePlugin() selects development or production behavior without application-side VITE_DEV_MODE parsing. It also receives the effective host and port from either the built-in Uvicorn litestar run command or the Granian replacement.

For optional Rust-native production static serving with Granian 0.16+, add GranianPlugin(static="auto") without changing the Vite configuration:

app.py#
from litestar import Litestar
from litestar_granian import GranianPlugin
from litestar_vite import VitePlugin

app = Litestar(
    plugins=[
        VitePlugin(),
        GranianPlugin(static="auto"),
    ]
)

The Litestar static route remains available on every server. See Production and Deploy for eligibility, fallback behavior, and the server matrix.