How itzganesh03/kafka-desktop-manager works
Purpose and Entry Point
Kafka Desktop Manager is a Windows-native Go/Fyne GUI for operating a local, ZooKeeper-based Apache Kafka installation through its bundled Windows .bat command tools. main.go initializes the application; internal/ui/app.go builds the window shell, navigation, page lifecycle, and shortcuts.
Configuration and First-Run Boundary
Configuration persists the Kafka install path, bootstrap address, ports, startup preferences, defaults, and theme in local JSON. The first-run UI validates that the selected Kafka installation contains required scripts/configuration before allowing normal operation.
• internal/config/config.go
• internal/ui/wizard.go
• internal/ui/settings.go
UI Application Shell
The Fyne UI is organized as navigable operational pages rather than a web/server architecture. The shell coordinates theme selection, splash/startup behavior, refresh actions, notifications, dialogs, exports, and page switching.
• internal/ui/app.go
• internal/ui/theme.go
• internal/ui/splash.go
Kafka Command Execution Backbone
The backend deliberately shells out to Kafka’s standard bin\windows scripts instead of using a Kafka client library. A runner executes commands, captures output/errors, and records invocations; command history can be viewed and re-run from the UI. This is the principal boundary between Go application code and the installed Kafka distribution.
• internal/kafka/runner.go
• internal/kafka/history.go
• internal/kafka/cache.go
Local Service Lifecycle and Logs
ZooKeeper and Kafka broker management starts, stops, and restarts local processes launched by batch files. Service control must account for the Java child process created by the batch launcher, using Windows-specific process-tree handling. Output is streamed into service log views.
• internal/kafka/service.go
• internal/kafka/proc_windows.go
• internal/ui/services.go
Kafka Administration Operations
Topic metadata and consumer-group administration are command-wrapper domains: list/create/describe/delete topics, inspect metadata, and retrieve group state, offsets, log-end offsets, and lag. Topic utilities compose operations, notably purge as delete plus recreate while retaining topology.
• internal/kafka/topics.go
• internal/kafka/metadata.go
• internal/kafka/groups.go
• internal/kafka/utilities.go
Message Production and Consumption Flows
The producer sends single or line-delimited messages through Kafka console tooling and retains send history. The consumer runs as a controllable streaming process; its output feeds a live UI stream with pause/resume, filtering, auto-scroll, copy, and export. These paths are process/output-stream oriented, not broker-client API based.
• internal/kafka/producer.go
• internal/kafka/consumer.go
• internal/ui/producer.go
• internal/ui/consumer.go
Runtime and Platform Dependencies
Runtime targets Windows 10/11 with a local classic ZooKeeper-based Kafka installation and Java processes launched by Kafka scripts. The GUI uses Fyne and therefore CGO with a C compiler; its desktop rendering stack includes GLFW/OpenGL. Icon generation is a separate Go utility.
• go.mod
• internal/ui/assets.go
• tools/genicon/main.go
Main entry points: app.go Application shell · runner.go Command runner · service.go Local service manager · services.go Service controls and logs
Components 18
Fyne Desktop UI
- Application shell · Owns window lifecycle, pages, shortcuts, and notifications.
internal/ui/app.go - Theme and assets
internal/ui/theme.go - Startup splash
internal/ui/splash.go - Service controls and logs
internal/ui/services.go - Producer page
internal/ui/producer.go - Consumer stream page · Displays controllable live output with filtering and export.
internal/ui/consumer.go
Configuration
- First-run wizard · Validates the local Kafka installation before use.
internal/ui/wizard.go - Settings page
internal/ui/settings.go - Local JSON config · Persists install path, addresses, ports, defaults, and preferences.
internal/config/config.go
Kafka Command Backend
- Command runner · Executes bundled Windows batch tools and captures output.
internal/kafka/runner.go - Command history · Records commands for viewing and rerunning.
internal/kafka/history.go - Topic and group admin · Provides topic metadata, consumer-group state, offsets, lag, and utilities.
internal/kafka/topics.go - Message producer · Sends single or line-delimited messages and retains send history.
internal/kafka/producer.go - Streaming consumer · Runs a controllable process and streams its output.
internal/kafka/consumer.go - Local service manager · Manages Kafka and ZooKeeper process trees and streams logs.
internal/kafka/service.go
Local Runtime
- Kafka Windows distribution · Bundled bin\windows scripts launch ZooKeeper and Kafka through Java.
- ZooKeeper and Kafka broker
Other components
- Application entry · Initializes the desktop application.
main.go
Connections 21
- Application entry → Application shell: starts
- Application shell → Theme and assets: applies
- Application shell → Startup splash: shows at startup
- Application shell → First-run wizard: opens on first run
- Application shell → Settings page: navigates to
- First-run wizard → Local JSON config: validates and saves
- Settings page → Local JSON config: updates
- Application shell → Service controls and logs: hosts page
- Application shell → Producer page: hosts page
- Application shell → Consumer stream page: hosts page
- Service controls and logs → Local service manager: controls
- Producer page → Message producer: sends through
- Consumer stream page → Streaming consumer: streams from
- Command runner → Command history: records invocations
- Topic and group admin → Command runner: executes commands
- Message producer → Command runner: executes console producer
- Streaming consumer → Command runner: executes console consumer
- Local service manager → Kafka Windows distribution: launches batch scripts
- Command runner → Kafka Windows distribution: runs bin\windows tools
- Kafka Windows distribution → ZooKeeper and Kafka broker: launches
- Local service manager → ZooKeeper and Kafka broker: stops and monitors