| 🇺🇸 English | 🇧🇷 Português | 🇪🇸 Español |
Fleting is an opinionated micro-framework built on top of Flet, focused on:
- Simplicity
- Clear organization
- Productivity
- Cross-platform applications (mobile, tablet, and desktop)
It features an architecture inspired by MVC, with a decoupled layout, simple routing, i18n, automatic responsiveness, a CLI for code generation and a small ORM with migrations for SQLite, MySQL and MariaDB.
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
pageobject (e.g.,await ft.SharedPreferences()instead ofpage.client_storage). - Most explicit calls to
page.update()are no longer required. UserControlhas 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.
- MySQL & MariaDB support end to end:
fleting init <app> --mysql, migrations, seeds, ORM,db model pulland an interactivefleting shell. - Switch an existing project between engines with
fleting db init --mysql/--sqlite(with.bakbackups). - New
fleting doctorcommand to check a project for common problems. fleting --helpshows a "Init with Database" section and the commands for the engine of the current project.- Security: no default
admin/fletingcredential (setFLETING_ADMIN_PASSWORD), database credentials from environment variables, SQL identifier validation. - Many fixes in
create,delete, the ORM and the CLI. See the CHANGELOG.
pip install fleting
fleting init myapp
cd myapp
fleting runfleting create page products # model + controller + view + route
fleting run| Engine | Install | Create a project |
|---|---|---|
| SQLite (default) | — | fleting init myapp |
| MySQL 8 | pip install "fleting[mysql]" |
fleting init myapp --mysql |
| MariaDB 10.6+ / 11 | pip install "fleting[mariadb]" |
fleting init myapp --mysql + FLETING_DB_DRIVER=pymysql |
MySQL/MariaDB credentials are read from environment variables (FLETING_DB_HOST, FLETING_DB_PORT, FLETING_DB_USER, FLETING_DB_PASSWORD, FLETING_DB_NAME, FLETING_DB_DRIVER).
fleting db init # migrations/, seeds/, data/
fleting db migrate # apply migrations
fleting db seed # creates "admin" only if FLETING_ADMIN_PASSWORD is set
fleting shell # tables(), query(sql), table("t"), describe("t"), models()Full guide: English · Português · Español
| Category | Commands |
|---|---|
| Project | init <app>, info, run, doctor |
| Init with database | init <app> --mysql |
| Create | create page|view|model|controller <name> |
| Delete | delete page|view|model|controller <name> |
| List | list pages|controllers|views|models|routes |
| Database | db init [--mysql|--sqlite], db migrate, db seed, db make <name>, db rollback, db status |
| Models | db model pull [<table>] [--force] |
| Console | shell |
Run fleting --help for the full list. Step-by-step examples for every command: English · Português · Español
pip install -e ".[dev]"
pytest -q
ruff check fletingMySQL/MariaDB integration tests run with FLETING_TEST_MYSQL=1 and the FLETING_DB_* variables pointing to a server (see tests/test_04_mysql.py).
Complete documentation is available at:
O Fleting foi criado com alguns princípios claros:
- No unnecessary abstractions
- Explicit and easy-to-understand code
- Predictable architecture
- View → Pure UI (Flet)
- Layout → Reusable visual structure
- Controller → Business rules
- Model → Data
- Router → Navegação
- Core → Framework infrastructure
- The global application state automatically identifies:
mobiletabletdesktop
- Layouts can dynamically react to device type
- Simple JSON-based translation system
- Real-time language switching
- Translations accessible anywhere in the app
- Standardized file creation and removal
- Reduced boilerplate
- Convention > Configuration
MIT
| 🇺🇸 English | 🇧🇷 Português | 🇪🇸 Español |