Problem
My cats’ feeding log started as a spreadsheet: what they were served, how much was left, how eager they were, and their weight. Once other people started helping with their care, a sheet couldn’t say who may record what, remind the right person at the right local time, or warn us before a food bag ran out.
Architecture
Gemini is called during the photo upload request; reminders, the price check and backups run as Solid Queue jobs.
A server-rendered Rails monolith with Hotwire. The same HTML serves desktop browsers, the installable
PWA and an Android app built on Hotwire Native, which gets a :native view variant. Background jobs,
caching and WebSocket pub/sub all run on PostgreSQL through Solid Queue, Solid Cache and Solid Cable.
Full data flow: clients → app → outside services
Arrows show data flow. Gemini is called during the photo upload request; reminders, the price check and backups run as Solid Queue jobs.
Engineering challenges
- Who may do what. Owners invite caregivers, who record care, and viewers, who only look, through an account or a personal read-only link. One household policy sits behind every permission check.
- Everyone sees the same page. A one-tap care log shows up live on everyone else’s page through Turbo Streams, so everyone works from the same up-to-date page.
- The right reminder at the right local time. Care and weight reminders fire at each household’s local time, by the channel each person picked, falling back from Android push to LINE to email.
- Shopping sites that change without notice. The scraper’s selectors survive hashed class names that change on every redeploy. A changed layout is told apart from “no results” and raises an alert, requests are rate-limited and follow robots.txt, and tests run against saved HTML fixtures.
- Unstructured to structured. Gemini vision reads varied health-checkup photos, and its output is validated as ActiveRecord records before anything is saved.
Technical decisions
| Decision | Why |
|---|---|
| A server-rendered monolith with Hotwire Native, not a separate mobile app | One codebase and one set of views for web, PWA and Android, maintained by one person. |
| Solid Queue, Cache and Cable on PostgreSQL | No Redis to run or pay for; one database to back up. |
| One role policy for every permission | Access rules live in one place instead of being repeated in each controller. |
| Polite, allow-listed scraping | Only two allow-listed sites, rate-limited, following robots.txt, with an alert when a page layout changes. |
| Validate AI output before saving | Gemini’s output becomes validated ActiveRecord records, so a bad read is rejected instead of stored. |
The full system design, including the security review and its open items, is in the repo’s architecture document.
Results
- In daily use by my household.
- About 700 tests, 61 of them browser tests, with Brakeman, RuboCop and dependency audits in CI.
- Runs on web, as a PWA and as an Android app, in English, 繁體中文 and 日本語.
What it does
- Collaboration: Owners invite caregivers and share read-only links, with one role policy behind every permission. One-tap care logs appear live on everyone's page via Turbo Streams.
- Price scraping: Monthly Nokogiri scraper across two Taiwan shopping sites (BigGo HTML, PChome JSON API), ranking listings by NT$ per kg. Selectors survive hashed class names that change on redeploy; a changed layout is told apart from "no results" and raises an alert; requests are rate-limited and follow robots.txt; tested against saved HTML fixtures.
- Background work: Care and weight reminders at each household's local time, with fallback from Android push (Firebase) to LINE to email, plus daily Google Drive backups at each owner's chosen hour.
- Unstructured to structured: Gemini vision turns varied health-checkup photos into validated ActiveRecord records.
- Testing and CI: Minitest suite with browser tests, plus Brakeman, RuboCop and dependency audits in CI; security reviews and their open items are written up in the architecture doc.
Demo
An 85-second walkthrough of Pet Tracker on a phone. The live app is invite-only because it holds my family's real data. I can walk you through it on a call.