Skip to content

Add mock DB mode for UI screenshots and demos #2

@MaxGhenis

Description

@MaxGhenis

Problem

Taking screenshots for the website/marketing requires mock data (fake contacts like "Sarah Chen"), but the live app's Google Messages connection immediately syncs real messages over any mock DB swap. This makes the process fragile and has caused issues (stuck processes, DB corruption, real data leaking into screenshots).

Proposed solution

Add a --mock or --demo flag to openmessage serve that:

  1. Copies site/seed-demo.sql into a temporary DB (not the real one)
  2. Disables the Google Messages sync connection so mock data persists
  3. Serves the web UI from the temp DB on the normal port

This would allow one-shot screenshot workflows:

openmessage serve --demo &
sleep 2
screencapture -l <window_id> screenshot.png
kill %1

Current workaround

Use existing pre-captured mock screenshots (site/screenshot-light.png etc.) and composite them with Pillow. Works but is brittle and doesn't capture the real macOS window chrome.

Files involved

  • site/seed-demo.sql — existing mock data seed
  • internal/app/app.go — data dir resolution
  • cmd/serve.go — serve command entry point

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions