Blog

Building My Daily Hub
Tool 9: Favorite Quotes

A list of favorite quotes with a random one on the dashboard. Copying the Favorite Links pattern made it the fastest tool yet, and the bugs along the way made the best story.

Tool 9 is a list of favorite quotes, each with the text and an optional author. The dashboard shows a random one. It works in signed-in mode with Supabase and in demo mode with localStorage, like the other tools.

Following a Pattern

Favorite Links was the pattern to follow. It already had the service layer, demo mode, dashboard card and migration, so I reused all of it. That made Quotes the fastest tool I have built so far.

I did one thing differently. My notes had an old favorite_quotes table from an early draft. I reviewed it before building, then wrote a fresh migration file instead of reusing it.

The Decisions

Each user gets 100 quotes. The limit is enforced in the app and by a database trigger. Demo mode is capped at 20 in the app.

The page and the card use the Reflection color zone, which is champagne and olive. The dashboard card is styled like the Verse of the Day card and sits right below it. It picks a random quote on load and has a refresh button.

The Database Part

The favorite_quotes table holds quote_text (1 to 500 characters) and an optional author (up to 100). There is an index on user and created date, and row level security so users only see their own quotes.

A BEFORE INSERT trigger raises an error at 100 rows, so the limit holds even if someone bypasses the app. The updated_at column is set by a trigger, not by the app.

Things That Went Wrong

The Verse of the Day card shrank. It collapsed to its content width. The cause was a flex column with margin: 0 auto. The fix was width: 100%.

Psalm verses showed heading text inside the verse. The Bible API returns headings along with the verse text. Now I request HTML and strip the heading elements before showing the text.

The title and category collided at about 340px wide. On phones, the category now stacks under the title.

Demo mode looked broken. It showed "No quotes saved yet" and "NaN%" in goals. The cause was old demo data in the browser from before the new seed existed. Reset Demo Data fixed it. The demo seed only runs when no demo data exists, so schema changes need a reset.

Mobile Polish

This tool also pushed me into a round of mobile cleanup. I tested at 412px (Galaxy S25+) and used 340 to 360px as the floor.

The single-column dashboard order is now Tasks, Today's Goals, Verse, Quote, Weather, Links. Today's Goals rows are compact on phones: the name and count share one line, with a thin bar, and the bar disappears once a goal is done. I also hid the shuffle button on the Quotes page at 412px and below, because the header refresh already covers it.

What I Learned

Copying a working pattern saves time, but still review old drafts before trusting them. Put limits in the database, not only in the UI. Always make a migration file, even when applying the change directly. And test demo mode as its own thing, because it can break on its own.

What's Next

Tool 10 is Journaling.

The app is live at dailyhub.christopherkaelin.com if you want to try it in demo mode.