Building My Daily Hub
Tool 7: Habit / Goal Tracking
The daily screen where habits and goals finally get used: logging progress, watching bars fill, and reviewing the month behind you.
Tools 5 and 6 let you define habits and set goals against them. Tool 7 is where you actually use them every day — logging progress, watching bars fill, and reviewing the month behind you.
The Core Loop
The Tracker screen shows every goal that is active today. For boolean habits, you mark it done. For cumulative and frequency habits, you increment or decrement a count. Each entry writes a row to progress_entries, which Goals already owned — the Tracker is the first screen to put real rows in that table.
Progress is calculated as sum(counts) × incrementAmount / targetValue, surfaced as a percentage and a colour-coded bar. The same helper lives in utils/habitFormatting.ts and is shared between the Tracker screen and the dashboard card. For cumulative habits, the counter between − and + shows the running total in the habit’s own unit (e.g. 0.25, 0.5, 1.75 miles) rather than a raw tap count. Progress labels trim trailing zeros so 1.50 displays as 1.5.
The Monthly Summary
The summary view is a compact paper-tracker-style grid: habits run across the top as column headers (rotated vertical labels), days run down the left as numbered rows. A filled cell means something was logged that day; an outlined cell marks today. Tapping any day number jumps straight to that date’s log view. With around ten active goals, one grid per habit would have made the summary screen impossibly long — a single shared grid keeps everything in view at once.
The Dashboard Card
The TrackerCard gives the home screen a read-only snapshot: every goal active today, its progress bar, and its current percentage. It is intentionally passive — no logging from the dashboard. If you want to log, you go to the Tracker.
The card reuses the same progress calculation as the full screen, so the numbers are always consistent.
Demo Mode
Demo mode seeds a set of progress_entries alongside the existing habits and goals, so a first-time visitor sees bars with real values rather than empty placeholders. The seeded entries spread across the current month, which also gives the monthly calendar something to display.
A Note on the Backend
The progress_entries table and progressService.ts were written back when Goals shipped, because the schema needed the foreign key relationship defined before Goals could enforce its edit and delete rules. Tool 7 is the first screen to actually call that service. It was satisfying to wire up a backend that had been sitting idle for a couple of tools.
What's Next
Tool 8 is Favorite Links — a simple list of bookmarked URLs with titles, a 25-link limit, and a dashboard card showing quick-access links. No new backend complexity; it's a good palate cleanser after the interlocking habits/goals/tracker work.
The app is live at dailyhub.christopherkaelin.com if you want to try it in demo mode.