A high-performance, multi-engine macOS & Windows productivity suite designed to protect your physical and mental well-being.
Developed by Bijith P N
BreakMate is a sophisticated wellness platform that integrates deeply with your desktop environment. By utilizing multiple Flutter engines, a custom behavior AI for ambient feedback, and native platform hooks, BreakMate ensures that your work-life balance is actively managed without disrupting your creative flow.
Modern computing often leads to "flow-state tunnel vision," where users ignore the physical costs of prolonged sitting and screen time. BreakMate's scope is to bridge the gap between intent and action. It provides:
- Physical Protection: Through enforced eye-rest, stretching, and movement prompts.
- Mental Clarity: By utilizing Pomodoro and Deep Work cycles to prevent cognitive fatigue.
- Ambient Awareness: Using a non-intrusive desktop pet to reflect app state and encourage a more relaxed workspace.
- The Engine: A high-precision
TimerEnginemanages the transition between states. It calculates focus quality based on how often you skip or postpone breaks. - Strict Mode: When enabled, the app uses a
screenSaverwindow level on macOS and a top-most overlay on Windows, effectively locking the workstation for the duration of the break. - Pre-Break Warning: A translucent 20-second countdown overlay appears before breaks, allowing you to gracefully finish your last sentence or commit your code.
- Flash Notifications: Subtle, non-intrusive screen-edge pulse cues rendered via a high-performance overlay to keep you aware of upcoming breaks without breaking your flow.
- Zero-Touch Pausing: Using native EventChannels, the app detects if you are in a meeting (Zoom, Teams, etc.) and auto-pauses the timer. It resumes only when the call ends.
- Idle Intelligence: If you walk away from your desk for more than 5 minutes, BreakMate detects the inactivity via the native bridge and automatically resets or pauses the work cycle.
The desktop pet (cat/dog) isn't just a static animation; it's driven by PetBehaviorBrain, an AI decision engine:
- Weighted Decision Making: Uses a weighted scoring algorithm to choose the next behavior based on context.
- Context Awareness: If the cursor is nearby, the pet enters an
interactingorcuriousstate. If a meeting is detected, it enters aquietorsleepstate. - Personality Matrix: Each pet profile has unique traits like
playfulness,curiosity, andsociability. - Recency Penalty: Prevents the pet from repeating the same animation twice in a row, making it feel more "alive."
- Custom Habitats: Build a rich 2D environment for your companion with customizable themes, parallax skies, and dynamic ground layers.
- Live Preview: See changes in real-time as you switch themes and decorations.
- Ambient Elements: Dynamic lighting, atmospheric particles, and background animals (like flying birds) bring the companion's world to life.
- Interactive PiP Overlay: A high-performance, draggable Picture-in-Picture window lets your pet roam freely across your desktop without disrupting your workflow.
- Heatmaps: A GitHub-style activity graph tracking your focus consistency over a 365-day window.
- Productivity Score: A proprietary algorithm that weights completed breaks vs. skipped ones against your daily goal.
- Wellness Library: A curated collection of articles and exercises designed by ergonomic experts.
BreakMate uses a Glassmorphic / Neo-Native design language.
- Vibrancy & Blur: Leveraging
macos_uiandflutter_acrylicto create translucent sidebars and windows that blend perfectly with the host OS. - Staggered Animations: Every page transition and widget entry uses
StaggeredFadeInfor a premium, fluid feel. - Satoshi Typography: A custom geometric sans-serif font family used app-wide.
- Interactive Feedback: Custom
PressableButtonandProgressRingwidgets provide tactile visual feedback.
The app is split into three distinct Flutter instances to maximize performance:
- Main App: Handles tray management, settings, and the dashboard.
- Overlay Engine: A dedicated high-priority engine for full-screen break screens.
- Companion Engine: A low-overhead Flame-based engine for the desktop pet.
- Provider: Used for local UI state and reactive updates in the dashboard.
- EventBus: A centralized hub for app-wide events (
MeetingDetected,TimerTick,PetInteracted). - CompanionStateManager: Listens to the EventBus and maintains the Finite State Machine (FSM) for the pet, transitioning between
idle,sleeping,alert, andhappystates based on system events. - IPC Bridge: A custom
MethodChannellayer (com.breakmate/ipc) that synchronizes state across the three separate isolates. It ensures the Companion knows the Timer's state and the Overlay knows when a meeting starts.
To ensure maximum reliability, BreakMate employs a multi-layered storage strategy:
- ObjectBox (Primary): A high-performance NoSQL database used for complex objects like
SettingsSnapshot,DailyStats, andCompanionPreferences. - Key-Value Mirror (Resilience): Critical flags (like onboarding completion) are mirrored to a stable primitive
KeyValueRecordtable. This acts as a "source of truth" if complex snapshots fail to decode. - Automatic Migration: On macOS, the database was moved from
~/Documentsto~/Library/Application Supportfor better stability. The app automatically detects legacy data and migrates it to the new location on first launch. - Isolate Safety: Storage initialization is restricted to the main isolate to prevent database locking issues across multiple engines.
| Plugin | Usage in BreakMate |
|---|---|
macos_ui |
Provides the native look-and-feel for the macOS dashboard. |
flutter_acrylic |
Enables the translucent (vibrancy/acrylic) window effects. |
tray_manager |
Powers the animated tray icon and the dynamic context menu. |
window_manager |
Handles complex window operations like "always on top" and custom resizing. |
flame |
The 2D game engine powering the desktop pet animations. |
audioplayers |
Manages lofi background music and notification sound effects. |
fl_chart |
Renders the complex productivity heatmaps and trend lines. |
shared_preferences |
Persists over 40+ user settings and break history. |
get_it |
The service locator used for clean dependency injection. |
launch_at_startup |
Registers the app with the OS to start automatically on login. |
screen_retriever |
Detects multi-monitor setups to ensure overlays span all screens. |
flutter_local_notifications |
Sends system-level reminders for posture and hydration. |
intl |
Handles complex date/time formatting for analytics and history. |
url_launcher |
Handles external links for wellness articles and documentation. |
path_provider |
Locates platform-specific directories for caching and data storage. |
dependency_injection.dart: The "Wiring Diagram" of the app where all services are instantiated.main_layout.dart: The sidebar navigation logic and master layout.
native/macos_bridge.dart: The "Control Center" for 20+ native calls (Overlay, Companion, Idle Time).services/timer_engine.dart: The core logic that runs the work/break cycles.ipc/ipc_bridge.dart: The underlying mechanism for inter-isolate communication.events/app_events.dart: Definitions for every possible system message.
ai/pet_behavior_brain.dart: The intelligence engine described above.flame/companion_game.dart: The rendering loop for pet animations.services/companion_state_manager.dart: Reactively maps app events to pet behaviors.
settings_page.dart: A unified control panel for every app parameter.settings_model.dart: The data schema for app configuration.
AppDelegate.swift: HandlesFlutterEngineGroupmanagement and MethodChannel routing.CompanionWindowManager.swift: Creates a customNSPanelfor the draggable pet.
display_bridge.cpp: Low-level Win32 calls to manage multi-monitor overlay placement.companion_window_manager.cpp: Implements layered windows for pet animations.
To run BreakMate locally for development, follow these steps:
- Flutter SDK: Ensure you have Flutter installed (version
3.10.4or later). - CocoaPods (macOS only): Run
pod installin themacos/directory to fetch native dependencies. - Node.js: Required if you plan to build DMGs locally (
npm install -g appdmg).
-
Clone and Install Dependencies:
flutter pub get cd macos && pod install && cd ..
-
Configure Environment Variables: Copy
.env.exampleto create your active.envconfiguration:cp .env.example .env
-
Run the Application: BreakMate supports build flavors (
prodanddev). Run with your target flavor:# Run with Dev configuration flutter run -t lib/main_dev.dart --flavor dev # Run with Production configuration flutter run -t lib/main_prod.dart --flavor prod
To prevent database locking issues and process conflicts, BreakMate restricts execution to a single main process:
- On startup, the main app binds a TCP listener to localhost port
10425. - If the port is already in use, the new instance contacts the running process to trigger a graceful shutdown.
- If the running process is stale or locked, the app automatically executes a native force-termination command (
lsof/kill -9) to clean up the port and boot cleanly.
BreakMate runs three separate isolates utilizing FlutterEngineGroup to isolate memory and run secondary screens at 60fps:
mainIsolate: Runs the dashboard UI, handles preferences, settings, and native background hooks.overlayMain(@pragma('vm:entry-point')): Runs the fullscreen break overlays.companionMain(@pragma('vm:entry-point')): Runs the low-overhead Flame engine animating your pet companion.- IPC Synchronisation: A specialized MethodChannel layer translates events (like meeting activity, timers, sleep state, and mouse interactions) across the isolates in real-time.
BreakMate includes a fully automated release pipeline for building, packaging, signing, and deploying updates via Sparkle and GitHub Releases. All variables are dynamically configured via environment files.
For a detailed step-by-step walkthrough on generating keys, config setups, and troubleshooting build releases, see the Release & Sparkle Key Management Guide.
The pipeline reads its options from .env at the project root. Copy .env.example to get started:
cp .env.exampleAdjust the variables inside:
APP_NAME: Set your application name (e.g.BreakMate).RELEASE_GITHUB_REPO: GitHub repository where DMG releases are created and hosted.APPCAST_GITHUB_REPO: GitHub repository hosting the Sparkle update XML (appcast.xml).GIT_BRANCH: Branch to commit and push changes ofappcast.xmlto (default:main).
For secure automatic updates, Sparkle requires Ed25519 signatures. Run this script once to initialize your keys:
./scripts/generate_sparkle_keys.sh- What it does:
- Generates an Ed25519 keypair.
- Exports the private key securely to
~/secrets/breakmate_sparkle_private.pem(never commit this!). - Auto-patches
macos/Runner/Info.plistwith the public key (SUPublicEDKey).
The main entry point for creating a new release. One command runs the entire pipeline:
./scripts/create_dmg.sh --version 1.2.0 --build 26 --notes "Optimized companion animations and updated window layout."- Flutter Build: Builds the macOS target in release mode using your configured flavor.
- DMG Packaging: Uses
appdmgto package the app into a premium Installer DMG (configured viascripts/appdmg.json). - Sign update: Extracts the file size and signs the DMG with your Ed25519 key.
- GitHub Release: Deletes any pre-existing release/tag of the same version, creates a new GitHub release, uploads the DMG, and attaches your release notes.
- Appcast Updates: Surgically inserts or updates the version item inside
appcast.xmlusing an inline Python processor. - Git Commit & Push: Commits
appcast.xmlchanges and pushes to your configuredGIT_BRANCH.
Add --dry-run to preview the entire pipeline process without modifying any local or remote assets.
- Desktop Companion Engine: Draggable pet with advanced behavior state machines.
- Interactive Environment Builder: 2D side-scrolling habitat with live previews, themes, parallax skies, and decorations.
- Flash Notifications: Subtle screen-edge pulse cues for ambient awareness via overlay.
- Contextual Intelligence: Calendar-aware break planning, meeting detection, and wind-down support.
- Adaptive Break Planner: Recommend schedule changes based on focus quality and meeting density without silently mutating settings.
- Guided Recovery: Smart handling of breaks and focus sessions after system sleep or long idle periods.
- Local Asset Packs: Optional downloadable companion themes, decorations, and audio to keep the core installer lightweight.
- Predictive Fatigue AI: Companion learns your work habits and displays fatigue behaviors before you get tired to encourage proactive breaks.
MIT License - See the LICENSE file for details.
