Introduction
Habit Tracker is a macOS application that helps you stay productive by blocking distracting websites when your daily habits aren't completed.
How It Works
- Define habits - Create habits with optional deadlines
- Track completion - Mark habits as done each day
- Automatic blocking - Websites are blocked when habits become overdue
- Enforcement - A background daemon modifies
/etc/hoststo enforce blocking
Architecture Overview
The application is built as a monorepo with four main packages:
| Package | Description |
|---|---|
shared | TypeScript types and utilities |
backend | Express API server with SQLite |
frontend | React + Vite webapp |
daemon | Background service for /etc/hosts management |
Blocking Logic
Websites are blocked when any habit with a deadline becomes overdue (current time >= deadline). Blocking continues until all overdue habits are completed or skipped.
Habits without deadlines are simple checklist items that never trigger blocking.