HabitCanvas

Productivity

Original Idea

Habit Streak Wallpaper A mobile app that generates a dynamic phone wallpaper showing your current habit streaks, updated daily as motivation.

Product Requirements Document (PRD): HabitCanvas

1. Executive Summary

HabitCanvas is a productivity-focused mobile application that transforms a user’s phone wallpaper into a dynamic, aesthetic dashboard of their habit streaks. By leveraging modern rendering engines and system-level automations, the app eliminates the "out of sight, out of mind" problem of traditional habit trackers. HabitCanvas makes progress unavoidable and visually rewarding, turning the most-viewed screen on a user’s device into a powerful motivational tool.

2. Problem Statement

Most habit trackers require users to proactively open an app to view progress. This friction often leads to "tracking fatigue" where users stop logging habits because the data is buried. Consequently, streaks are broken not because of a lack of will, but because of a lack of consistent visual cues. There is a market gap for a "zero-effort" visualization tool that integrates habit data into the OS-level aesthetic of the smartphone.

3. Goals & Success Metrics

  • Engagement: Achieve a 60% Day-30 retention rate by making habit progress part of the device's visual identity.
  • Reliability: 99.9% success rate for background wallpaper updates (measured via telemetry).
  • User Satisfaction: Maintain a 4.7+ star rating with specific praise for "Minimalist Templates" and "Automation Ease."
  • Growth: 30% of new users acquired through social sharing of "Wallpaper Milestones."

4. User Personas

4.1 The Aesthetic Optimizer (Maya, 26)

  • Profile: Creative professional, values "Digital Sobriety" and clean UI.
  • Need: Wants to track habits (water, meditation) without an ugly, cluttered app interface.
  • Motivation: Visual harmony and minimalist data art.

4.2 The Data-Driven High-Achiever (Liam, 34)

  • Profile: Software engineer, uses Quantified Self tools.
  • Need: Wants automated tracking (HealthKit integration) and "Gaps and Islands" streak logic.
  • Motivation: Seeing hard data and charts directly on his lock screen.

5. User Stories

  • As a user, I want to select a minimalist template so my habit data looks like professional wallpaper art.
  • As a user, I want my wallpaper to update automatically when I complete a habit so I don't have to manually change it.
  • As a user, I want to sync my step count from Apple Health/Health Connect so my wallpaper reflects my physical activity without manual logging.
  • As a user, I want to use "Skip Tokens" for emergency breaks so my visual streak doesn't reset during illness.

6. Functional Requirements

6.1 Habit Management Engine

  • Support for Daily, Weekly, and "Specific Day" frequencies.
  • "Gaps and Islands" SQL-based streak calculation (offline-resilient).
  • Skip/Emergency token system (configurable per habit).

6.2 Dynamic Wallpaper Engine

  • Template Library: Minimalist (Glassmorphism), Data-Heavy (Heatmaps), and Abstract (Blooming Flowers).
  • Customization: Color palette selection (Wide Gamut support), font scaling, and background image uploads.
  • High-Res Export: Ability to render 300 DPI images for high-density displays using ui.PictureRecorder.

6.3 Automation & Integration

  • Android: Background updates via WorkManager using WallpaperManager.setStream.
  • iOS: Shortcut-based automation using App Intents (iOS 18+ style) for "Zero-Click" updates.
  • Health Sync: Incremental syncing via health_connector for steps, sleep, and heart rate.

7. Technical Requirements

7.1 Tech Stack (2026 Standards)

  • Frontend: Flutter 3.38.x (using Dart 3.10 shorthands and Impeller rendering engine).
  • Backend: Node.js 22+ on Vercel (using the new Node.js Permission Model).
  • Database: Supabase (Postgres) + PowerSync for SQLite offline-first synchronization.
  • Rendering: Flutter GPU API for complex 3D habit visualizations; render package for high-res offscreen capture.
  • Security: Zod for runtime type validation; AWS S3 with Origin Access Control (OAC).

7.2 OS-Specific APIs

  • Android: Target SDK 35 (Android 15/16). Implementation of WallpaperDescription for multi-instance wallpapers.
  • iOS: Xcode 17 mandatory. Integration with HKAnchoredObjectQuery for health background updates.

8. Data Model

8.1 Habit Entity

| Field | Type | Description | | :--- | :--- | :--- | | id | UUID | Primary Key | | user_id | UUID | FK to Users | | title | String | Habit name | | goal_type | Enum | Count, Duration, or Binary | | frequency | JSONB | e.g., {"days": [1,3,5], "times_per_day": 1} |

8.2 HabitLog (Immutable History)

| Field | Type | Description | | :--- | :--- | :--- | | id | UUID | Primary Key | | habit_id | UUID | FK to Habit | | logged_at | Timestamptz | Local-time anchored date | | status | Enum | Completed, Skipped, Failed |

9. API Specification

9.1 Sync Data

POST /api/v1/sync

  • Request: List<HabitLog> (Local mutations).
  • Response: SyncResponse (Server-calculated streaks and "Gaps and Islands" repairs).

9.2 Generate Wallpaper Asset

GET /api/v1/wallpaper/signed-url

  • Request: TemplateConfig.
  • Response: Pre-signed S3 URL (60-second expiry) for background asset upload.

10. UI/UX Requirements

  • Design Language: "Responsible Glassmorphism" with fluid variable typography.
  • The "Canvas" Tab: A live-preview editor using RepaintBoundary to isolate the wallpaper preview from the UI.
  • Haptic Feedback: Specialized haptic patterns for "Streak Milestones" (e.g., 7-day, 30-day).
  • Accessibility: Support for iOS/Android high-contrast modes; isFocused semantics for screen readers.

11. Non-Functional Requirements

  • Performance: Wallpaper generation must complete in < 2 seconds on-device.
  • Battery: Background sync must not exceed 1% of total daily battery usage.
  • Privacy: Health data must be processed via pseudonymized metadata; no raw GPS or EXIF data stored.
  • Offline: 100% of habit logging and visual preview functionality must work without an internet connection.

12. Out of Scope

  • Community Social Feed (Global).
  • Desktop/Web version (Wallpaper focus is mobile-only).
  • AI-based habit coaching/chatbots.

13. Risks & Mitigations

  • Risk: iOS Shortcut updates are still too "manual" for some users.
    • Mitigation: Deep-link users directly to a pre-built Shortcut file with "Show Preview: Off" pre-configured.
  • Risk: Android WorkManager killed by "Battery Savers" (Samsung/OnePlus).
    • Mitigation: Implement "Silent Push" FCM data messages to wake the background isolate.

14. Implementation Tasks

Phase 1: Project Foundation

  • [ ] Initialize Flutter 3.38.6 project with Impeller enabled
  • [ ] Configure Supabase Auth and PowerSync local-first sync rules
  • [ ] Set up Dart 3.10 linting with "Dot Shorthands" enforcement
  • [ ] Implement Gaps & Islands streak logic in Postgres (Supabase RPC)

Phase 2: Core Habit & Rendering Engine

  • [ ] Build Habit Creation workflow with frequency config
  • [ ] Implement ui.PictureRecorder canvas for 300 DPI wallpaper rendering
  • [ ] Create initial 3 templates: "Minimalist Ring," "Heatmap," and "Glassmorphism Card"
  • [ ] Integrate health_connector for incremental Health Connect/HealthKit sync

Phase 3: Wallpaper Automation

  • [ ] (Android) Implement WallpaperManager.setStream via Platform Channels
  • [ ] (Android) Configure WorkManager for periodic background updates
  • [ ] (iOS) Develop App Intent in Swift for Shortcut integration
  • [ ] (iOS) Build "Shortcut Installation" UI guide for zero-click updates

Phase 4: Backend & Security

  • [ ] Deploy Vercel Edge Functions for API layer
  • [ ] Set up S3 Ingest/Distribution buckets with AWS OAC
  • [ ] Implement Lambda (Node.js 22) for EXIF stripping and image optimization via Sharp
  • [ ] Configure Zod validation for all API ingress points

Phase 5: Polish & Launch

  • [ ] Implement Haptic Feedback patterns for milestones
  • [ ] Conduct battery-drain audit using Android Power Profiler
  • [ ] Finalize "Digital Sobriety" UI theme and glassmorphism components
  • [ ] Beta test with "Aesthetic Optimizer" persona group