SereneMind

Health

Original Idea

Mental Health Check-in A mobile app with one-tap mood logs, gentle prompts, and simple trend insights.

Product Requirements Document (PRD): SereneMind

1. Executive Summary

SereneMind is a high-performance, privacy-first mobile application designed to simplify mental health tracking. By leveraging a "one-tap" philosophy, the app removes the friction associated with traditional journaling. Built on a modern, offline-first architecture, it ensures that users can log their emotional states instantly, visualize long-term trends through hardware-accelerated charts, and keep their most sensitive reflections secured via military-grade, end-to-end encryption.


2. Problem Statement

Traditional mental health tracking is often perceived as a "chore." Current solutions require significant time investments for manual entry, leading to inconsistent data. Furthermore, users are increasingly concerned about the privacy of their emotional data, yet many existing apps store sensitive journals in plain text or accessible formats on central servers, creating a significant trust barrier for those managing anxiety or clinical conditions.


3. Goals & Success Metrics

  • User Retention: Achieve a 40% Day-30 retention rate by minimizing logging friction.
  • Engagement: Average logging frequency of 2.5 entries per day.
  • Performance: App launch to "Log Confirmed" state in under 5 seconds.
  • Security: Zero plain-text exposure of journal "Reflections" on the backend database.
  • Sync Reliability: 99.9% data consistency between local SQLite and remote PostgreSQL.

4. User Personas

  • The Overwhelmed Professional (Alex): High-stress job, limited time. Needs a 5-second outlet to track burnout patterns.
  • The Clinical Patient (Jordan): Working with a therapist to identify triggers. Needs exportable PDF reports and high-security journaling.
  • The Mindful Student (Taylor): Tracking how academic pressure affects sleep and mood. Uses wearable integrations to see the "big picture."

5. User Stories

  • As a user, I want to log my mood with a single tap so that I can maintain my tracking habit even when I'm busy.
  • As a privacy-conscious user, I want my journals to be encrypted on my device so that even the app developers cannot read them.
  • As a user in a low-signal area, I want to log entries offline and have them sync automatically when I have a connection.
  • As a patient, I want to see how my physical activity (steps/sleep) correlates with my mood trends over a month.

6. Functional Requirements

6.1 Mood Logging & Quick Actions

  • One-Tap Interface: A dedicated "Quick Log" widget/screen with customizable emojis.
  • Haptic Feedback: Use expo-haptics (ImpactLight) for instant tactile confirmation.
  • Metadata Auto-capture: Automatically attach weather (optional), location (optional), and timestamp to every entry.

6.2 Secure Journaling (Reflections)

  • Markdown Support: Simple text formatting for journal entries.
  • End-to-End Encryption (E2EE): All "Reflection" content must be encrypted using AES-256-GCM before leaving the device.

6.3 Data Visualization

  • Trend Charts: Weekly and monthly line/bar charts powered by Victory Native XL (Skia).
  • Correlation View: Overlay mood scores with step counts and sleep duration from HealthKit/Health Connect.

6.4 Notifications & Prompts

  • Gentle Nudges: Scheduled push notifications with supportive, non-repetitive messaging.
  • Time-Sensitive Prompts: Trigger logs based on physiological spikes (e.g., high heart rate detected via wearable).

7. Technical Requirements

7.1 Tech Stack (2026 Standards)

  • Frontend: React Native 0.83.x (using Fabric Renderer & TurboModules).
  • Runtime: Node.js 24.13.0 (Krypton LTS).
  • Backend Framework: Express 5.2.x (built-in async error handling).
  • ORM: Prisma 7.2.x (Rust-free, ESM-native).
  • Database: PostgreSQL (Remote) + expo-sqlite (Local).
  • Offline Sync: PowerSync for bi-directional SQLite-to-Postgres replication.

7.2 Key Integrations

  • Identity: Firebase Authentication + @sbaiahmed1/react-native-biometrics (hardware-backed).
  • Health: Apple HealthKit & Android Health Connect via react-native-health-connect.
  • Encryption: react-native-quick-crypto (JSI-based OpenSSL 3.6+).

8. Data Model

