Architecture
ConvoAct uses MVVM with clean separation across four layers β 37 services, 9 repositories, and 82 SwiftUI files.
Interactive Architecture Diagram
Click any node to explore connections and details. ConvoAct uses MVVM with clean separation across four layers β 37 services, 9 repositories, and 82 SwiftUI files.
Calendar week view, AI Smart Creator, task list with energy costs. 1,018 accessibility annotations across all views.
Focus sessions (Pomodoro/Deep/Freeform), Brain Rot Blocker, 8 Quick ADHD Tools, Body Doubling, Brain Health Score.
Mood check-in, energy forecast, medication tracker, sleep routine, hydration, nutrition, movement, habits.
Claude AI chat with 4 personalities Γ 4 tones Γ 3 verbosity levels = 48 unique configurations.
E2E encryption toggle, Gentle Mode, Siri Shortcuts, widgets, biometric lock, notification preferences.
CRUD operations with online/offline fallback. Auto-encrypts via EncryptionService. Indexes tasks in Spotlight. 40 fields per task including energy cost and shared_with.
Manages Pomodoro, Deep Focus, Short/Long Break modes. Triggers AppBlockingManager shields. Logs HealthKit workouts on completion. Streak tracking.
Aggregates 40+ HealthKit metrics. Computes energy forecast from sleep, HRV, mood data. Feeds BurnoutDetector 9-factor scoring.
Manages Claude conversations. Fetches last 20 messages for context. Extracts commitments via regex. Supports ephemeral and persistent conversations.
Puzzle-verified confirmation, skip tracking, multiple daily times. Logs to HealthKit. 5-minute cache TTL for time-sensitive data.
Daily/weekly habit tracking with streak calculation. Custom frequency, category, reminders. Visual feedback and Siri donation on completion.
Full CRUD with online/offline fallback. Auto-decrypts fetched tasks. Indexes in Spotlight. Caches locally via OfflineStore. Queues changes via SyncEngine when offline. 40 fields per task.
Focus session CRUD β fetchToday, fetchWeek, create, update, markCompleted. Modes: focus, pomodoro, short_break, long_break, freeform. Offline fallback with date-based filtering.
Stores mood valence (-1 to +1), labels, context, associations. Encrypted context field. Supports 7/14/30 day trend queries.
9-factor weighted burnout score (0β100). Factors: Task Overload (20%), Sleep Quality (15%), Mood Trend (15%), Focus Capacity (15%), Physical Signals (10%), Caffeine (5%), App Usage (10%), Biological (10%). Risk levels: π’ Low, π‘ Moderate, π High, π΄ Critical.
Apple Foundation Models (iOS 26+). 24 methods: parseTaskFromText, generateMoodInsight, generateSessionSummary, generateWellnessBriefing, generateJournalPrompt + streaming + structured variants. @Generable output types. Graceful degradation on older iOS.
40+ metrics: steps, active energy, exercise mins, sleep (deep/REM/core), HR, HRV, SpO2, respiratory, Vo2Max, water, dietary energy, protein, carbs, alcohol, caffeine, daylight, audio exposure, State of Mind, menstrual cycle, blood glucose, mindful minutes. 60s refresh throttle.
Calls claude-chat edge function. Claude claude-sonnet-4-20250514 model. Parameters: message, conversationId, personality, tone, verbosity, ephemeral. Rate limit: 60 req/hour. 6-key fallback JSON parsing.
Screen Time API: FamilyControls (.individual auth) + ManagedSettingsStore. System-level app/category shielding during focus. ConvoActShield extension logs block attempts to shared UserDefaults.
Local + Push notifications. Local: mood/focus/habit reminders, medication alarms, quiet hours. Push: morning briefing, coaching nudges, deadline warnings, re-engagement, weekly summary, wellness trends, shared goals. APNs via edge function.
Tracks in-app usage: minutes today, sessions today, last session ago. 7-day rolling history in UserDefaults. ADHD tips: context-switching detection, checking loops, screen break reminders.
PostgreSQL with Row-Level Security. 20+ tables. 11 Edge Functions for AI, push, sharing. Realtime V2 (6 channels). JWT auth with 1-hour expiry. RLS ensures users only access own data.
Offline mutation replay. Max 500-item queue. PendingChange: entityType, action (create/update/delete/toggle_complete/upsert/deactivate), payload, retryCount. Deduplication: removes older changes for same entity+action. Delete-after-create optimization. Exponential backoff retry.
File-based JSON cache in Documents/OfflineCache/. In-memory + disk with completeFileProtection. 12 entity types. Default TTL: 15min, Medications: 5min. Methods: save, load, delete, softDelete, restore, purge for each entity.
AES-256-GCM via CryptoKit. 256-bit SymmetricKey in Keychain (com.convoact.encryption). Field-level encryption: title_encrypted, description_encrypted, etc. Key rotation with versioning. Export/import via Base64 for backup.
NWPathMonitor tracks Wi-Fi/cellular connectivity. @MainActor singleton with NSLock for thread-safe isOnline. Auto-triggers SyncEngine.syncPendingChanges() on reconnect.
Supabase Realtime V2. 6 channels: messages, tasks, session_invites, medications, habits, shared_goals. Callbacks for InsertAction, UpdateAction, DeleteAction. Multi-client collaboration.
Data Flow
See how data moves through the system in different scenarios.
Tech Stack
Siri Shortcuts & App Intents
21 intents enabling voice control and Apple Intelligence routing. IntentDonationManager teaches Siri your habits.