I Put My Son in a Swamp
a day ago
- #system-design
- #parenting-tech
- #data-tracking
- The author modeled his newborn son as a typed resource in a system called 'swamp,' which includes a sync method for pulling the last seven days of data, reports summarizing sleep and feeding, and idempotent delete functionality.
- He developed multiple interfaces to track the baby, including a mobile app, a Pebble watchapp (for which he lacks the hardware), a conversational server, Home Assistant for reminders, and a swamp extension, all connecting to the same Baby Buddy REST API.
- The tracking system serves as a shared source of truth for two exhausted parents, facilitating handoffs during shifts by providing accurate, real-time data on feeding, sleep, diapers, and medication without needing to wake each other.
- Key engineering lessons emerged: ensuring data completeness (e.g., using a 'truncated' flag to indicate missing records) and designing for human error (e.g., soft-deleting timers to avoid data loss from race conditions or mistakes).
- The author open-sourced the extension on the swamp registry, noting that the instincts driving this project also apply to his work at Shrug PW, where stakes are higher but sleep is better.