Skip to content

πŸš€ Fleting Framework for Flet Python

Build cross-platform applications with Python, Flet, and MVC β€” faster than ever.

Python Flet License PRs Welcome


πŸ‡ΊπŸ‡Έ English | πŸ‡§πŸ‡· PortuguΓͺs | πŸ‡ͺπŸ‡Έ EspaΓ±ol


What is Fleting?

Fleting is a lightweight, opinionated micro-framework built on top of Flet. It brings the power of MVC architecture, clean code organization, and rapid development to Python developers building cross-platform applications.

Whether you're creating a mobile app, a desktop tool, or a tablet-friendly dashboard β€” Fleting gives you the structure and tools to ship faster.

✨ Key Highlights

  • ⚑️ MVC Architecture β€” Clear separation of concerns
  • πŸ“± Mobile-First β€” Automatically adapts to mobile, tablet, and desktop
  • 🌍 Built-in i18n β€” Multi-language support out of the box
  • πŸ› οΈ Productive CLI β€” Generate pages, models, controllers, and more
  • πŸ—„οΈ Multi-Database Support β€” SQLite and MySQL (PostgreSQL & SQL Server coming soon)
  • 🎨 Decoupled Layouts β€” Reusable, responsive UI components
  • 🚦 Simple Routing β€” Clean, declarative route definitions
  • πŸ§ͺ Built-in ORM β€” Lightweight model layer with relationships

🎯 Who is Fleting for?

πŸ‘¨β€πŸ’» Solo Developers 🏒 Teams πŸ“š Students
Build apps fast without over-engineering Standardized project structure Learn MVC in Python
One framework for mobile + desktop Easy onboarding for new members Practice real-world architecture

⚠️ Important change to the Fleting foundation

Version Fleting 1.2.3 was originally built upon Flet 0.8.x.

As of this update, the project now uses Flet 1.0.5 as its foundation. In other words:

  • Before: Fleting 1.2.3 + Flet 0.8.x
  • Now: Fleting 1.2.3 + Flet 1.0.5

This update incorporates the stability, performance, and API improvements found in Flet 1.0, but it also introduces breaking changes compared to Flet 0.8.x. If you have existing code written for the older Flet API, please review the points below before migrating:

  • Services are now asynchronous and independent of the page object (e.g., await ft.SharedPreferences() instead of page.client_storage).
  • Most explicit calls to page.update() are no longer required.
  • UserControl has been removed; custom components now inherit directly from controls (e.g., ft.Row, etc.).
  • Some controls have been renamed (e.g., ElevatedButton β†’ Button).

Please refer to the official Flet migration guide for further details.


πŸš€ Quick Start

Get your first Fleting app running in under 3 minutes:

1. Create an isolated virtual environment

Choose your preferred tool:

πŸ“¦ Using uv (Recommended)
# Install uv if you don't have it
pip install uv

# Create a new project with uv
uv init myapp
cd myapp

# Create and activate virtual environment
uv venv

# Activate on Linux/macOS
source .venv/bin/activate

# Activate on Windows (PowerShell)
.venv\Scripts\activate

# Install dependencies
uv pip install flet fleting
🐍 Using venv (Standard)
# Create virtual environment
python -m venv venv

# Activate on Linux/macOS
source venv/bin/activate

# Activate on Windows (PowerShell)
venv\Scripts\activate

# Activate on Windows (CMD)
venv\Scripts\activate.bat

# Install dependencies
pip install flet fleting
πŸ“‹ Using Poetry
# Install Poetry
pip install poetry

# Create new project
poetry new myapp
cd myapp

# Add dependencies
poetry add flet fleting

# Activate environment
poetry shell

2. Create a new project

pip install flet fleting
fleting init myapp
cd myapp

3. Run your app

fleting run

That's it! πŸŽ‰ You now have a working cross-platform application with:

βœ… Multi-language support (English, Portuguese, Spanish)

βœ… Responsive layout (mobile, tablet, desktop)

βœ… MVC architecture

βœ… SQLite database ready


πŸ§ͺ Want MySQL or MariaDB instead?

pip install "fleting[mysql]"      # MySQL
pip install "fleting[mariadb]"    # MariaDB (PyMySQL)
fleting init myapp --mysql

πŸ› οΈ Fleting CLI Commands

πŸ“¦ Project Commands

Command Description
fleting init <app_name> Initialize a new Fleting project
fleting init <app_name> --mysql Initialize a new Fleting project with MySQL / MariaDB
fleting info Show version and system information
fleting run Run the application
fleting doctor Check the project for common problems

βž• Create Commands

Command Description
fleting create page <name> Create a page (model + controller + view)
fleting create view <name> Create a new view
fleting create model <name> Create a new model
fleting create controller <name> Create a new controller

πŸ—‘οΈ Delete Commands

Command Description
fleting delete page <name> Delete an existing page
fleting delete view <name> Delete a view
fleting delete model <name> Delete a model
fleting delete controller <name> Delete a controller

