Skip to content
git-parth-chPublic

About

Full Xcode version with WidgetKit, Live Activities, Siri & HealthKit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Snabit — ML-Powered Habit Tracker

Warning

Note: This repository contains the full-fledged, feature-complete Xcode project for Snabit. A specialized, constrained version of this application was built using SwiftPM and officially submitted to the Apple Swift Student Challenge 2026. If you are looking for the exact SSC26 submission package, you can view that repository SNABIT SSC'26.

Snap the habit.

A full-featured iOS habit tracking app built for the iOS.
This is the complete Xcode version featuring WidgetKit, Live Activities, Siri Shortcuts, and HealthKit — the full engineering.


Features

  • Daily & Weekly Habits — Create habits with custom emoji, color, and goals
  • Streak Tracking — Current and best streak with automatic calculation
  • Gamification — Earn XP per completion with 7-day (+50 XP) and 30-day (+100 XP) streak bonuses
  • Achievements — 6 unlockable milestone badges
  • Visual Analytics — GitHub-style yearly heatmap and weekly bar chart via Swift Charts
  • ML Insights — On-device ML predictions for completion probability, best hour, streak risk, and weekly forecast
  • Smart Notifications — Reminders timed to your personal completion history, not a generic alarm
  • Home Screen Widget — Progress ring showing completed/total habits (small and medium sizes)
  • Lock Screen Widget — Quick habit count glanceable on lock screen
  • Dynamic Island — Live countdown timer displayed in the Dynamic Island during timed habit sessions
  • Live Activities — Full lock screen timer banner when running a timed habit
  • Siri Shortcuts — Log habits, check progress, and get streaks with voice commands
  • HealthKit Integration — Syncs water, exercise, and steps with Apple Health
  • Habit Notes — Journal entries with sentiment tracking per habit
  • Accessibility — VoiceOver support on core interactions and Dynamic Type via SwiftUI standard components
  • Local-First — Everything runs on device, no account required, no data leaves your phone

Siri Commands

Say these to interact with Snabit hands-free:

Phrase Action
"Log my habit in Snabit" Mark a habit complete
"Check my habits in Snabit" Get today's progress percentage
"What's my streak in Snabit" Get streak for a specific habit

Dynamic Island & Live Activities

Start a timed habit session from any habit card to trigger:

  • Compact — emoji + countdown in the Dynamic Island pill
  • Expanded — habit name, time remaining, and progress bar
  • Lock Screen — full banner with completed/total count

ML Approach

Snabit uses interpretable on-device statistical inference — no .mlmodel file, no network calls, no cold start problem:

  • Frequency Histogram — predicts your best completion hour from past patterns
  • Bayesian Inference with Laplace Smoothing — calculates daily completion probability per habit
  • Multi-Factor Risk Scoring — combines probability and time of day into a 0–3 streak risk level
  • Expected Value Calculation — forecasts weekly completions based on remaining days

Tech Stack

Technology Usage
SwiftUI All UI across every screen
SwiftData On-device persistence with @Model
Swift Charts Heatmap and weekly bar charts
WidgetKit Home screen and lock screen widgets
ActivityKit Live Activities and Dynamic Island
App Intents Siri Shortcuts integration
HealthKit Apple Health read and write
UserNotifications Smart ML-timed reminders
Combine ObservableObject / @Published

Project Structure

Snabit/
├── Snabit/
│   ├── SnabitApp.swift
│   ├── Models/
│   │   ├── Habit.swift
│   │   └── Achievement.swift
│   ├── Managers/
│   │   ├── GamificationManager.swift
│   │   ├── HealthKitManager.swift
│   │   ├── LiveActivityManager.swift
│   │   ├── MLPredictionManager.swift
│   │   └── SmartNotificationManager.swift
│   ├── Intents/
│   │   └── HabitAppIntents.swift
│   ├── Shared/
│   │   ├── SharedHabitStore.swift
│   │   └── HabitTimerAttributes.swift
│   └── Views/
│       ├── ContentView.swift
│       ├── OnboardingView.swift
│       ├── HomeView.swift
│       ├── StatsView.swift
│       ├── AchievementsView.swift
│       ├── ProfileView.swift
│       ├── AddHabitView.swift
│       ├── ManageHabitsView.swift
│       └── Components/
│           ├── HabitCardView.swift
│           ├── HeatMapView.swift
│           ├── ProgressChartView.swift
│           └── ConfettiView.swift
└── SnabitWidget/
    ├── SnabitWidgetBundle.swift
    ├── SnabitHabitWidget.swift
    └── SnabitLiveActivityWidget.swift

Requirements

  • iOS 17.0+
  • Xcode 15+
  • Physical device for HealthKit, Live Activities, and Dynamic Island
  • Apple Developer account for HealthKit and push notification entitlements

Getting Started

  1. Clone the repo
  2. Open Snabit.xcodeproj in Xcode 15+
  3. Set your Team in Signing & Capabilities for both the Snabit and SnabitWidget targets
  4. Add App Group group.parth.snabit to both targets
  5. Run on a physical iOS 17+ device for full feature access

Capability Checklist

Capability Target
App Group group.parth.snabit Snabit + SnabitWidget
HealthKit Snabit
Siri Snabit
Push Notifications Snabit
NSSupportsLiveActivities in Info.plist Snabit

Built with ❤️ by Parth

About

Full Xcode version with WidgetKit, Live Activities, Siri & HealthKit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages