Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diegopereiracruz/flet_template
A template for building Python apps with Flet, designed for simplicity, modularity, and customization.
https://github.com/diegopereiracruz/flet_template
flet flet-app flet-gui flet-template python python-flet python-template python3 template template-project
Last synced: 28 days ago
JSON representation
A template for building Python apps with Flet, designed for simplicity, modularity, and customization.
- Host: GitHub
- URL: https://github.com/diegopereiracruz/flet_template
- Owner: diegopereiracruz
- Created: 2024-12-02T00:45:53.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-02T02:50:59.000Z (about 1 month ago)
- Last Synced: 2024-12-02T03:27:09.321Z (about 1 month ago)
- Topics: flet, flet-app, flet-gui, flet-template, python, python-flet, python-template, python3, template, template-project
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Flet App Template
This repository provides a **template for building Python applications with Flet**, designed for simplicity, modularity, and customization. The template includes essential features like navigation bar activation, custom footer integration, and system tray icon functionality using Pystray. It's structured to help you start quickly while keeping the code clean and maintainable.
---
## π οΈ **Features**
### 1. **Navigation Bar and Footer Options**
- Enable or disable a **custom navigation bar**.
- Enable or disable a **custom footer**.### 2. **System Tray Integration (Pystray)**
- Add a **system tray icon** with Pystray for running the app in the background.
- Includes a context menu with customizable options, such as opening the app and exiting.### 3. **Page Routing System**
- Built-in routing system with **separate files for each page**.
- Simple navigation between different app pages using Fletβs `Router`.### 4. **Modular Architecture**
- The project is divided into **separate files** for each feature and function:
- Pages folder
- Navigation bar
- Footer
- Page router
- Ensures that the code is easy to maintain, scale, and reuse.---
## π **Getting Started**
### 1. **Clone the Repository**
```bash
git clone https://github.com/diegopereiracruz/flet_template
cd flet_template
```### 2. **Install Dependencies**
Ensure you have Python 3.8+ installed. Then, run:
```bash
pip install flet pystray PIL
```### 3. **Run the App**
Execute the main script to start the application:
```bash
python3 main.py
```---
## π **Project Structure**
Here's an overview of the template structure:```
flet_template/
βββ app
β βββ assets # Medias folder (images, icons, etc)
β β βββ tray_icon
β βββ pages # Pages folder
β β βββ home.py
β βββ system
β β βββ FletRouter.py # Routing system
β βββ ui
β βββ footer.py # Custom footer bar
β βββ navigation.py # Custom navigation bar
βββ main.py # Entry point of the app
```---
## π **Customization Guide**
### **Enable/Disable Features**
In the `main.py` file, you can toggle some features by modifying some variables:
```python
enable_tray = False
enable_navbar = False
enable_footer = False
```### **Add Pages**
1. Create the page file in `app/pages/`. e.g., `app/pages/settings.py`
2. In `app/system/FletRouter.py` import the page. e.g., `from app.pages.settings import settings_page`
2. Put the path of the page inside `self.routes = {...}`. e.g., `"/settings": settings_page(page),`---
## π¦ **Dependencies**
- **[Flet](https://flet.dev/):** For building the user interface.
- **[Pystray](https://pystray.readthedocs.io/):** For system tray functionality.---
## π **License**
This project is licensed under the [MIT License](LICENSE).Feel free to use, modify, and distribute this template for your own projects!
---
## π **Contributions**
Contributions are welcome! If you encounter any issues or have suggestions, feel free to open an issue or submit a pull request.---
## β¨ **Acknowledgments**
Special thanks to the **Flet** and **Pystray** communities for their excellent tools that power this template.---
Enjoy coding with Flet! π