πŸ“‹ List Commands

Command Description
fleting list pages List all pages
fleting list controllers List all controllers
fleting list views List all views
fleting list models List all models
fleting list routes List all routes

πŸ—„οΈ Database Commands

Command Description
fleting db init Initialize the database (SQLite by default)
fleting db init --mysql Switch the project to MySQL / MariaDB (with .bak backups)
fleting db init --sqlite Switch the project back to SQLite
fleting db migrate Run database migrations
fleting db seed Seed the database with initial data
fleting db make <name> Create a new migration
fleting db rollback Rollback the last migration
fleting db status Show current database migration status

πŸ—„οΈ Database / Models Commands

Command Description
fleting db model pull Generate models from the database schema
fleting db model pull <table> Generate model for a specific table
fleting db model pull <table> --force Overwrite existing model files

🧩 Console Commands

Command Description
fleting shell Open interactive database shell (SQLite, MySQL / MariaDB)

πŸ“Š Command Categories Summary

Category Commands
Project init, info, run, doctor
Create create page, create view, create model, create controller
Delete delete page, delete view, delete model, delete controller
List list pages, list controllers, list views, list models, list routes
Database db init, db migrate, db seed, db make, db rollback, db status
Models db model pull
Console shell

πŸ“± Built for the Real World

Mobile-First by Design Fleting automatically detects the device type and adapts layouts accordingly:

from core.state import AppState

if AppState.device == "mobile":
    # Show mobile-optimized UI
elif AppState.device == "tablet":
    # Show tablet-optimized UI
else:
    # Show desktop-optimized UI

Built-in Internationalization

Support multiple languages with simple JSON files:

{
  "app": {
    "name": "MyApp"
  },
  "home": {
    "title": "Welcome to MyApp"
  }
}
from core.i18n import I18n

# Display translated text
I18n.t("home.title")  # "Welcome to MyApp" in English
I18n.t("home.title")  # "Bem-vindo ao MyApp" in Portuguese
I18n.t("home.title")  # "Bienvenido a MyApp" in Spanish

Database Support

Engine Status Use Case
SQLite βœ… Stable Development, embedded apps
MySQL βœ… Stable Production, web applications
MariaDB βœ… Stable Production (PyMySQL driver recommended)
PostgreSQL πŸ”„ Coming Soon Enterprise applications
SQL Server πŸ”„ Coming Soon Enterprise integrations

πŸ“Š Project Structure

Fleting generates a clean, organized project structure:

myapp/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ controllers/   # Business logic
β”‚   β”œβ”€β”€ models/        # Data layer
β”‚   └── views/         # UI components
β”‚       β”œβ”€β”€ layouts/   # Reusable layouts
β”‚       └── pages/     # Page views
β”œβ”€β”€ configs/           # Configuration files
β”‚   β”œβ”€β”€ app_config.py
β”‚   β”œβ”€β”€ routes.py
β”‚   └── languages/     # i18n translations
β”œβ”€β”€ core/              # Framework core
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ router.py
β”‚   β”œβ”€β”€ database.py
β”‚   β”œβ”€β”€ i18n.py
β”‚   └── migrations.py
β”œβ”€β”€ migrations/        # Database migrations
β”œβ”€β”€ seeds/             # Seed data
└── main.py            # Application entry point

πŸ“š Learning Resources

Resource Description Link
πŸ“– Fleting Documentation Complete framework documentation
πŸŽ“ Fleting Course Step-by-step video course
🐍 Flet Documentation Underlying Flet framework
πŸ€– FLAI – Local AI Framework for Fleting Local AI for Fleting apps

🎯 Philosophy

Fleting was built on clear principles:

1️⃣ Simplicity Above All

  • No unnecessary abstractions
  • Explicit, readable code
  • Predictable architecture

2️⃣ Separation of Responsibilities

  • View β†’ Pure UI (Flet)
  • Layout β†’ Reusable visual structure
  • Controller β†’ Business logic
  • Model β†’ Data layer
  • Router β†’ Navigation
  • Core β†’ Framework infrastructure

3️⃣ Mobile-First

  • Automatic device detection
  • Dynamic layout adaptation
  • Touch-friendly components

4️⃣ Native Internationalization

  • Simple JSON translations
  • Real-time language switching
  • Accessible anywhere in the app

5️⃣ CLI as a First-Class Citizen

  • Standardized code generation
  • Reduced boilerplate
  • Convention over Configuration

🀝 Contributing

We welcome contributions! Whether it's:

Check out our Contributing Guide to get started.

πŸ“„ License

MIT License β€” Use it freely in personal and commercial projects.

πŸ’¬ Get Help

  • πŸ“– Read the Docs
  • πŸ› Report Issues
  • πŸ’¬ Contact the Author

⭐️ Star us on GitHub β€” it helps!

GitHub stars

```


Fleting Framework