Litestar Fullstack Inertia
A modern, production-ready fullstack reference application. It seamlessly integrates a Litestar (Python) backend with a React 19 (TypeScript) frontend using Inertia.js—eliminating the complexity of building separate APIs and SPAs.
🚀 Overview
This project serves as a comprehensive template for building scalable web applications. It comes pre-configured with best practices for authentication, database management, and deployment.
Features
- Authentication — Email/password login, registration, password reset
- OAuth — Sign in with GitHub or Google
- MFA — TOTP-based two-factor authentication
- Email Verification — Configurable verification flow
- Teams — Multi-tenant workspaces with invitations and member roles
- User Profiles — Avatar uploads, connected accounts management
- Admin Panel — Superuser management for users and teams
- Role-Based Access — Granular permission system
Tech Stack
| Component | Technology | Description |
|---|---|---|
| Backend | Litestar | High-performance ASGI framework. |
| Frontend | React 19 | UI library with TypeScript. |
| Glue | Inertia.js | Classic server-driven routing for SPAs. |
| Database | SQLAlchemy 2.0 | Modern async ORM. |
| Styling | Tailwind CSS | Utility-first CSS framework. |
| UI Kit | shadcn/ui | Reusable components built with Radix UI. |
| Tooling | uv | Extremely fast Python package manager. |
🛠️ Setup
Prerequisites:
- Python 3.12+
- Node.js & npm (or Bun)
- Docker & Docker Compose
uv(Install viacurl -LsSf https://astral.sh/uv/install.sh | sh)
Step-by-Step Installation
-
Clone the Repository
BASHgit clone https://github.com/litestar-org/litestar-fullstack-inertia.git cd litestar-fullstack-inertia -
Install Dependencies This installs both Python (virtualenv) and JavaScript dependencies.
BASHmake install -
Configure Environment Create the environment file from the example.
BASHcp .env.local.example .env -
Start Infrastructure Spin up PostgreSQL and Redis containers.
BASHmake start-infra -
Run Migrations & Seed Data Apply database schema and create default roles.
BASHuv run app database upgrade uv run app users create-roles -
Run the Application Start the development server (Backend + Vite HMR).
BASHuv run app run --reload
Measurable Outcome:
You should be able to access the application at http://localhost:8000. The API docs are available at http://localhost:8000/schema.
💻 Usage & Development
We use make to manage common development tasks.
Running Tests
Execute the full test suite (unit + integration).
make test
Outcome: All tests passed with a summary report.
Code Quality (Linting & Formatting)
Run all linters (Ruff, Mypy, Biome, Slotscheck).
make lint
Outcome: Zero errors reported. Code is formatted and type-checked.
Documentation
Build and serve the documentation locally.
make docs-serve
Outcome: Documentation running at http://localhost:8002.
Database Management
The application CLI handles database operations.
uv run app database --help
# Examples:
uv run app database make-migrations -m "add_user_field" # Create migration
uv run app database upgrade # Apply migrations
📂 Project Structure
├── app/ # Python Backend
│ ├── domain/ # Feature modules (accounts, teams, web)
│ ├── db/ # Models & Migrations
│ ├── server/ # App configuration & plugins
│ └── lib/ # Shared utilities
├── resources/ # Frontend Assets
│ ├── pages/ # Inertia Pages
│ ├── components/ # React Components (shadcn/ui)
│ └── layouts/ # Page Layouts
├── specs/ # Project Specifications & Guides
└── tests/ # Pytest Suite
🤝 Contribution
We welcome contributions! Please follow these steps:
- Fork & Clone the repository.
- Install dependencies using
make install. - Branch off
mainfor your feature/fix. - Implement your changes.
- Verify with
make testandmake lint. - Submit a Pull Request.
Note: This project uses Conventional Commits.
For more details, see CONTRIBUTING.rst.