User Entity

  • id: UUID v7
  • email: String (Unique)
  • notification_preferences: JSONB
  • encryption_salt: String (Used for Argon2id key derivation)

MoodEntry Entity

  • id: UUID v7
  • user_id: UUID (FK)
  • score: Integer (1-10)
  • label: String (e.g., "Anxious", "Joyful")
  • timestamp: DateTime (Indexed)
  • activity_data_snapshot: JSONB (Steps/Sleep at time of entry)

Reflection Entity (Encrypted)

  • id: UUID v7
  • mood_entry_id: UUID (FK)
  • ciphertext: Text (AES-256-GCM output)
  • iv: String (Initialization Vector)
  • auth_tag: String (GCM Auth Tag)

9. API Specification (Selected)

| Endpoint | Method | Description | Payload | | :--- | :--- | :--- | :--- | | /v1/sync/pull | POST | PowerSync stream for incremental updates | { last_sync_version: token } | | /v1/entries | POST | Create new mood log (Server-side validation) | { score: 8, label: 'Calm' } | | /v1/vault | POST | Store encrypted reflection blob | { ciphertext: '...', iv: '...' } |


10. UI/UX Requirements

  • Design System: "Serene UI" — Low-contrast colors (sage greens, soft blues), rounded corners (20px+), and generous whitespace.
  • Optimistic UI: Use React 19 useOptimistic hook for mood logs so the UI updates in <100ms.
  • Micro-animations: All transitions between Weekly/Monthly views must use Reanimated 4 Worklets to run at 120Hz on supported screens.

11. Non-Functional Requirements

  • Privacy: HIPAA/GDPR compliant. EU user data geofenced to eu-central-1.
  • Security: AES-256-GCM for storage; TLS 1.3 for transit. Argon2id for key derivation.
  • Offline-First: All core features (logging, viewing history) must work without an internet connection.
  • Accessibility: WCAG 2.1 Level AA compliant; support for high-contrast mode and screen readers.

12. Out of Scope

  • In-app clinical therapy sessions.
  • Public social feed or mood sharing (Community features).
  • Live crisis hotlines (Static directory only).

13. Risks & Mitigations

  • Risk: User loses their master password (E2EE key).
    • Mitigation: Implement a "Recovery Kit" (PDF) with a physical emergency key, clearly stating that developers cannot reset passwords.
  • Risk: Data conflicts during offline sync.
    • Mitigation: Use UUID v7 for time-ordered sorting and Last-Write-Wins (LWW) conflict resolution logic.

14. Implementation Tasks

Phase 1: Project Infrastructure

  • [ ] Initialize React Native 0.83.x project with New Architecture enabled.
  • [ ] Set up Node.js 24.13.0 backend with Express 5.2.x.
  • [ ] Configure Prisma 7.2.x with prisma.config.ts.
  • [ ] Set up AWS App Runner VPC Connector for secure RDS access.

Phase 2: Local-First & Sync

  • [ ] Integrate expo-sqlite and PowerSync for local persistence.
  • [ ] Implement UUID v7 generator for offline-ready primary keys.
  • [ ] Build the "One-Tap" mood logging component with useOptimistic.
  • [ ] Configure TanStack Query v6 with persistence plugin.

Phase 3: Privacy & Security

  • [ ] Implement Argon2id key derivation using @sphereon/react-native-argon2.
  • [ ] Set up react-native-quick-crypto for AES-256-GCM encryption.
  • [ ] Build the Biometric Lock screen using expo-local-authentication.
  • [ ] Audit backend for PHI/PII separation (Store logs and PII in separate DB schemas).

Phase 4: Data & Insights

  • [ ] Integrate Victory Native XL for Skia-powered trend charts.
  • [ ] Implement Apple HealthKit and Android Health Connect sync hooks.
  • [ ] Build the "Correlation Dashboard" (Steps vs. Mood).
  • [ ] Create the PDF Report generator for therapy sharing.

Phase 5: Polish & Compliance

  • [ ] Implement Expo Haptics for all interactive elements.
  • [ ] Set up geofencing for GDPR compliance (AWS region routing).
  • [ ] Final performance audit for <5s "Time to Log."
  • [ ] Conduct end-to-end "Zero-Knowledge" verification test.