Skip to content

MohammedTsmu/Ink-Flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–¨οΈ Ink Flow β€” Printer Maintenance Tracker

Version 2.0.0 | Windows Desktop Application

Ink Flow is a smart Windows desktop app that helps prevent liquid ink printer nozzle clogging by tracking printer usage, sending automatic maintenance prints, detecting external print jobs, and alerting you when printers sit idle too long.

Why? Liquid ink printers (inkjet, EcoTank, SuperTank, etc.) can clog their nozzles if left unused for extended periods. Ink Flow ensures every printer gets used regularly β€” automatically.


✨ Features

Core Printer Management

  • Add, edit, and delete printers with custom names, models, ink types, idle thresholds, and warning periods
  • Auto-detect system printers β€” scans Windows for installed printers via WMI and lets you add them instantly
  • Online/offline status β€” real-time printer connectivity checks with visual indicators
  • Manual logging β€” quickly record "Printed" or "Cleaned" actions per printer

Smart Monitoring

  • Idle countdown timer β€” each printer card shows a progress bar counting down to the maintenance deadline
  • Overdue severity levels β€” Low Risk, Moderate Risk, High Risk, and Critical Risk based on how long a printer has been idle
  • Automatic print job detection β€” monitors the Windows Print Service event log (Event ID 307) every 5 minutes and auto-logs detected print jobs
  • Print job deduplication β€” won't double-count events within a Β±2 minute window

Automatic Maintenance

  • Auto maintenance printing β€” when enabled, automatically sends a test page to overdue/urgent printers using notepad.exe /p (antivirus-safe, no shell commands)
  • Offline-aware β€” skips auto-printing for offline printers and notifies you instead
  • Configurable per-printer β€” set custom max idle days and warning thresholds for each printer

Notifications & Alerts

  • Hourly status checks β€” automatically scans all printers and triggers alerts for those needing attention
  • Standalone alert popup β€” always-on-top, frameless window that appears over all apps even when the main window is hidden
  • In-app alert modal β€” color-coded, severity-sorted alerts with dismiss confirmation
  • Taskbar flashing β€” grabs your attention when printers need maintenance
  • Escalating severity β€” alerts escalate from Warning β†’ Urgent β†’ Overdue β†’ Severe β†’ Critical based on idle duration

Advanced History

  • Full event timeline β€” all maintenance events grouped by date with relative timestamps ("2h ago", "Yesterday")
  • Multi-filter system β€” filter by event type (prints/cleans), date range (today, 7d, 30d, 90d, all), specific printer, or search text
  • Source detection β€” each event is tagged as Manual, Auto-detected, Auto-maintenance, or Test print
  • Summary statistics β€” total events, print count, clean count, and auto-detected count
  • Delete events β€” remove individual events with double-click confirmation
  • Export CSV β€” copy filtered history to clipboard as CSV with one click

Statistics Dashboard

  • 30-day activity chart β€” stacked bar chart showing daily prints and cleans with hover tooltips
  • Per-printer breakdown β€” sorted by total activity with visual progress bars
  • Summary cards β€” total printers tracked and total events logged

Settings & Preferences

  • Start with Windows β€” auto-launch minimized to system tray on login
  • Auto maintenance print toggle β€” enable/disable automatic test printing
  • Dark / Light theme β€” full theme support across all UI components
  • Backup & Restore β€” export and import all printer data as JSON files

System Tray

  • Minimize to tray β€” closing the window hides to tray instead of quitting
  • Tray context menu β€” Show Ink Flow / Quit
  • Double-click to show β€” quickly access the app from the tray
  • Hidden startup β€” starts minimized to tray when launched at Windows boot

πŸ› οΈ Tech Stack

Technology Version Purpose
Electron 33.2.0 Desktop framework, native OS integration
React 18.3 UI components
TypeScript 5.7 Type-safe code across main and renderer
Vite 6.0 Fast renderer bundling
Tailwind CSS 3.4 Utility-first styling with dark mode

πŸ“ Project Structure

