Lila Framework

A Python web framework built on Starlette and Pydantic, designed for simplicity, flexibility, and high performance.

Lila is a lightweight yet powerful Python web framework that combines the async capabilities of Starlette with the data validation power of Pydantic. It provides everything you need to build modern web applications and REST APIs with minimal boilerplate.

🚀 Getting Started

Install Lila via pip and initialize your project with the CLI:

Terminal
pip install lila-framework
lila-init
python main.py

📁 Project Structure

The lila-init command scaffolds your entire project structure:

  • 📂 app/routes/ — Route definitions for your application and API endpoints
  • 📂 app/models/ — SQLAlchemy models for database tables
  • 📂 core/middleware.py — Core middleware functions for authentication, logging, and security
  • 📂 core/ — Framework core logic (routing, templates, session, auth, files, security, etc.)
  • 📂 app/locales/ — Translation files for internationalization (i18n)
  • 📄 app/connections.py — Database connection configuration (SQLite, MySQL, PostgreSQL)
  • 📄 app/config.py — Application settings and environment configuration
  • 📂 templates/ — Jinja2 templates for server-side rendering
  • 📂 public/ — Static files (CSS, JS, images)
  • 🐍 main.py — Application entry point
  • 🔒 .env — Environment variables (HOST, PORT, DEBUG, SECRET_KEY)

✨ Core Features

🖥️ CLI Commands

All CLI commands follow the pattern lila-{command}:

  • 🚀 lila-init — Initialize a new Lila project
  • 📦 lila-model — Generate SQLAlchemy models with CRUD methods
  • 🗄️ lila-migrations — Run database migrations
  • 🔐 lila-auth — Scaffold authentication (login, register, password reset)
  • 🏗️ lila-scaffold-crud — Generate complete CRUD from a model
  • 👤 lila-create-panel-admin — Create admin panel with dashboard
  • 🔑 lila-create-admin — Create an admin user
  • ⚛️ lila-react — Setup React Islands integration
  • lila-minify — Minify CSS and JS files for production

📚 Documentation

Explore each section in the sidebar to learn about every feature in detail. Start with Installation to set up your first project.