Systemic - Personal Habit & Goal Tracking
A local-first iOS productivity app that reduces habit-tracking friction with automatic tracking, daily check-ins, and a structured reflection system.
Overview
Systemic is a local-first iOS productivity app inspired by Atomic Habits. It focuses on small, repeatable actions and reduces friction with automatic tracking.
It combines daily check-ins, goal hierarchies, reflections, and a notes system, with widgets for quick progress. Auto-tracking supports HealthKit, Screen Time, Calendar, and Location sources, with iCloud sync planned.
Key Features
Auto-Tracking + Widgets
Auto-complete habits with widget-first quick actions.
Daily Habit Tracking
Morning check-ins, habit dashboard, and reflections.
Goal Management
Life areas, nested goals, and progress tracking.
Brain - Notes System
Notes, reflections, insights, and tagged context.
Auto-Tracking & Smart Completions
Systemic includes an extensible auto-tracking engine that can complete habits using real-world signals:
- HealthKit metrics (steps, exercise minutes, etc.)
- Screen Time usage thresholds
- Calendar events (habit tied to a scheduled block)
- Location presence (e.g., gym check-ins)
Auto-tracking is configured per habit, and the UI surfaces live progress toward thresholds so users can still see why a habit was marked complete.
Daily Habit Tracking
The Today tab serves as the daily command center:
- Morning check-in - Track your mood, energy level, and daily intentions
- Habit dashboard - Track completion with visual progress indicators
- Evening reflection - Capture mood and reflection notes
- Activity stats - View streaks, completion rates, and patterns
Goal Management
Goals are organized hierarchically within life areas:
- Life areas - Health, Learning, Work, Creative, Relationships, Finance
- Goal templates - Pre-built objectives to get started quickly
- Subgoals - Break large goals into manageable pieces
- Habit linking - Connect daily habits to larger goals
- Progress tracking - Status indicators (working, almost there, complete)
Brain - Notes & Reflections
The Brain tab captures thoughts that emerge during the day:
- Multiple note types - Notes, reflections, insights, important links
- Tag organization - Flexible categorization
- Pinned notes - Quick access to active references
- Context linking - Connect notes to relevant habits and goals
Theming & Customization
Five carefully designed color themes with full light/dark mode support:
- Ember, Ocean, Forest, Aurora, Sand
- Consistent color system across all views
- Observable theme provider for reactive updates
Home Screen Widgets
Quick access to habits without opening the app:
- Daily Progress - See completion at a glance
- Habit Checkoff - Mark habits complete from the widget (App Intents)
- Lock Screen widgets - iOS 16+ support
Technical Architecture
System Overview
Data Layer
Systemic uses GRDB for local-first persistence plus SQLiteData to keep database access strongly-typed and composable.
@Table
struct HabitEntry: Identifiable, Equatable {
let id: UUID
var date: Date = Date()
var isCompleted: Bool = false
var notes: String?
var completedAt: Date?
var isAutoCompleted: Bool = false
var autoTrackValue: Double?
// Foreign key
var habitID: Habit.ID
}
@FetchAll(HabitEntry.lastDays(30)) private var habitEntries: [HabitEntry]
extension HabitEntry {
nonisolated static func lastDays(_ count: Int) -> Where<HabitEntry> {
let calendar = Calendar.current
let today = calendar.startOfDay(for: Date())
guard let startDate = calendar.date(byAdding: .day, value: -(count - 1), to: today) else {
return Self.where { _ in false }
}
let start = calendar.startOfDay(for: startDate)
return Self.where { $0.date >= start && $0.date <= today }
}
}This pattern creates an easy-to-test SQL layer which can be immediately referenced in the UI. It also supports adding custom queries to reduce fetched data.
Data Model:
Dependency Injection
The app uses swift-dependencies for clean testability:
@Dependency(\.dataSourceRegistry) private var registry
@Dependency(\.defaultDatabase) private var database
/// Check all auto-tracked habits and create entries as needed
func processAutoTrackedHabits() async {
let habits = try await database.read { db in
try Habit.autoTracked.where(\.isActive).fetchAll(db)
}
logger.debug("Processing \(habits.count) auto-tracked habits")
for habit in habits {
await processHabit(habit)
}
}Navigation
Systemic uses Swift Navigation for state-driven routing, keeping flow changes predictable and easy to test.
Service Layer
Domain-specific services encapsulate business logic:
DatabaseService- All GRDB operationsAutoCompletionService- Unified auto-tracking and completion logicHealthKitClient- Health data access and authorizationGamificationService- Streaks and achievementsWidgetDataManager- Widget/App Intent data synchronization
Project Structure
Design Decisions
SQLite over CloudKit
Chose local SQLite for:
- Simplicity - No sync conflicts or server costs
- Offline-first - Works without network
- Privacy - Data stays on device
- Performance - Fast queries for analytics
Observable Theme System
Centralized theme provider enables reactive color updates:
@Observable
class ThemeProvider {
var current: Theme = .ember
var colorScheme: ColorScheme = .dark
var primary: Color { current.primary(for: colorScheme) }
var background: Color { current.background(for: colorScheme) }
}Challenges & Solutions
How to represent habit frequency without confusing the UI?
A HabitFrequency model normalizes scheduling rules and keeps the UI simple.
HealthKit, Screen Time, Calendar, and Location needed a single integration path.
A data-source registry standardizes metrics, auth, and progress for every source.
Widgets run out-of-process and need safe access to habit data.
App Groups with a shared SQLite database keep widgets consistent and fast.
What I Learned
- Local-first persistence with SQLiteData + GRDB
- Widget-first UX with WidgetKit + App Intents
- Dependency injection with swift-dependencies
- Auto-tracking architecture across multiple data sources
- Behavior design grounded in habit psychology
Roadmap
Polish + reliability
Auto-tracking stability, widget performance, and UX refinement
Insights + analytics
Heatmaps, trends, and correlation insights
Ecosystem
Live Activities, iCloud sync, Shortcuts, and Apple Watch
Future Enhancements
- Live Activities - Lock screen progress at a glance
- iCloud sync - Cross-device continuity
- Apple Watch app - Quick habit completion from wrist
- Shortcuts integration - Automate habit tracking
- Data export - CSV/JSON backup
- Insights AI - Pattern detection and suggestions
Related Blog Posts
Building Offline-First iOS Apps with GRDB
Deep dive into the local-first data layer.
SwiftUI Theming Patterns
How the theme system stays consistent across views.
Systemic Architecture Deep Dive
Coming soon: state, services, and data flow.