Ink Flow/
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ assets/
β”‚   └── icon.png
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/                          # Electron main process
β”‚   β”‚   β”œβ”€β”€ main.ts                    # App entry, window & tray creation
β”‚   β”‚   β”œβ”€β”€ store.ts                   # JSON data persistence (atomic writes)
β”‚   β”‚   β”œβ”€β”€ ipc-handlers.ts            # IPC API bridge (22+ channels)
β”‚   β”‚   β”œβ”€β”€ preload.ts                 # Context-isolated renderer API
β”‚   β”‚   β”œβ”€β”€ printer-detect.ts          # Windows WMI printer detection
β”‚   β”‚   β”œβ”€β”€ notifications.ts           # Hourly status checker & alert dispatcher
β”‚   β”‚   β”œβ”€β”€ auto-print.ts              # Safe test printing via notepad.exe
β”‚   β”‚   β”œβ”€β”€ print-monitor.ts           # Windows Event Log print job scanner
β”‚   β”‚   β”œβ”€β”€ autostart.ts               # Windows startup shortcut management
β”‚   β”‚   β”œβ”€β”€ alert-window.ts            # Standalone always-on-top alert popup
β”‚   β”‚   β”œβ”€β”€ tray.ts                    # System tray icon & context menu
β”‚   β”‚   └── window-ref.ts              # Shared window reference module
β”‚   └── renderer/                      # React frontend
β”‚       β”œβ”€β”€ index.tsx                   # React mount point
β”‚       β”œβ”€β”€ App.tsx                     # Root component & state management
β”‚       β”œβ”€β”€ index.html                  # HTML template
β”‚       β”œβ”€β”€ globals.css                 # Base Tailwind styles
β”‚       β”œβ”€β”€ ThemeContext.tsx             # Dark/light theme provider
β”‚       β”œβ”€β”€ types/
β”‚       β”‚   └── index.ts                # TypeScript interfaces & Window API types
β”‚       β”œβ”€β”€ hooks/
β”‚       β”‚   └── useEscapeKey.ts         # Reusable Escape key hook for modals
β”‚       └── components/
β”‚           β”œβ”€β”€ Layout.tsx              # Main UI shell with navigation
β”‚           β”œβ”€β”€ Dashboard.tsx           # Printer grid with action buttons
β”‚           β”œβ”€β”€ PrinterCard.tsx         # Individual printer status card
β”‚           β”œβ”€β”€ AddPrinterModal.tsx     # Create new printer form
β”‚           β”œβ”€β”€ EditPrinterModal.tsx    # Edit printer settings
β”‚           β”œβ”€β”€ DetectPrintersModal.tsx  # Auto-detect system printers
β”‚           β”œβ”€β”€ HistoryPanel.tsx        # Advanced event history viewer
β”‚           β”œβ”€β”€ SettingsPanel.tsx       # App settings & backup
β”‚           β”œβ”€β”€ StatisticsPanel.tsx     # Activity charts & stats

β”‚           └── AlertModal.tsx          # In-app alert display
└── dist/                              # Compiled output
    β”œβ”€β”€ main/                          # Compiled Electron main process
    └── renderer/                      # Bundled React app

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ with npm
  • Windows 10/11 (required for printer detection, event log monitoring, and startup integration)

Installation

# Clone or navigate to the project
cd "Ink Flow"

# Install dependencies
npm install

# Run in development mode
npm run dev

Available Scripts

Command Description
npm run dev Start dev server (Vite + Electron with hot reload)
npm run build Compile TypeScript + bundle renderer with Vite
npm start Launch the built app with Electron
npm run package Build + generate Windows NSIS installer

πŸ“¦ Building for Distribution

# Build and create Windows installer
npm run package

This generates an NSIS installer in the release/ directory. The installer allows users to choose their installation directory.


πŸ”§ How It Works

Data Storage

All printer and event data is stored in a single JSON file at:

%APPDATA%/ink-flow/inkflow-data.json
  • Atomic writes β€” uses temp file + rename to prevent corruption
  • Auto-migration β€” automatically adds missing fields when loading older data formats
  • ID management β€” recalculates ID counters on load to prevent collisions

Print Job Detection

The app queries the Windows Print Service Operational event log using PowerShell:

Get-WinEvent -LogName "Microsoft-Windows-PrintService/Operational"
  -FilterXPath "*[System[EventID=307]]" -MaxEvents 50

This detects Document Printed events and matches them against your tracked printers by name.

Safe Test Printing

Instead of using shell commands (which trigger antivirus false positives), the app:

  1. Writes a text file to a temp directory using fs.writeFileSync()
  2. Launches notepad.exe /p tempfile.txt using Node.js execFile() (no shell)
  3. Cleans up the temp file after printing

Notification Flow

Every 60 minutes:
  β†’ Check all printer statuses
  β†’ Build alert list (warning/urgent/overdue/severe/critical)
  β†’ Show standalone alert popup (always-on-top)
  β†’ Send alerts to renderer (in-app modal)
  β†’ Flash taskbar + restore window
  β†’ Run auto-maintenance prints (if enabled)

🎨 Themes

Ink Flow supports Dark and Light themes. Toggle from the top navigation bar. The theme preference is persisted across sessions.


⌨️ Keyboard Shortcuts

Key Action
Escape Close any open modal or panel

πŸ”’ Security

  • Context isolation enabled on all windows (main + alert popup)
  • Sandbox enabled on popup windows
  • No nodeIntegration in any renderer process
  • No shell execution β€” all system commands use execFile() with explicit paths
  • Atomic file writes β€” prevents data corruption on crashes
  • HTML escaping β€” all dynamic content in alert popups is escaped (including single quotes)
  • Input validation β€” imported data is validated for correct structure before loading

πŸ“‹ Requirements

  • Operating System: Windows 10 or Windows 11
  • Windows Print Spooler service must be running (default on all Windows with printers)
  • PowerShell (pre-installed on all modern Windows)
  • No additional Windows services or drivers required

πŸ“„ License

This project is proprietary software.


Built with ❀️ for printer maintenance peace of mind.

About

πŸ–¨οΈ Windows desktop app to prevent ink printer nozzle clogging by tracking and scheduling automatic maintenance prints

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages