Skip to content

A scalable, modular Litestar boilerplate with layered architecture, DDD-lite patterns, and essential tools like Alembic, SQLAlchemy, and Poetry. Ready for production or prototyping.

Notifications You must be signed in to change notification settings

dan1901/litestar-templates

Repository files navigation

🇺🇸 English | 🇰🇷 한국어

Litestar Boilerplate Collection

🚀 Production-ready boilerplates for modern and scalable Python web applications

CI/CD Pipeline Python 3.11+ Litestar License: MIT Code style: ruff Checked with mypy

A collection of 3 Litestar-based project structure boilerplates.

✨ Key Features

  • 🏗️ 3 Architecture Patterns: Support for Layered, DDD-lite, and Feature-based structures
  • 🌍 Multilingual CLI: Korean/English support for global development teams
  • Ready to Use: Complete CRUD, authentication, and testing structure included
  • 🔧 Modern Stack: Based on Litestar 2.0, SQLAlchemy 2.0, Pydantic V2
  • 📚 Rich Documentation: Detailed guides for each architecture
  • 🧪 Test-First: Complete testing environment with pytest

🏛️ Architecture Types

1. Layered + Controller-Centric Structure (layered/)

Traditional layered architecture with controller-centric structure

  • Clear layer separation (Controller, Service, Repository, Model)
  • MVC pattern based
  • Simple and easy to understand structure

2. DDD-lite (ddd-lite/)

Lightweight structure applying core concepts of Domain-Driven Design

  • Domain-centric modeling
  • Aggregates and domain services
  • Hexagonal architecture elements

3. Feature-based Modular (feature-based/)

Structure modularized by features

  • Complete encapsulation by features
  • Vertical slicing
  • Easy transition to microservices

🚀 Usage

# Install CLI tool
pip install -e .

# Create new project
litestar-boilerplate create --type layered --name my-project
litestar-boilerplate create --type ddd-lite --name my-project
litestar-boilerplate create --type feature-based --name my-project

# List templates
litestar-boilerplate list-templates

# Help
litestar-boilerplate --help

🌍 Language Support

This CLI tool supports Korean and English:

# Use Korean
litestar-boilerplate --language ko list-templates

# Use English (default in English environment)
litestar-boilerplate --language en list-templates

# Short option
litestar-boilerplate -l ko create --type layered --name my-app

📋 Multi-language README:

📋 Requirements

  • Python 3.11+
  • Litestar 2.0+
  • SQLAlchemy 2.0+
  • Alembic
  • Pydantic V2

🛠️ Development Setup

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
# venv\Scripts\activate  # Windows

# Install dependencies and dev dependencies
pip install -e ".[dev]"

🧩 Litestar Resources

📖 Official Documentation & Repositories

🎓 Learning Resources

🛠️ Tools & Plugins

📚 Detailed Documentation

For detailed documentation and examples of each structure, refer to the README in the respective directory.

🤝 Contributing

If you'd like to contribute to this project, please create an issue or submit a pull request. All contributions are welcome!

📄 License

This project is distributed under the MIT License.

About

A scalable, modular Litestar boilerplate with layered architecture, DDD-lite patterns, and essential tools like Alembic, SQLAlchemy, and Poetry. Ready for production or prototyping.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages