Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
*.pytest_cache
*.vscode
*.idea
*.DS_Store
*.DS_Store
tree.txt
uv.lock
38 changes: 38 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 🕊 **FletX Code of Conduct**

## 🌟 Our Pledge
We pledge to foster an open, inclusive, and respectful environment for all contributors, regardless of:
- Background or experience level
- Gender identity or expression
- Sexual orientation
- Disability
- Personal appearance
- Race, ethnicity, or religion
- Technology preferences

## 🚫 Unacceptable Behavior
Examples include but are not limited to:
- Harassment or derogatory comments
- Trolling or personal/political attacks
- Publishing others' private information without consent
- Other conduct that could reasonably be considered inappropriate

## 🛠 Enforcement Responsibilities
Project maintainers will:
- Remove/edit inappropriate content
- Warn or ban offenders temporarily/permanently
- Apply consequences fairly and consistently

## ⚖️ Reporting Guidelines
Report violations to **[project email/contact]** with:
1. **Where/when** the incident occurred
2. **Description** of the behavior
3. **Context** (if available)
4. Your **contact information** (optional)

All reports will be reviewed and investigated promptly.

## 🔄 Attribution
This Code of Conduct is adapted from:
- [Contributor Covenant 2.1](https://www.contributor-covenant.org/)
- [Django Code of Conduct](https://www.djangoproject.com/conduct/)
205 changes: 173 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,197 @@
# Contributing to FletX

---

### 🧭 `CONTRIBUTING.md`
Thank you for your interest in FletX! 🎉 This comprehensive guide outlines how to contribute effectively.

## 📋 Table of Contents
1. [Getting Started](#-getting-started)
2. [Project Structure](#-project-structure)
3. [Development Workflow](#-development-workflow)
4. [Code Conventions](#-code-conventions)
5. [Testing & Quality](#-testing--quality)
6. [Documentation](#-documentation)
7. [Reporting Bugs](#-reporting-bugs)
8. [Feature Proposals](#-feature-proposals)
9. [Code of Conduct](#-code-of-conduct)

# Contributing to EasySwitch
## 🚀 Getting Started

First of all, thank you for your interest in contributing to **EasySwitch!** 🎉
This guide outlines how to contribute effectively and maintain high-quality standards.
### Local Setup

---
1. **Clone the repository**
```bash
git clone https://github.com/AllDotPy/FletX.git
cd FletX
```

## 🔧 Local Setup
2. **Set up virtual environment** (Recommended: UV)
```bash
pip install uv
uv venv
source venv/bin/activate # Linux/Mac
# or .\venv\Scripts\activate # Windows
```

1. **Clone the repository**
3. **Install dependencies**
```bash
uv pip install -e .[dev] # Development mode
```

4. **Verify installation**
```bash
git clone https://github.com/AllDotPy/easyswitch.git
pytest tests/
```

## 🏗 Project Structure

```sh
.
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── architecture.svg
├── docs/
├── examples/
├── fletx
│   ├── __init__.py
│   ├── app.py
│   ├── core
│   │   ├── __init__.py
│   │   ├── controller.py
│   │   ├── di.py
│   │   ├── effects.py
│   │   ├── factory.py
│   │   ├── navigation
│   │   │   ├── guards.py
│   │   │   ├── middleware.py
│   │   │   └── transitions.py
│   │   ├── observer.py
│   │   ├── page.py
│   │   ├── route_config.py
│   │   ├── router.py
│   │   ├── state.py
│   │   ├── types.py
│   │   └── widget.py
│   ├── decorators
│   │   ├── controllers.py
│   │   ├── reactive.py
│   │   └── route.py
│   ├── utils
│   │   ├── __init__.py
│   │   ├── context.py
│   │   ├── exceptions.py
│   │   └── logger.py
│   └── widgets
│   ├── __init__.py
│   └── text.py
├── main.py
├── pyproject.toml
└── setup.py
```
2. **Create a virtual environment**

We use [UV](https://docs.astral.sh/uv/) to manage our projects
## 🔄 Development Workflow

1. **Create a branch**
Branch from `master` with descriptive naming:
```bash
git checkout -b feat/new-reactive-component
```

2. **Implement changes**
- Keep commits atomic
- Document new features

3. **Run tests**
```bash
# First install uv
pip install uv
uv pip install -e .[test]
pytest tests/
```

# Navigate to the projet folder
cd easyswitch
4. **Submit a Pull Request**
- Clearly describe changes
- Reference related issues
- Address code review feedback

## ✨ Code Conventions

### Style Guide
- Follow PEP 8 (88 chars max line length)
- Type hints for all public functions
- Google-style docstrings for key modules

### Reactivity Pattern
```python
# Good
class ReactiveButton(ft.ElevatedButton, FletXWidget):
""" My Reactive Button which.... """

def __init__(self, text: RxStr, **kwargs):
super().__init__(**kwargs)
# Create a reactive object
self.rx_text: RxStr = RxStr('')
# And bind it to self (@ft.ElevatedButton) text attribute
self.bind('text', self.rx_text)
```

# Create a virtual environment for thr project
uv venv
### Widget Standards
- Prefix reactive widgets with `Reactive`
- Isolate state logic in dedicated classes

# Then activate it
source venv/bin/activate
## 🧪 Testing & Quality

# Now install deps
uv pip install
### Running Tests
```bash
pytest tests/ --cov=fletx --cov-report=html
```

### Quality Standards
- Maintain >90% code coverage
- All new widgets require:
- Unit tests
- Functional example
- Documentation

## 📚 Documentation

### Writing Docs
```python
class ReactiveText(ft.Text, FletXWidget):
"""Text widget with reactive value binding.

Args:
value: RxStr to bind to text value
color: RxStr for text color (optional)
"""
```

# Install EasySwitch locally
uv pip install -e .
### Building Documentation
```bash
cd docs/
make html
```

## 🐛 Reporting Bugs

## Contribution Guidelines
1. Check existing issues for duplicates
2. Include:
- Steps to reproduce
- Expected vs actual behavior
- FletX/Python versions
- Minimal reproducible example

1. Make sure to follow coding best practices and maintain consistency with the existing code.
2. Document new features or modifications in the code.
3. Thoroughly test your modifications and ensure they do not introduce any regressions.
4. Respect the project's code of conduct and treat other contributors with respect and courtesy.
## 💡 Feature Proposals

## Issues and Feature Requests
1. Clearly describe the use case
2. Suggest technical approach
3. Outline potential impacts
4. Attach mockups if applicable

If you encounter an issue or have an idea for a new feature, feel free to open an issue in this repository. We are always open to suggestions and will do our best to address them promptly.
## 🤝 Code of Conduct

We adhere to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating:
- Be kind and open-minded
- Respect differing viewpoints
- Assume good faith

---

We greatly appreciate all contributions, and thank you in advance for your participation in the project!
Thank you for helping build FletX! Together we're creating the best reactive framework for Flet. 🚀
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
Here's a comprehensive, well-structured, and engaging technical documentation for your GitHub README:

---

# FletX 🚀
**The GetX-inspired Python Framework for Building Reactive, Cross-Platform Apps with Flet**

[![PyPI Version](https://img.shields.io/pypi/v/fletx)](https://pypi.org/project/fletx/)
[![PyPI Version](https://img.shields.io/pypi/v/fletx)](https://pypi.org/project/Flet-X/)
[![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
[![Discord](https://img.shields.io/discord/your-invite-code)](https://discord.gg/your-link)

Expand Down Expand Up @@ -177,10 +173,32 @@ FletXRouter.add_middleware(AnalyticsMiddleware())

## Roadmap 🗺️

- [ ] FletX CLI tool
- [ ] VS Code extension
- [x] **Step 1** — **Fondation**
> ⚙️ **Goal** : build thechnical bases and essential abstractions.
- [x] **Step 2** — **State Management + DI**
> 🎯 **Goal** : Enable reactive state management.
- [x] **Step 3** — **Advanced navigation**
> 🧭 **Goal** : Add support for modular and nested routing, middlewares and Guards.
- [ ] **Step 4** — **Composants UI enrichis**
> 🧱 **Goal** : Add ready to use reactive UI components (enabling extensibility).
- [ ] **Step 5** — **Utilities & CLI**
> 🛠️ **Goal** : Add tools to boost DX (developer experience).
- [ ] **Step 6** — **Write Documentation**
> 📚 **Goal** : Write FletX's documentation.

### Currently Working on

- [x] Add @reactive_control to allow converting flet Controls into a FletX reactive Widgets
- [ ] Add Ready to use Reactive Widgets or components
- [ ] FletX CLI tool Eg: `fletx new my_project`; `fletx generate module my_project/my_module`
- [ ] Write Documentation

### For the next version

- [ ] Improve Actual routing system (enabling devs to create subrouters for modules)
- [ ] Add Screen Management System for Page Widgets
- [ ] Enhanced dev tools
- [ ] Plugin system
- [ ] VS Code extension

---

Expand Down
Binary file added examples/1/assets/fonts/bungee.ttf
Binary file not shown.
Binary file added examples/1/assets/fonts/inter.ttf
Binary file not shown.
9 changes: 9 additions & 0 deletions examples/1/assets/icons/apple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions examples/1/assets/icons/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions examples/1/assets/icons/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/1/assets/images/dev1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/1/assets/logos/ln_bg_alpha_3000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading