Dream Diary
A personal sleep-dream journal at /[handle]/dreams. Separate from Movie Diary and TV Diary. See also Dayze Agent for log_dream.
What is Dream Diary?
Dream Diary is your personal sleep-dream log. Each entry keeps the full story (narrative), who appeared, where it happened, mood, and optional lucidity notes — not a one-line calendar event.
Before Dream Diary shipped, Dayze Agent sometimes wrote sleep dreams to the calendar via create_event. That path is retired for sleep dreams; use the backfill script below if you still have old calendar rows.
Features
Full narrative
Dreams are stored with the full story in narrative — not shortened to a calendar title. Tap a row to expand.
Search & sort
Search by title, story, people, or places. Sort newest or oldest; grouped by year.
Edit logs (owner)
When logged in as the diary owner, use the pencil to edit date, title, narrative, mood, people, places, or delete. Or tap Log dream on-page for a manual entry.
Separate from calendar
Sleep dreams use log_dream → user_dream_log. They do not clutter your calendar like create_event did before.
Home widgets
Action Items shows a Dream Diary teaser (latest dream preview or “Start your Dream Diary” CTA). Your diaries on Home links Movies, TV, and Dreams.
Dream Logged card
When Dayze Agent logs a dream in chat, you get a Dream Logged card with a link to /[handle]/dreams — the diary refreshes without a full page reload.
Dayze Agent
Say "last night I dreamed about…" — the agent calls log_dream (not create_event). People and places are extracted when mentioned. Life goals ("my dream is to…") are not sleep dreams.
How to Use
Describe a dream
Tell Dayze Agent what you dreamed, or tap Log dream on your diary page when signed in as the owner.
Visit your diary
Go to dayze.com/[your-handle]/dreams to browse entries grouped by year. Expand rows for the full narrative.
Search and edit
Search by person, place, or keyword. Use the pencil to fix date, mood, lucidity, or delete an entry.
Data model
Table: user_dream_log (user_id, dreamed_at, title, narrative, mood, lucidity, people_names[], places[], tags[], notes, source, source_event_id).
Agent tool: log_dream. Navigation: open_app_page destination dream_diary. UI refresh: DAYZE_DREAM_LOG_UPDATED_EVENT.
APIs: POST /api/dreams, PATCH/DELETE /api/dreams/[id]. Page: server-rendered at /[handle]/dreams.
Migrate legacy calendar dreams
If you logged sleep dreams before Dream Diary, they may still exist as calendar events titled like "Dream about …". Run the backfill script to copy them into user_dream_log (idempotent via source_event_id):
npm run backfill:dream-diary -- --handle=YOUR_HANDLE npm run backfill:dream-diary -- --handle=YOUR_HANDLE --delete-events
Use --delete-events only after verifying migrated rows in your diary. Apply migrations migrations/20260605_user_dream_log.sql and migrations/20260606_user_dream_log_source_event.sql in Supabase first.