← Back to docsRecipe

Sample data injection

Seed a fresh Nimbus install with realistic placeholder data so users see value in the first 30 seconds.

Problem

A blank dashboard after install kills activation. Users who don't see sample scans, recent activity, or a populated inventory within the first session churn at 3× the rate of those who do.

Solution

On first launch, detect an empty state and inject a curated set of sample records — scans, inventory items, and a completed workflow — directly into the local SQLite store before the UI renders.

Implementation

  1. Check settings.has_seeded— skip if true.
  2. Open a write transaction and bulk-insert rows from an embedded JSON resource compiled into the loader.
  3. Include 3 scans, 5 inventory items, and 1 completed workflow with realistic timestamps spanning the last 48 hours.
  4. Set the seed flag and commit. The UI picks up the data on its next reactive poll cycle.

Pitfalls

  • Sample data must never collide with real user data — use a reserved ID prefix.
  • Do not seed if any license-bound state already exists; the user may be re-installing.
  • Keep the embedded JSON under 8 KB to avoid bloating the loader binary.