Skip to content
All projects

Friendly Computer Cat: OS-Level Pomodoro Enforcer & Session Tracker

A native, hardware-level focus enforcer and Pomodoro tracker. Utilizes low-level Win32 hooks to physically lock peripheral input during mandatory rest cycles, breaking hyper-focus loops while persisting historical work session data via an SQLite backend.

Tech stack

Languages
Frameworks & libraries

Performance & metrics

  • Near-zero idle CPU overhead due to native C/C++ execution and tightly optimized render loops
  • Absolute zero UI blocking during heavy I/O database operations or GIF decoding via strict thread isolation
  • Custom doubly linked list (LinkedList.h) ensures minimal heap fragmentation and stable memory footprints during history pagination

Why I built it

Standard productivity timers are easily bypassed and rely entirely on user discipline. I engineered this tool to solve a personal pain point: hyper-focusing and losing track of time during deep development sessions. By injecting low-level keyboard and mouse hooks into the Windows message queue, the app physically forces the user to step away from the computer until the break cycle completes. It is highly effective for engineers or individuals with ADHD or OCD, breaking the hyper-focus loop to prevent cognitive burnout while automatically logging all completed tasks so users can review their productivity history.

Architecture & decisions

The system is architected across a strict C/C++ language boundary. The frontend is a highly responsive, custom immediate-mode GUI built with Raylib in C, utilizing pthread for non-blocking asynchronous asset decoding. The backend persistence layer is written in modern C++, wrapping SQLite3 with full transaction safety and utilizing spdlog for systemic logging. To bridge the ABI gap, a bespoke C-wrapper explicitly exposes the C++ database object methods to the C GUI, passing memory-safe structs mapped via a custom doubly linked list implementation.

Key features

  1. 01Hardware-level peripheral locking via Win32 WH_KEYBOARD_LL and WH_MOUSE_LL global hooks
  2. 02Persistent session tracking and historical data logging via SQLite to visualize completed work intervals
  3. 03Asynchronous UI and asset loading pipelines using pthread to prevent frame drops
  4. 04C/C++ interoperability layer exposing modern C++ SQLite transactions to the C frontend
  5. 05Failsafe hardware interrupt sequence (CTRL+ALT+SHIFT+Q) mapped directly to the keyboard hook

Technical review

This project serves as a masterclass in C/C++ interoperability and OS-level manipulation, functioning as both a strict system utility and an accessibility tool. By isolating the database and logging logic in modern C++ and exposing it via a strict C ABI, the project maintains memory safety while allowing the Raylib frontend to render at maximum frame rates. The implementation of Windows API hooks perfectly intercepts and discards user-space input, effectively mitigating mental exhaustion, while the integrated SQLite database ensures all focus sessions are meticulously recorded for historical review.