litestar-vite

Automate Vite frontend integration with Litestar backends and TypeScript type generation.

13|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/litestar-org/litestar-skills --skill litestar-vite-litestar-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: litestar-vite
Source: https://github.com/litestar-org/litestar-skills/tree/main/plugins/litestar/skills/litestar-vite
Command: npx skills add https://github.com/litestar-org/litestar-skills --skill litestar-vite-litestar-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill removes the tedious, error-prone manual work of wiring a Vite frontend build pipeline to a Litestar backend, eliminating common pitfalls like mismatched asset paths, broken HMR, and out-of-sync type definitions between backend and frontend.

Core Features & Use Cases

  • Multi-mode fullstack support: Configure integrations for SPAs, server-rendered Jinja templates, HTMX hypermedia apps, Inertia hybrid apps, and framework-specific setups (Nuxt, SvelteKit, Astro) with a single consistent config pattern.
  • Automated end-to-end type generation: Sync Litestar OpenAPI schemas, route metadata, and Inertia page props to typed TypeScript utilities to eliminate runtime type errors between backend and frontend.
  • Use Case: A team building a React SPA with a Litestar JSON API can use this Skill to auto-configure HMR in development, generate a typed API client from their backend DTOs, and build production-ready hashed assets with a single command.

Quick Start

Use the litestar-vite skill to configure a new Litestar React SPA project with Vite dev server proxying, HMR support, and automatic TypeScript type generation from your existing Litestar routes and data transfer objects.

Frequently Asked Questions about litestar-vite

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate a Vite frontend with a Litestar backend?

Integrating Vite with Litestar involves automating dev-server proxying, HMR coordination, production asset resolution, and TypeScript type generation from OpenAPI schemas. It supports SPAs, Jinja templates, HTMX, and Inertia architectures using a single consistent config pattern.

How do I generate TypeScript types from Litestar OpenAPI schemas?

Generating TypeScript types from Litestar OpenAPI schemas involves syncing route metadata and Inertia page props to typed TypeScript utilities. This CI-friendly workflow prevents runtime type drift between backend DTOs and frontend clients.

Can I use HTMX or Inertia with a Litestar Vite setup?

Yes, you can use HTMX or Inertia with a Litestar Vite setup. The integration explicitly supports HTMX hypermedia apps, Inertia hybrid apps, SPAs, server-rendered Jinja templates, and framework-specific setups like Nuxt, SvelteKit, and Astro.

Why does Vite HMR break when connected to a Litestar dev server?

Vite HMR breaks when dev-server proxying is mismatched or version configuration is incorrect. Automating the Litestar Vite integration handles version-correct HMR configuration for Vite 7 and 8.1+, ensuring consistent dev and prod asset URLs.

What is the best way to configure Vite asset paths for Litestar in production?

The best way to configure Vite asset paths for Litestar in production is to automate production asset resolution through a unified build pipeline. This ensures consistent dev and prod asset URLs and generates production-ready hashed assets with a single command.