A shared, realtime daily-care checklist for two parents — feeding, sleep, diapers, tummy time, bath, and medicine. Built on Next.js (App Router) + Supabase (Postgres, Auth, Realtime), styled from the "Day Rail" direction of the BabyLuna Sync design export.
- Next.js 16 (App Router, TypeScript, Turbopack)
- Tailwind CSS v4, themed with the design's actual tokens (
src/app/globals.css) - Supabase: Postgres + Auth (email/password) + Realtime
- Deployed to Vercel (Hobby/free tier compatible)
- Create a new project at supabase.com/dashboard — use a new project, not one already running another app.
- In Database → Extensions, enable
pg_cron(needed for the daily reset; see below). If your plan doesn't expose this toggle, ask Supabase support to enable it — the migration will fail on thecreate extension pg_cronline without it. - Run the migrations in
supabase/migrations/(in order) against the project (SQL Editor, orsupabase db pushwith the CLI, or via the Supabase MCPapply_migration). - In Authentication → Providers, email/password should already be on. If you want the smoothest two-person setup, consider turning off "Confirm email" for this small project — the app still works with confirmation on, it just adds a "check your email" step between signup and onboarding.
Copy .env.local.example to .env.local and fill in your project's URL and anon key (Project Settings → API).
cp .env.local.example .env.localSUPABASE_SERVICE_ROLE_KEY isn't used by the app today (every query runs as the signed-in user, under RLS) — it's there for a future admin script (e.g. a Web Push sender) and should never be sent to the browser.
npm install
npm run devVisit http://localhost:3000, sign up, then either create a household or join one with an invite link from Settings.
Recurring tasks aren't scheduled at a fixed clock time — each template just configures an interval (e.g. "every 3h") or specific weekdays (e.g. bath on Mon/Wed/Sat). There is always exactly one open occurrence per active template; logging it computes and inserts the next one, rolling forward continuously rather than being regenerated in a daily batch. A household's daily reset time only archives completed items out of the visible list once the next cycle starts — it never disturbs an already-ticking countdown.
A pg_cron job inside Postgres (babyluna-occurrence-sweep, every 15
minutes) calls sweep_missing_occurrences() as a backstop, giving any
template without an open occurrence one (new templates, reactivated ones, or
a rare missed roll-forward). "Sync tasks" in Settings calls the equivalent
resync_household_tasks() RPC directly. Neither path touches a Vercel
serverless function, so there's no Edge/Node runtime concern here.
In-app only for now, driven by the same Supabase Realtime subscriptions used
for dashboard/task sync (no polling). Full Web Push (service worker + VAPID
keys + a subscription table) is a real chunk of scope beyond that, so it's
deferred — when it's added, the send route must run on the Node runtime
(export const runtime = "nodejs"), since the web-push package depends on
Node's crypto module and isn't Edge-compatible.
- Push this repo to GitHub and import it in Vercel.
- Add the same environment variables from
.env.localin the Vercel project settings. - Deploy — no
vercel.jsonor cron config needed, since the reset runs inside Supabase.
src/lib/database.types.ts is hand-written to match the migration. Once the
project is linked with the Supabase CLI or MCP, regenerate it with
generate_typescript_types (or supabase gen types typescript) and replace
the file wholesale.