I kept waking up from vivid dreams and losing
them before I could write anything down.
The neuroscience is clear — during REM sleep,
norepinephrine (the neurotransmitter that
consolidates memories) is almost completely
suppressed. Dreams exist only in working memory
when you wake up. The moment your brain starts
processing new inputs the memory gets displaced.
The window is roughly 2 minutes.
So I built around that window instead of ignoring it.
How it works:
- Set your alarm inside Somnia
- When it fires, a server-side entry window opens
- Capture screen launches directly from notification
- Type the first word and the timer stops
- Miss the 2 minutes and that day locks forever
- No override, no extension, no exceptions
The window enforcement is server-side only —
entry_windows table in Postgres with
window_expires_at set when the alarm fires,
validated on every API call. The client timer
is purely visual. You can't cheat it by killing
the app or going offline.
Stack: Next.js 14 App Router, Supabase, Tiptap,
web-push + VAPID, GitHub Actions cron (Vercel
Hobby blocks minute-level crons so GitHub Actions
calls /api/cron/fire-alarms every minute), Vercel.
Free tier available. Happy to answer questions
about the implementation or the product.