You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**FletX** is a lightweight, modular, and reactive architectural framework built on top of [Flet](https://flet.dev), designed to help you build scalable Python UI applications with clean code, structured layers, and modern development patterns.
23
+
FletX is a lightweight, modular, and reactive architectural layer built on top of [Flet](https://flet.dev). It helps you structure Python UI apps using clear separation of concerns (Pages → Controllers → Services), predictable lifecycle hooks, and a small set of reactive primitives.
27
24
28
25
---
29
26
30
-
## :material-head-question-outline: What is FletX?
31
-
32
-
Inspired by frameworks like **GetX** in the Flutter ecosystem, **FletX** introduces powerful architectural patterns to Flet:
27
+
**Quick orientation**
33
28
34
-
- ✅ **Reactive state management**
35
-
- ✅ **Modular routing system** with dynamic parameters and guards
36
-
- ✅ **Controllers and services** to separate logic from UI
37
-
- ✅ **Global and local dependency injection**
38
-
- ✅ **Lifecycle hooks** for pages and the app
39
-
- ✅ **Unified configuration with fluent API**
40
-
- ✅ **Built-in support for asynchronous programming**
29
+
- Use `Pages` to describe UI and navigation.
30
+
- Use `Controllers` for state and business logic.
31
+
- Use `Services` for reusable integrations (APIs, storage).
32
+
- Use the CLI to scaffold and run projects quickly.
41
33
42
34
---
43
35
44
-
## 🧠 Philosophy
36
+
## What is FletX? (short)
45
37
46
-
FletX is built on 3 core principles:
38
+
FletX brings architecture patterns familiar from mobile/web frameworks (for example, GetX) to Flet applications: reactive state management, modular routing, dependency injection, and lifecycle hooks — without replacing Flet widgets.
47
39
48
-
1.**Simplicity** — Focus on code clarity and maintainability
49
-
2.**Modularity** — Encourage component-based structure and reusable logic
50
-
3.**Flexibility** — Allow full control over your app flow, while staying non-intrusive
40
+
Key features:
51
41
52
-
> FletX is not a UI library. It doesn’t reinvent Flet’s widgets — it empowers you to use them better by providing a powerful and extensible application layer.
42
+
- Reactive state primitives (`Rx*`, `Computed`, `Observer`) for straightforward UI updates.
43
+
- A routing system with guards and nested routes.
44
+
- Controllers and Services to separate UI from logic.
45
+
- A small set of decorators and helpers for effects, memoization, and batched updates.
46
+
- A CLI for scaffolding, generation, running, and testing.
47
+
48
+
---
49
+
50
+
## TL;DR — Get started in three commands
51
+
52
+
```bash
53
+
fletx new my_app # scaffold a project
54
+
cd my_app
55
+
fletx run --web --watch # run with hot reload
56
+
```
53
57
54
58
---
55
59
56
-
## ⚡ Quick Example
60
+
## Simple Example (counter)
61
+
62
+
This minimal example shows how a `Page` and a `Controller` work together:
57
63
58
64
```python
59
65
import flet as ft
60
-
61
66
from fletx.app import FletXApp
62
-
from fletx.core import (
63
-
FletXPage, FletXController, RxInt, RxStr
64
-
)
65
-
from fletx.navigation import router_config
67
+
from fletx.core import FletXPage, FletXController, RxInt
0 commit comments