TaskFlow is a modern, well-structured desktop todo list application built with Go and the Fyne UI toolkit. It serves as a professional template showcasing best practices for building desktop applications with clean architecture, data persistence, and smart UI/UX features.
- Smart Todo Management: Create, complete, and delete tasks with ease
- Data Persistence: All tasks are automatically saved and restored between sessions
- Window State Memory: Remembers your window size and position preferences
- Responsive Design: Adapts intelligently to different screen sizes
- Tabbed Interface: Filter tasks by All, Active, or Completed
- Professional UI: Clean, modern design with smooth interactions
- Statistics Dashboard: Real-time overview of your tasks
- Clean Architecture: Complete separation between UI and business logic
The project follows the standard Go layout for maintainability and scalability:
-
cmd/todo/main.go: The application entry point. Initializes the Fyne application, manages window state persistence, and coordinates between Core Logic and UI components. -
internal/application/application.go: Contains the Core Application Logic (CoreApp). This layer is completely UI-agnostic (knows nothing about Fyne widgets). All business logic (CRUD operations, data persistence, statistics) lives here. -
internal/ui/ui.go: Contains the User Interface components. Creates Fyne widgets, defines visual styles, and calls methods fromCoreAppwhen user interactions occur.
This project requires Go version 1.24.4 (or any version 1.18+).
Since Fyne uses C libraries (like GLFW, which relies on OpenGL and X11/Wayland backends) to draw graphics, you must install the necessary development headers on your Linux system before Go can successfully compile the application.
Use this command to install all required C development packages:
sudo apt update
sudo apt install libgl1-mesa-dev xorg-dev libxcursor-dev libxi-devNote on Safety: Installing these
-devpackages is safe. They only provide compiler-time resources (header files), not runtime system changes, and will not conflict with your Wayland environment.
On macOS, dependencies are often handled automatically by the operating system, especially if you have Xcode Command Line Tools installed.
If you encounter compilation errors (related to libraries like pkg-config), installing the necessary tools via Homebrew is the best fix:
brew install pkg-configIf you do not have Go installed, follow the recommended method for your platform:
- Download the official tarball from the Go Downloads page.
- Extract the archive to
/usr/local(this is the standard location):sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf go<version>.linux-amd64.tar.gz
- Add the Go binary directory to your
$PATHenvironment variable in your shell configuration file (e.g.,~/.bashrcor~/.zshrc):export PATH=$PATH:/usr/local/go/bin
- Restart your shell or run
source ~/.bashrc(or equivalent) and verify:go version
Use Homebrew for the easiest installation:
brew install goDownload the official MSI installer from the Go Downloads page. The installer automatically handles the installation and sets up the necessary environment variables for you.
Follow these steps from the project root directory:
make installOr manually:
go mod downloadDevelopment mode (run without building):
make devOr build and run:
make runOr manually:
go run cmd/todo/main.goThe application will automatically:
- Create a configuration directory at
~/.config/taskflow/(Linux) or equivalent on your OS - Save your todos to
~/.config/taskflow/todos.json - Remember your window size and position in
~/.config/taskflow/window_state.json
The project includes a Makefile for easy building and development:
| Command | Description |
|---|---|
make build |
Build the application |
make run |
Build and run the application |
make dev |
Run in development mode (no build) |
make install |
Install dependencies |
make test |
Run tests |
make clean |
Remove build artifacts |
make build-linux |
Build for Linux |
make build-macos |
Build for macOS Intel |
make build-macos-arm |
Build for macOS Apple Silicon |
make build-windows |
Build for Windows |
make build-all |
Build for all platforms |
make help |
Show help message |
Build for your current system:
make buildBuild for all platforms at once:
make build-allOr build for specific platforms:
make build-linux
make build-macos
make build-macos-arm
make build-windowsAll builds will be placed in the build/ directory.
Build for your current system:
go build -o taskflow ./cmd/todoCross-compile for other platforms:
| Target OS | Command | Output |
|---|---|---|
| Linux (64-bit) | GOOS=linux GOARCH=amd64 go build -o taskflow-linux ./cmd/todo |
taskflow-linux |
| macOS (Intel) | GOOS=darwin GOARCH=amd64 go build -o taskflow-macos-intel ./cmd/todo |
taskflow-macos-intel |
| macOS (Apple Silicon) | GOOS=darwin GOARCH=arm64 go build -o taskflow-macos-arm ./cmd/todo |
taskflow-macos-arm |
| Windows (64-bit) | GOOS=windows GOARCH=amd64 go build -o taskflow.exe ./cmd/todo |
taskflow.exe |
TaskFlow stores all application data in your system's standard configuration directory:
- Linux:
~/.config/taskflow/ - macOS:
~/Library/Application Support/taskflow/ - Windows:
%APPDATA%\taskflow\
Files stored:
todos.json- Your task datawindow_state.json- Window size and position preferences
This template is designed to be easily customizable:
- Change the Application Name: Update references to "TaskFlow" in
main.goand UI files - Modify the Core Logic: Edit
internal/application/application.goto add new features - Customize the UI: Adjust colors, layouts, and components in
internal/ui/ui.go - Add New Features: The clean architecture makes it easy to extend functionality
Separation of Concerns: The UI layer (internal/ui/) knows about the Core layer (internal/application/), but the Core layer is completely independent of the UI. This means you could swap Fyne for another UI toolkit without changing your business logic.
Data Persistence: The CoreApp handles all file I/O operations transparently. The UI simply calls methods like AddTodo() and the persistence happens automatically.
Window State Management: The main.go handles saving and restoring window preferences, demonstrating professional application behavior.
This is a template project designed to help developers kickstart their Go desktop applications. Feel free to fork it, customize it, and make it your own!