Welcome to FletX¶
FletX is a lightweight, modular, and reactive architectural layer built on top of Flet. 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.
Quick orientation
- Use
Pagesto describe UI and navigation. - Use
Controllersfor state and business logic. - Use
Servicesfor reusable integrations (APIs, storage). - Use the CLI to scaffold and run projects quickly.
What is FletX? (short)¶
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.
Key features:
- Reactive state primitives (
Rx*,Computed,Observer) for straightforward UI updates. - A routing system with guards and nested routes.
- Controllers and Services to separate UI from logic.
- A small set of decorators and helpers for effects, memoization, and batched updates.
- A CLI for scaffolding, generation, running, and testing.
TL;DR — Get started in three commands¶
| Bash | |
|---|---|
Simple Example (counter)¶
This minimal example shows how a Page and a Controller work together:
Learn Path — Start here¶
- Installation: getting-started/installation.md — Set up your environment and the CLI.
- Routing: getting-started/routing.md — Learn navigation, guards, and route parameters.
- State: getting-started/state-management.md — Reactive primitives and patterns.
- Controllers: getting-started/controllers.md — Where business logic lives.
- Pages: getting-started/pages.md — Page lifecycle and composition.
- Services: getting-started/services.md — External integrations and utilities.
- Decorators: getting-started/decorators.md — Effects, memoization, and more.
Tools & Resources¶
- CLI:
fletx— scaffold, generate, run, and test projects. See getting-started/fletx-cli.md for usage. - API Reference: api-reference.md — exhaustive list of classes and helpers.
- Examples: examples/template — a starter project you can run and adapt.
Community & Contributing¶
- GitHub: https://github.com/AllDotPy/FletX
- Discord: https://discord.gg/GRez7BTZVy
- To contribute: read CONTRIBUTING.md and open a PR.
Made with ❤️ by AllDotPy