Skip to content

Commit 375a8ff

Browse files
authored
improve doc index page and update readme
improve doc index page and update readme
2 parents 9c52268 + 6cbc9e8 commit 375a8ff

2 files changed

Lines changed: 60 additions & 99 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<!-- [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/AllDotPy/FletX)]() -->
3030

3131
# FletX 🚀
32-
**The open-source GetX-inspired Python Framework for Building Reactive, Cross-Platform Apps with Flet**
32+
**The open-source GetX-inspired Python Framework for Building Reactive, Cross-Platform Apps with Flet** | _leave star if you like it 🌟_
3333

3434
## Why FletX? ✨
3535

docs/index.md

Lines changed: 59 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
<p align="center">
3-
<img src="assets/logo/fletx_t.png" height="100" style="height:150px;">
3+
<img src="assets/logo/fletx_t.png" height="140" alt="FletX logo">
44
</p>
55

66
<p align="center">
@@ -13,103 +13,85 @@
1313
<a href="LICENSE">
1414
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License" />
1515
</a>
16-
<a href="https://discord.gg/GRez7BTZVy">
17-
<img src="https://img.shields.io/discord/1381155066232176670" alt="Discord" />
18-
</a>
1916
<a href="https://github.com/AllDotPy/FletX">
2017
<img src="https://img.shields.io/github/commit-activity/m/AllDotPy/FletX" alt="GitHub commit activity" />
2118
</a>
2219
</p>
2320

24-
# Welcome to FletX
21+
# Welcome to FletX
2522

26-
**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.
2724

2825
---
2926

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**
3328

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.
4133

4234
---
4335

44-
## 🧠 Philosophy
36+
## What is FletX? (short)
4537

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.
4739

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:
5141

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+
```
5357

5458
---
5559

56-
## ⚡ Quick Example
60+
## Simple Example (counter)
61+
62+
This minimal example shows how a `Page` and a `Controller` work together:
5763

5864
```python
5965
import flet as ft
60-
6166
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
6668
from fletx.decorators import obx
6769

6870

6971
class CounterController(FletXController):
70-
7172
def __init__(self):
72-
count = RxInt(0) # Reactive state
73-
super().__init__()
73+
self.count = RxInt(0)
74+
75+
def increment(self):
76+
self.count.increment()
7477

7578

7679
class CounterPage(FletXPage):
7780
ctrl = CounterController()
7881

7982
@obx
80-
def counter_text(self):
81-
return ft.Text(
82-
value=f'Count: {self.ctrl.count}',
83-
size=50,
84-
weight="bold",
85-
color='red' if not self.ctrl.count.value % 2 == 0 else 'white'
86-
)
83+
def counter_label(self):
84+
return ft.Text(f"Count: {self.ctrl.count}")
8785

8886
def build(self):
89-
return ft.Column(
90-
controls=[
91-
self.counter_text(),
92-
ft.ElevatedButton(
93-
"Increment",
94-
on_click=lambda e: self.ctrl.count.increment()
95-
)
96-
]
97-
)
87+
return ft.Column(controls=[
88+
self.counter_label(),
89+
ft.ElevatedButton("+", on_click=lambda e: self.ctrl.increment())
90+
])
9891

9992

10093
def main():
101-
router_config.add_route(
102-
path='/',
103-
component=CounterPage
104-
)
105-
app = FletXApp(
106-
title="My Counter",
107-
initial_route="/",
108-
debug=True
109-
).with_window_size(400, 600).with_theme(
110-
ft.Theme(color_scheme_seed=ft.Colors.BLUE)
111-
)
112-
94+
app = FletXApp(title="Counter", initial_route="/", debug=True)
11395
app.run()
11496

11597

@@ -119,53 +101,32 @@ if __name__ == "__main__":
119101

120102
---
121103

122-
## 🚀 Explore FletX
123-
124-
<div class="grid cards" markdown>
125-
126-
- :material-power:{ .lg .middle } **Get Started**
104+
## Learn Path — Start here
127105

128-
---
106+
- **Installation**: getting-started/installation.md — Set up your environment and the CLI.
107+
- **Routing**: getting-started/routing.md — Learn navigation, guards, and route parameters.
108+
- **State**: getting-started/state-management.md — Reactive primitives and patterns.
109+
- **Controllers**: getting-started/controllers.md — Where business logic lives.
110+
- **Pages**: getting-started/pages.md — Page lifecycle and composition.
111+
- **Services**: getting-started/services.md — External integrations and utilities.
112+
- **Decorators**: getting-started/decorators.md — Effects, memoization, and more.
129113

130-
Set up **FletX** and build your first UI in minutes.
131-
132-
[→ Installation Guide](getting-started/installation.md)
133-
134-
- :material-api:{ .lg .middle } **API Reference**
135-
136-
---
137-
138-
Complete reference for all available methods and configurations.
139-
140-
[→ API Documentation](api-reference.md)
141-
142-
- :material-rocket-launch:{ .lg .middle } **Guides**
143-
144-
---
145-
146-
Learn routing, state, and architecture with hands-on guides.
147-
148-
[→ Routing Guide](getting-started/routing.md) | [→ State Management](getting-started/state-management.md)
149-
150-
- :material-github:{ .lg .middle } **Contribute**
151-
152-
---
153-
154-
Help improve FletX with your feedback and code.
114+
---
155115

156-
[→ Contribution Guide](contributing.md)
116+
## Tools & Resources
157117

158-
</div>
118+
- **CLI**: `fletx` — scaffold, generate, run, and test projects. See getting-started/fletx-cli.md for usage.
119+
- **API Reference**: api-reference.md — exhaustive list of classes and helpers.
120+
- **Examples**: examples/template — a starter project you can run and adapt.
159121

160122
---
161123

162-
## 📌 Additional Links
124+
## Community & Contributing
163125

164-
* [GitHub Repository](https://github.com/AllDotPy/FletX)
165-
* [PyPI Package](https://pypi.org/project/FletXr/)
166-
* [Join the Community on Discord](https://discord.gg/GRez7BTZVy)
167-
* [License](LICENSE)
126+
- GitHub: https://github.com/AllDotPy/FletX
127+
- Discord: https://discord.gg/GRez7BTZVy
128+
- To contribute: read CONTRIBUTING.md and open a PR.
168129

169130
---
170131

171-
Made with ❤️ by [AllDotPy](https://alldotpy.com)
132+
Made with ❤️ by AllDotPy

0 commit comments

Comments
 (0)